image_optim 0.17.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.markdown +4 -0
- data/image_optim.gemspec +1 -1
- data/lib/image_optim/bin_resolver.rb +2 -2
- data/spec/image_optim/bin_resolver_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZTM0NDFkYmE3MDIyOTgyMGNkMzEzNDk4NTk1NWI3MjM0ODU1NTJkYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2FlNDFjZmNhMDRhOTliOTdkYzA3MjcxMTE0Y2NiMjNiNTdiYWUxYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTBlZDI2NjQwMTkyMjNlYzg3YWUwNjI0NzgxMjgzY2M5ZjI1ZjdjZTg1MDlk
|
10
|
+
NjQ0MWExMzI1MGM2YjNkYjkwMDVmMjNhNTc5NWQ3MTk5YzY4ZGU5YTM0YTUy
|
11
|
+
YjhmOWUzMjg1Yzg0YWIxZGJjMzcxODY5NWYyMDRhMDQ2YzFiN2Y=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGI2OWRiNzAxZjhjMzM4N2QyZGFkMDc2N2U1NDM1N2YwNGM2NGJjYTE1MDg4
|
14
|
+
YmNkMTE1MGNlZTk3ODk5MWMwODVlY2UyYWUwYWIyNzllOTViMDA2NWYxNjI2
|
15
|
+
MjIxMDUzNmVlZTg4YTQxYWE1MWQ2NGMwNjYwMGQ5NDU5NzM3YmE=
|
data/CHANGELOG.markdown
CHANGED
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.17.
|
5
|
+
s.version = '0.17.1'
|
6
6
|
s.summary = %q{Optimize (lossless compress) images (jpeg, png, gif, svg) using external utilities (advpng, gifsicle, jpegoptim, jpegtran, optipng, pngcrush, pngout, pngquant, svgo)}
|
7
7
|
s.homepage = "http://github.com/toy/#{s.name}"
|
8
8
|
s.authors = ['Ivan Kuchin']
|
@@ -49,7 +49,7 @@ class ImageOptim
|
|
49
49
|
|
50
50
|
# Prepand `dir` and append `VENDOR_PATH` to `PATH` from environment
|
51
51
|
def env_path
|
52
|
-
[dir, ENV['PATH'], VENDOR_PATH].compact.join(
|
52
|
+
[dir, ENV['PATH'], VENDOR_PATH].compact.join(File::PATH_SEPARATOR)
|
53
53
|
end
|
54
54
|
|
55
55
|
# Collect resolving errors when running block over items of enumerable
|
@@ -103,7 +103,7 @@ class ImageOptim
|
|
103
103
|
def full_path(name)
|
104
104
|
# PATHEXT is needed only for windows
|
105
105
|
exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : ['']
|
106
|
-
|
106
|
+
env_path.split(File::PATH_SEPARATOR).each do |dir|
|
107
107
|
exts.each do |ext|
|
108
108
|
path = File.expand_path("#{name}#{ext}", dir)
|
109
109
|
return path if File.file?(path) && File.executable?(path)
|
@@ -34,6 +34,21 @@ describe ImageOptim::BinResolver do
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
it 'should find bin in vendor' do
|
38
|
+
with_env 'PATH', nil do
|
39
|
+
expect(full_path('jpegrescan')).
|
40
|
+
to eq(File.expand_path('vendor/jpegrescan'))
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should work with different path separator' do
|
45
|
+
stub_const('File::PATH_SEPARATOR', 'O_o')
|
46
|
+
with_env 'PATH', 'bin' do
|
47
|
+
expect(full_path('image_optim')).
|
48
|
+
to eq(File.expand_path('bin/image_optim'))
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
37
52
|
it 'should return nil on failure' do
|
38
53
|
with_env 'PATH', 'lib' do
|
39
54
|
expect(full_path('image_optim')).to be_nil
|
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.17.
|
4
|
+
version: 0.17.1
|
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-10-
|
11
|
+
date: 2014-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fspath
|