rapper 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +1 -0
- data/VERSION +1 -1
- data/lib/rapper/definition.rb +2 -1
- data/rapper.gemspec +1 -1
- data/spec/rapper_spec.rb +9 -2
- metadata +3 -3
data/README.markdown
CHANGED
@@ -126,6 +126,7 @@ Rapper's got a Gemfile. You know what to do.
|
|
126
126
|
|
127
127
|
## Version history
|
128
128
|
|
129
|
+
* **0.2.2** - Change tag_root behavior to not add `.../assets` path suffix when a `destination_root` is defined.
|
129
130
|
* **0.2.1** - Add tag_files() to get all file paths for a given asset.
|
130
131
|
* **0.2.0** - Custom asset destination roots, fix Rake task.
|
131
132
|
* **0.1.1** - Rake tasks.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/lib/rapper/definition.rb
CHANGED
@@ -33,7 +33,8 @@ module Rapper
|
|
33
33
|
|
34
34
|
# @return [String] The public url root for packaged asset files.
|
35
35
|
def asset_tag_root
|
36
|
-
@definition["tag_root"].gsub( /\/$/, '' )
|
36
|
+
@default_asset_tag_root ||= @definition["tag_root"].gsub( /\/$/, '' )
|
37
|
+
@definition["destination_root"] ? @default_asset_tag_root : @default_asset_tag_root + "/assets"
|
37
38
|
end
|
38
39
|
|
39
40
|
# @return [String] The suffix of files used in this definition.
|
data/rapper.gemspec
CHANGED
data/spec/rapper_spec.rb
CHANGED
@@ -136,11 +136,18 @@ describe Rapper do
|
|
136
136
|
end
|
137
137
|
|
138
138
|
describe "custom definition destination" do
|
139
|
+
before :each do
|
140
|
+
@rapper = Rapper::Engine.new( "spec/fixtures/config/assets.yml", "test_custom_destination" )
|
141
|
+
@rapper.package
|
142
|
+
end
|
143
|
+
|
139
144
|
it "works" do
|
140
|
-
rapper = Rapper::Engine.new( "spec/fixtures/config/assets.yml", "test_custom_destination" )
|
141
|
-
rapper.package
|
142
145
|
Dir[ "tmp/custom_destination/*" ].should == ["tmp/custom_destination/multiple_files.js"]
|
143
146
|
end
|
147
|
+
|
148
|
+
it "doesn't use the defaut .../assets tag root" do
|
149
|
+
@rapper.js_tag( "javascripts", "multiple_files" ).should == "<script src=\"/javascripts/multiple_files.js?v=f3d9\"></script>"
|
150
|
+
end
|
144
151
|
end
|
145
152
|
|
146
153
|
describe "packaging test cases" do
|
metadata
CHANGED