retina_rails 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -55,7 +55,7 @@ module RetinaRails
55
55
  ## Set the correct filename for storage according to the convention (append @2x to filename)
56
56
  def full_filename(for_file)
57
57
  super.tap do |file_name|
58
- file_name.gsub!('.', '@2x.').gsub!('retina_', '') if version_name.to_s.include?('retina')
58
+ file_name.sub!(/(.*)\./, '\1@2x.').gsub!('retina_', '') if version_name.to_s.include?('retina')
59
59
  end
60
60
  end
61
61
 
@@ -1,3 +1,3 @@
1
1
  module RetinaRails
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -134,4 +134,17 @@ describe RetinaRails::CarrierWave do
134
134
 
135
135
  end
136
136
 
137
+ context 'file with multiple dots' do
138
+
139
+ before do
140
+ AnonymousUploader.enable_processing = true
141
+ @uploader = AnonymousUploader.new(CarrierWaveUpload.new, :avatar)
142
+ @uploader.store!(File.open("#{File.dirname(__FILE__)}/fixtures/images/avatar.with.dots.jpeg"))
143
+ end
144
+
145
+ it { File.basename(@uploader.small.current_path, 'jpeg').should == 'small_avatar.with.dots.' }
146
+ it { File.basename(@uploader.small_retina.current_path, 'jpeg').should == 'small_avatar.with.dots@2x.' }
147
+
148
+ end
149
+
137
150
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retina_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -199,6 +199,7 @@ files:
199
199
  - spec/extensions_spec.rb
200
200
  - spec/fixtures/db/retina_rails.sqlite3
201
201
  - spec/fixtures/images/avatar.jpeg
202
+ - spec/fixtures/images/avatar.with.dots.jpeg
202
203
  - spec/fixtures/manifest.yml
203
204
  - spec/helpers_spec.rb
204
205
  - spec/paperclip_spec.rb
@@ -235,6 +236,7 @@ test_files:
235
236
  - spec/extensions_spec.rb
236
237
  - spec/fixtures/db/retina_rails.sqlite3
237
238
  - spec/fixtures/images/avatar.jpeg
239
+ - spec/fixtures/images/avatar.with.dots.jpeg
238
240
  - spec/fixtures/manifest.yml
239
241
  - spec/helpers_spec.rb
240
242
  - spec/paperclip_spec.rb