rails2_asset_pipeline 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/Readme.md +4 -0
- data/lib/rails2_asset_pipeline/jammit_converter.rb +3 -3
- data/lib/rails2_asset_pipeline/version.rb +1 -1
- data/spec/fake_rails/config/assets.yml +1 -1
- data/spec/rails2_asset_pipeline/tasks_spec.rb +2 -2
- data/spec/rails2_asset_pipeline/view_helpers_spec.rb +2 -2
- metadata +3 -3
data/Gemfile.lock
CHANGED
data/Readme.md
CHANGED
@@ -23,7 +23,7 @@ module Rails2AssetPipeline
|
|
23
23
|
content = File.read(file)
|
24
24
|
rex = /^(@import ['"].*).scss(['"]);/
|
25
25
|
if content =~ rex
|
26
|
-
File.open(file, 'w'){|f| f.write content.gsub(rex, "\\1
|
26
|
+
File.open(file, 'w'){|f| f.write content.gsub(rex, "\\1\\2;") }
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
@@ -38,8 +38,8 @@ module Rails2AssetPipeline
|
|
38
38
|
jammit["javascripts"].each do |pack, assets|
|
39
39
|
File.open("app/assets/javascripts/#{pack}.js", "w") do |f|
|
40
40
|
assets.each do |file|
|
41
|
-
fuzzy = /[
|
42
|
-
f.puts "//= #{file =~ fuzzy ? "require_tree" : "require"}
|
41
|
+
fuzzy = /[\/\*]*\*(.js)?$/
|
42
|
+
f.puts "//= #{file =~ fuzzy ? "require_tree ./" : "require "}#{file.sub("public/javascripts/", "").sub(".js","").sub(fuzzy,"")}"
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
@@ -78,7 +78,7 @@ describe "Rails2AssetPipeline Tasks" do
|
|
78
78
|
run "rake assets:convert_jammit"
|
79
79
|
run("ls app/assets").should == "javascripts\nstylesheets\n"
|
80
80
|
run("ls app/assets/javascripts").should == "a.js\nb.js\npack.js\n"
|
81
|
-
run("cat app/assets/javascripts/pack.js").should == "//= require a\n//= require b\n//= require_tree c\n"
|
81
|
+
run("cat app/assets/javascripts/pack.js").should == "//= require a\n//= require b\n//= require_tree ./c\n"
|
82
82
|
end
|
83
83
|
|
84
84
|
it "moves and combines stylesheets" do
|
@@ -103,7 +103,7 @@ describe "Rails2AssetPipeline Tasks" do
|
|
103
103
|
it "fixes broken inputs" do
|
104
104
|
write "public/stylesheets/c.css.scss", "a{}\n@import \"../global/_tables.scss\";\na{}"
|
105
105
|
run "rake assets:convert_jammit"
|
106
|
-
run("cat app/assets/stylesheets/c.css.scss").should == "a{}\n@import \"../global/_tables
|
106
|
+
run("cat app/assets/stylesheets/c.css.scss").should == "a{}\n@import \"../global/_tables\";\na{}"
|
107
107
|
end
|
108
108
|
end
|
109
109
|
end
|
@@ -18,13 +18,13 @@ describe Rails2AssetPipeline::ViewHelpers do
|
|
18
18
|
|
19
19
|
it "returns a path with md5 on production" do
|
20
20
|
Rails.env = "production"
|
21
|
-
env["xxx.js"] = mock(:digest => "abc"
|
21
|
+
env["xxx.js"] = mock(:digest => "abc")
|
22
22
|
pipeline_path("xxx.js").should == "/assets/xxx-abc.js"
|
23
23
|
end
|
24
24
|
|
25
25
|
it "returns a path with md5 on production and complicated file" do
|
26
26
|
Rails.env = "production"
|
27
|
-
env["xxx.yy.js"] = mock(:digest => "abc"
|
27
|
+
env["xxx.yy.js"] = mock(:digest => "abc")
|
28
28
|
pipeline_path("xxx.yy.js").should == "/assets/xxx-abc.yy.js"
|
29
29
|
end
|
30
30
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails2_asset_pipeline
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -67,7 +67,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
segments:
|
69
69
|
- 0
|
70
|
-
hash:
|
70
|
+
hash: 3376332490525238817
|
71
71
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
segments:
|
78
78
|
- 0
|
79
|
-
hash:
|
79
|
+
hash: 3376332490525238817
|
80
80
|
requirements: []
|
81
81
|
rubyforge_project:
|
82
82
|
rubygems_version: 1.8.24
|