Skip to content

Commit 97f064b

Browse files
committed
Merge pull request documentcloud#267 from documentcloud/rails4
Merge rails4 branch into master
2 parents 98b50a6 + f0b4e7e commit 97f064b

23 files changed

+207
-70
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
example
44
raws
55
test/precache
6+
.ruby-version

Gemfile

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ source 'http://rubygems.org'
33
gemspec
44

55
group :development, :test do
6-
gem "rake", "0.9.2.2"
7-
gem "rails", "2.3.14"
8-
gem "cssmin", "1.0.3"
9-
gem "jsmin", "1.0.1"
10-
gem "yui-compressor", "0.11.0"
11-
gem "closure-compiler", "1.1.6"
12-
gem "uglifier", "1.3.0"
13-
gem "sass", "3.2.7"
6+
gem "rake", "~>10.3"
7+
gem "rails", "~>4.0"
8+
gem "cssmin", "~>1.0"
9+
gem "jsmin", "~>1.0.1"
10+
gem "yui-compressor", "~>0.12"
11+
gem "closure-compiler", "~>1.1"
12+
gem "uglifier", "~>2.5"
13+
gem "sass", "~>3.4"
1414
end
1515

1616
group :development do
17-
gem "RedCloth", "4.2.9"
18-
gem "redgreen", "1.2.2"
17+
gem "RedCloth", "~>4.2"
1918
end

Gemfile.lock

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
PATH
2+
remote: .
3+
specs:
4+
jammit (0.6.6)
5+
cssmin (>= 1.0.3)
6+
jsmin (>= 1.0.1)
7+
8+
GEM
9+
remote: http://rubygems.org/
10+
specs:
11+
RedCloth (4.2.9)
12+
actionmailer (4.2.3)
13+
actionpack (= 4.2.3)
14+
actionview (= 4.2.3)
15+
activejob (= 4.2.3)
16+
mail (~> 2.5, >= 2.5.4)
17+
rails-dom-testing (~> 1.0, >= 1.0.5)
18+
actionpack (4.2.3)
19+
actionview (= 4.2.3)
20+
activesupport (= 4.2.3)
21+
rack (~> 1.6)
22+
rack-test (~> 0.6.2)
23+
rails-dom-testing (~> 1.0, >= 1.0.5)
24+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
25+
actionview (4.2.3)
26+
activesupport (= 4.2.3)
27+
builder (~> 3.1)
28+
erubis (~> 2.7.0)
29+
rails-dom-testing (~> 1.0, >= 1.0.5)
30+
rails-html-sanitizer (~> 1.0, >= 1.0.2)
31+
activejob (4.2.3)
32+
activesupport (= 4.2.3)
33+
globalid (>= 0.3.0)
34+
activemodel (4.2.3)
35+
activesupport (= 4.2.3)
36+
builder (~> 3.1)
37+
activerecord (4.2.3)
38+
activemodel (= 4.2.3)
39+
activesupport (= 4.2.3)
40+
arel (~> 6.0)
41+
activesupport (4.2.3)
42+
i18n (~> 0.7)
43+
json (~> 1.7, >= 1.7.7)
44+
minitest (~> 5.1)
45+
thread_safe (~> 0.3, >= 0.3.4)
46+
tzinfo (~> 1.1)
47+
arel (6.0.0)
48+
builder (3.2.2)
49+
closure-compiler (1.1.11)
50+
cssmin (1.0.3)
51+
erubis (2.7.0)
52+
execjs (2.5.2)
53+
globalid (0.3.5)
54+
activesupport (>= 4.1.0)
55+
i18n (0.7.0)
56+
jsmin (1.0.1)
57+
json (1.8.3)
58+
loofah (2.0.2)
59+
nokogiri (>= 1.5.9)
60+
mail (2.6.3)
61+
mime-types (>= 1.16, < 3)
62+
mime-types (2.6.1)
63+
mini_portile (0.6.2)
64+
minitest (5.7.0)
65+
nokogiri (1.6.6.2)
66+
mini_portile (~> 0.6.0)
67+
rack (1.6.4)
68+
rack-test (0.6.3)
69+
rack (>= 1.0)
70+
rails (4.2.3)
71+
actionmailer (= 4.2.3)
72+
actionpack (= 4.2.3)
73+
actionview (= 4.2.3)
74+
activejob (= 4.2.3)
75+
activemodel (= 4.2.3)
76+
activerecord (= 4.2.3)
77+
activesupport (= 4.2.3)
78+
bundler (>= 1.3.0, < 2.0)
79+
railties (= 4.2.3)
80+
sprockets-rails
81+
rails-deprecated_sanitizer (1.0.3)
82+
activesupport (>= 4.2.0.alpha)
83+
rails-dom-testing (1.0.6)
84+
activesupport (>= 4.2.0.beta, < 5.0)
85+
nokogiri (~> 1.6.0)
86+
rails-deprecated_sanitizer (>= 1.0.1)
87+
rails-html-sanitizer (1.0.2)
88+
loofah (~> 2.0)
89+
railties (4.2.3)
90+
actionpack (= 4.2.3)
91+
activesupport (= 4.2.3)
92+
rake (>= 0.8.7)
93+
thor (>= 0.18.1, < 2.0)
94+
rake (10.4.2)
95+
sass (3.4.15)
96+
sprockets (3.2.0)
97+
rack (~> 1.0)
98+
sprockets-rails (2.3.2)
99+
actionpack (>= 3.0)
100+
activesupport (>= 3.0)
101+
sprockets (>= 2.8, < 4.0)
102+
thor (0.19.1)
103+
thread_safe (0.3.5)
104+
tzinfo (1.2.2)
105+
thread_safe (~> 0.1)
106+
uglifier (2.7.1)
107+
execjs (>= 0.3.0)
108+
json (>= 1.8.0)
109+
yui-compressor (0.12.0)
110+
111+
PLATFORMS
112+
ruby
113+
114+
DEPENDENCIES
115+
RedCloth (~> 4.2)
116+
closure-compiler (~> 1.1)
117+
cssmin (~> 1.0)
118+
jammit!
119+
jsmin (~> 1.0.1)
120+
rails (~> 4.0)
121+
rake (~> 10.3)
122+
sass (~> 3.4)
123+
uglifier (~> 2.5)
124+
yui-compressor (~> 0.12)

Rakefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ desc 'Run all tests'
44
task :test, [:path] do |task, args|
55
ENV['RAILS_ENV'] = 'test'
66
$LOAD_PATH.unshift(File.expand_path('test'))
7-
require 'redgreen' unless Gem::Specification.find_all_by_name('redgreen').empty?
8-
require 'test/unit'
97
if args[:path]
10-
require args[:path]
8+
require_relative args[:path]
119
else
1210
Dir['test/*/**/test_*.rb'].each {|test| require "./#{test}" }
1311
end

lib/jammit/helper.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ def include_stylesheets(*packages)
2626
# except in development, where it references the individual scripts.
2727
def include_javascripts(*packages)
2828
options = packages.extract_options!
29+
options.merge!(:extname=>false)
2930
html_safe packages.map {|pack|
3031
should_package? ? Jammit.asset_url(pack, :js) : Jammit.packager.individual_urls(pack.to_sym, :js)
3132
}.flatten.map {|pack|
32-
javascript_include_tag pack, options
33+
"<script src=\"#{pack}\"></script>"
3334
}.join("\n")
3435
end
3536

lib/jammit/sass_compressor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ def initialize(options = {})
1010
# Compresses +css+ using sass' CSS parser, and returns the
1111
# compressed css.
1212
def compress(css)
13-
root_node = ::Sass::SCSS::CssParser.new(css, 'jammit-combined-input').parse
13+
root_node = ::Sass::SCSS::CssParser.new(css, 'jammit-combined-input', "jammit").parse
1414
root_node.options = {:style => :compressed}
1515
root_node.render.strip
1616
end
17-
end
17+
end

test/fixtures/jammed/js_test-uglifier.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--[if (!IE)|(gte IE 8)]><!-->
2-
<link href="/assets/css_test-datauri.css?101" media="screen" rel="stylesheet" type="text/css" />
2+
<link href="/assets/css_test-datauri.css" media="screen" rel="stylesheet" />
33
<!--<![endif]-->
44
<!--[if lte IE 7]>
5-
<link href="http://github.com/assets/css_test-mhtml.css%3Cspan%20class="x x-first x-last">?101" media="screen" rel="stylesheet" type="text/css" />
5+
<link href="http://github.com/assets/css_test-mhtml.css" media="screen" rel="stylesheet" />
66
<![endif]-->
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
<link href="/fixtures/src/test1.css?101" media="screen" rel="stylesheet" type="text/css" />
2-
<link href="/fixtures/src/test2.css?101" media="screen" rel="stylesheet" type="text/css" />
3-
<link href="/fixtures/src/test_fonts.css?101" media="screen" rel="stylesheet" type="text/css" />
1+
<link href="/fixtures/src/test1.css" media="screen" rel="stylesheet" />
2+
<link href="/fixtures/src/test2.css" media="screen" rel="stylesheet" />
3+
<link href="/fixtures/src/test_fonts.css" media="screen" rel="stylesheet" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<link href="/assets/css_test.css?101" media="screen" rel="stylesheet" type="text/css" />
1+
<link href="/assets/css_test.css" media="screen" rel="stylesheet" />

0 commit comments

Comments
 (0)