spritely 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0ea70f1bb477a8c0c5e1e2def759600d00ef83c
|
4
|
+
data.tar.gz: e10782b4a0356ed81a5976856c3661c6b2e4e42f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0c772fc0b8a55757dab249c179f6070493d85065a96924193453b5648a7a544717a04ca49c3fcc3e20dd169374ceafa92e591056dfa85cf05198c5d1bea28ce
|
7
|
+
data.tar.gz: 770515f3cc9b52726adde50e09f62cf1230e250ab4476d2dfa7cc05d8c6a9f5114c85fb2d1002d1e4c719640a0fd3af9261ffc64bb9366508e49b76dce404806
|
data/lib/spritely/collection.rb
CHANGED
data/lib/spritely/version.rb
CHANGED
Binary file
|
@@ -43,4 +43,26 @@ describe 'Precompilation', :integration do
|
|
43
43
|
sprite_files = Dir.glob(File.join('public', 'assets', 'sprites', 'application-*.png'))
|
44
44
|
expect(sprite_files.length).to eq(2)
|
45
45
|
end
|
46
|
+
|
47
|
+
context 'a file is renamed multiple times' do
|
48
|
+
before do
|
49
|
+
compile_assets
|
50
|
+
FileUtils.mv 'app/assets/images/application/fool.png', 'app/assets/images/application/ffool.png'
|
51
|
+
compile_assets
|
52
|
+
FileUtils.mv 'app/assets/images/application/ffool.png', 'app/assets/images/application/afool.png'
|
53
|
+
compile_assets
|
54
|
+
end
|
55
|
+
|
56
|
+
it 'should end up with 2 different versions of the sprite' do
|
57
|
+
sprite_files = Dir.glob(File.join('public', 'assets', 'sprites', 'application-*.png'))
|
58
|
+
expect(sprite_files.length).to eq(2)
|
59
|
+
end
|
60
|
+
|
61
|
+
it 'should generate the correct sprite after all of the file-moving' do
|
62
|
+
runner %~Rails.application.assets["sprites/application.png"].write_to("compiled-sprite.png")~
|
63
|
+
compiled_sprite = ChunkyPNG::Image.from_file('compiled-sprite.png')
|
64
|
+
correct_sprite = ChunkyPNG::Image.from_file(File.join(__dir__, '..', 'fixtures', 'correct-renamed-sprite.png'))
|
65
|
+
expect(compiled_sprite).to eq(correct_sprite)
|
66
|
+
end
|
67
|
+
end
|
46
68
|
end
|
@@ -72,12 +72,14 @@ describe Spritely::Collection do
|
|
72
72
|
|
73
73
|
describe '#cache_key' do
|
74
74
|
before do
|
75
|
-
allow(Digest::MD5).to receive(:
|
76
|
-
allow(Digest::MD5).to receive(:
|
75
|
+
allow(Digest::MD5).to receive(:hexdigest).with('file-1.png').and_return('foo1')
|
76
|
+
allow(Digest::MD5).to receive(:hexdigest).with('file-2.png').and_return('bar1')
|
77
|
+
allow(Digest::MD5).to receive(:file).with('file-1.png').and_return('foo2')
|
78
|
+
allow(Digest::MD5).to receive(:file).with('file-2.png').and_return('bar2')
|
77
79
|
end
|
78
80
|
|
79
|
-
its(:cache_key) { should eq('
|
80
|
-
its(:to_s) { should eq('
|
81
|
+
its(:cache_key) { should eq('foo1foo2bar1bar2') }
|
82
|
+
its(:to_s) { should eq('foo1foo2bar1bar2') }
|
81
83
|
end
|
82
84
|
|
83
85
|
describe '#position!' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spritely
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex Robbin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chunky_png
|
@@ -184,6 +184,7 @@ files:
|
|
184
184
|
- lib/spritely/sprockets/transformer.rb
|
185
185
|
- lib/spritely/version.rb
|
186
186
|
- spec/fixtures/correct-empty-sprite.png
|
187
|
+
- spec/fixtures/correct-renamed-sprite.png
|
187
188
|
- spec/fixtures/correct-sprite.png
|
188
189
|
- spec/fixtures/correct-weird-sprite.png
|
189
190
|
- spec/fixtures/rails-app-changes/app/assets/images/application/dropdown-arrow.png
|
@@ -234,13 +235,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
235
|
version: '0'
|
235
236
|
requirements: []
|
236
237
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.5.
|
238
|
+
rubygems_version: 2.5.2
|
238
239
|
signing_key:
|
239
240
|
specification_version: 4
|
240
241
|
summary: Hooks into the Sprockets asset packaging system to allow you to easily generate
|
241
242
|
sprite maps
|
242
243
|
test_files:
|
243
244
|
- spec/fixtures/correct-empty-sprite.png
|
245
|
+
- spec/fixtures/correct-renamed-sprite.png
|
244
246
|
- spec/fixtures/correct-sprite.png
|
245
247
|
- spec/fixtures/correct-weird-sprite.png
|
246
248
|
- spec/fixtures/rails-app/app/assets/images/application/background.png
|