image_optim 0.11.1 → 0.11.2
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 +8 -8
- data/image_optim.gemspec +1 -1
- data/lib/image_optim/bin_resolver.rb +2 -5
- data/spec/image_optim/bin_resolver_spec.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTcxZTdkMDdlYjUwYTg1MDQ4ODcwYTU0YTk3ODUyNjVjODhkMzFhMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MWExOGIwNzY3NGZhYjE2YTE1YmZkM2U3ODQ0YTQwYzMwMWMwZDdhMw==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MDg3NmY1ZTc2MDhkY2U2MDA2ODI3MzdlZDMzODRhNjM4MGFlZDQ1YTk0YjQw
|
10
|
+
NTdkNzRjNjIxZGFjNGMzYWIwOGYyOWFmOTRmMDc0NWY0ZDU1ZDM5MGQ4ZjI2
|
11
|
+
ODk1M2Y4NTU5NDIzYjhhOGVjZWZjNTc4ZjdlMWI0YjU0MDRjM2M=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODE4MzBjMTU2NjQyODM5MThiMmMzZGNkZDU2ZTdhN2NhNmY5OTljNzIyYWY5
|
14
|
+
ZTNlOWU1NzVhNmVhNDgwODM0YWJjMGZjYWFiMzQxNThiY2U3MzUzNzJiZDhl
|
15
|
+
MmVmMDRjYzYzZGVhN2EwZTBjZmU1NzM2YTJjMzMyZjI3MmQ0M2M=
|
data/image_optim.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'image_optim'
|
5
|
-
s.version = '0.11.
|
5
|
+
s.version = '0.11.2'
|
6
6
|
s.summary = %q{Optimize (lossless compress) images (jpeg, png, gif, svg) using external utilities (advpng, gifsicle, jpegoptim, jpegtran, optipng, pngcrush, pngout, svgo)}
|
7
7
|
s.homepage = "http://github.com/toy/#{s.name}"
|
8
8
|
s.authors = ['Ivan Kuchin']
|
@@ -23,7 +23,7 @@ class ImageOptim
|
|
23
23
|
VENDOR_PATH = File.expand_path('../../../vendor', __FILE__)
|
24
24
|
|
25
25
|
def env_path
|
26
|
-
|
26
|
+
[dir, ENV['PATH'], VENDOR_PATH].compact.join(':')
|
27
27
|
end
|
28
28
|
|
29
29
|
private
|
@@ -36,11 +36,8 @@ class ImageOptim
|
|
36
36
|
end
|
37
37
|
symlink = @dir / bin
|
38
38
|
symlink.make_symlink(File.expand_path(path))
|
39
|
-
|
40
|
-
accessible?(symlink)
|
41
|
-
else
|
42
|
-
accessible?(bin)
|
43
39
|
end
|
40
|
+
accessible?(bin)
|
44
41
|
end
|
45
42
|
|
46
43
|
def accessible?(bin)
|
@@ -19,6 +19,7 @@ describe ImageOptim::BinResolver do
|
|
19
19
|
5.times do
|
20
20
|
resolver.resolve!(:ls).should be_true
|
21
21
|
end
|
22
|
+
resolver.env_path.should == "#{ENV['PATH']}:#{ImageOptim::BinResolver::VENDOR_PATH}"
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
@@ -29,7 +30,7 @@ describe ImageOptim::BinResolver do
|
|
29
30
|
symlink = double(:symlink)
|
30
31
|
|
31
32
|
resolver = ImageOptim::BinResolver.new
|
32
|
-
resolver.should_receive(:accessible?).with(
|
33
|
+
resolver.should_receive(:accessible?).with(:image_optim).once.and_return(true)
|
33
34
|
FSPath.should_receive(:temp_dir).once.and_return(tmpdir)
|
34
35
|
tmpdir.should_receive(:/).with(:image_optim).once.and_return(symlink)
|
35
36
|
symlink.should_receive(:make_symlink).with(File.expand_path(path)).once
|
@@ -42,6 +43,7 @@ describe ImageOptim::BinResolver do
|
|
42
43
|
5.times do
|
43
44
|
resolver.resolve!(:image_optim).should be_true
|
44
45
|
end
|
46
|
+
resolver.env_path.should == "#{tmpdir.to_str}:#{ENV['PATH']}:#{ImageOptim::BinResolver::VENDOR_PATH}"
|
45
47
|
|
46
48
|
FileUtils.should_receive(:remove_entry_secure).with(tmpdir)
|
47
49
|
at_exit_blocks.each(&:call)
|
@@ -59,6 +61,7 @@ describe ImageOptim::BinResolver do
|
|
59
61
|
resolver.resolve!(:should_not_exist)
|
60
62
|
end.to raise_error ImageOptim::BinNotFoundError
|
61
63
|
end
|
64
|
+
resolver.env_path.should == "#{ENV['PATH']}:#{ImageOptim::BinResolver::VENDOR_PATH}"
|
62
65
|
end
|
63
66
|
end
|
64
67
|
|
@@ -69,7 +72,7 @@ describe ImageOptim::BinResolver do
|
|
69
72
|
symlink = double(:symlink)
|
70
73
|
|
71
74
|
resolver = ImageOptim::BinResolver.new
|
72
|
-
resolver.should_receive(:accessible?).with(
|
75
|
+
resolver.should_receive(:accessible?).with(:should_not_exist).once.and_return(false)
|
73
76
|
FSPath.should_receive(:temp_dir).once.and_return(tmpdir)
|
74
77
|
tmpdir.should_receive(:/).with(:should_not_exist).once.and_return(symlink)
|
75
78
|
symlink.should_receive(:make_symlink).with(File.expand_path(path)).once
|
@@ -84,6 +87,7 @@ describe ImageOptim::BinResolver do
|
|
84
87
|
resolver.resolve!(:should_not_exist)
|
85
88
|
end.to raise_error ImageOptim::BinNotFoundError
|
86
89
|
end
|
90
|
+
resolver.env_path.should == "#{tmpdir.to_str}:#{ENV['PATH']}:#{ImageOptim::BinResolver::VENDOR_PATH}"
|
87
91
|
|
88
92
|
FileUtils.should_receive(:remove_entry_secure).with(tmpdir)
|
89
93
|
at_exit_blocks.each(&:call)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_optim
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Kuchin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fspath
|