rapper 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -1
- data/VERSION +1 -1
- data/lib/rapper/html_tags.rb +3 -2
- data/rapper.gemspec +1 -1
- data/spec/fixtures/config/assets.yml +8 -0
- data/spec/rapper_spec.rb +5 -3
- metadata +3 -3
data/README.markdown
CHANGED
@@ -126,7 +126,7 @@ Rapper's got a Gemfile. You know what to do.
|
|
126
126
|
|
127
127
|
## Version history
|
128
128
|
|
129
|
-
* **0.2.
|
129
|
+
* **0.2.4** - Add tag_paths() to get all file paths for a given asset.
|
130
130
|
* **0.2.2** - Change tag_root behavior to not add `.../assets` path suffix when a `destination_root` is defined.
|
131
131
|
* **0.2.1** - Add tag_files() to get all file paths for a given asset.
|
132
132
|
* **0.2.0** - Custom asset destination roots, fix Rake task.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.4
|
data/lib/rapper/html_tags.rb
CHANGED
@@ -60,11 +60,12 @@ module Rapper
|
|
60
60
|
|
61
61
|
# Same as `tag_files`, but includes version query string if needed.
|
62
62
|
def tag_paths( type, name )
|
63
|
+
definition = @definitions[type]
|
63
64
|
if self.get_config( 'version' )
|
64
65
|
version = definition.get_version( name )
|
65
|
-
|
66
|
+
tag_files( type, name ).map{|path| "#{path}?v=#{version}"}
|
66
67
|
else
|
67
|
-
|
68
|
+
tag_files( type, name )
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
data/rapper.gemspec
CHANGED
@@ -32,6 +32,14 @@ test_custom_destination:
|
|
32
32
|
definition_root: spec/fixtures/config/asset_definitions/custom_destination
|
33
33
|
bundle: true
|
34
34
|
compress: false
|
35
|
+
test_tag_paths:
|
36
|
+
<<: *base
|
37
|
+
bundle: true
|
38
|
+
version: true
|
39
|
+
test_tag_paths_no_bundle:
|
40
|
+
<<: *base
|
41
|
+
bundle: false
|
42
|
+
version: true
|
35
43
|
xhtml_tags:
|
36
44
|
<<: *base
|
37
45
|
version: false
|
data/spec/rapper_spec.rb
CHANGED
@@ -68,12 +68,14 @@ describe Rapper do
|
|
68
68
|
]
|
69
69
|
end
|
70
70
|
|
71
|
-
it "provides tag files" do
|
72
|
-
rapper = Rapper::Engine.new( "spec/fixtures/config/assets.yml", "
|
71
|
+
it "provides tag files and paths" do
|
72
|
+
rapper = Rapper::Engine.new( "spec/fixtures/config/assets.yml", "test_tag_paths" )
|
73
73
|
rapper.tag_files( "javascripts", "multiple_files" ).should == ["/javascripts/assets/multiple_files.js"]
|
74
|
+
rapper.tag_paths( "javascripts", "multiple_files" ).should == ["/javascripts/assets/multiple_files.js?v=f3d9"]
|
74
75
|
|
75
|
-
rapper = Rapper::Engine.new( "spec/fixtures/config/assets.yml", "
|
76
|
+
rapper = Rapper::Engine.new( "spec/fixtures/config/assets.yml", "test_tag_paths_no_bundle" )
|
76
77
|
rapper.tag_files( "javascripts", "multiple_files" ).should == ["/javascripts/simple_1.js", "/javascripts/simple_2.js"]
|
78
|
+
rapper.tag_paths( "javascripts", "multiple_files" ).should == ["/javascripts/simple_1.js?v=f3d9", "/javascripts/simple_2.js?v=f3d9"]
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
metadata
CHANGED