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 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
1
+ 0.2.2
@@ -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( /\/$/, '' ) + "/assets"
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{rapper}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tyson Tate"]
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
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 19
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 1
10
- version: 0.2.1
9
+ - 2
10
+ version: 0.2.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tyson Tate