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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDA2ZGQwMGNiYTI1OTgxN2IyYWY1MmEyNDg0OTgwYzQ1YmY2ODk2MQ==
4
+ ZTM0NDFkYmE3MDIyOTgyMGNkMzEzNDk4NTk1NWI3MjM0ODU1NTJkYQ==
5
5
  data.tar.gz: !binary |-
6
- ZTdmNTAzMDYwMzRmM2ZlZmM5YTg4MDk5ZTgzNWJjZTUxZjY4OTA2YQ==
6
+ N2FlNDFjZmNhMDRhOTliOTdkYzA3MjcxMTE0Y2NiMjNiNTdiYWUxYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjM2NTMyODYxNDU2ZjNiOWQxYTE3NmY0NjgyMDY3ZGRmYjEzZDQzMTUwNmYy
10
- N2IyZTdhODAxYmI0YjRjMmM5YWY5MWFlNGI0MGU3M2FmZjMzYTc1ZWQzMzhl
11
- OWNjNGFlNzEyY2NjNDY1ODhmZTU1Mzk5MWQ5OTM4ZDQ0MmM3MWU=
9
+ OTBlZDI2NjQwMTkyMjNlYzg3YWUwNjI0NzgxMjgzY2M5ZjI1ZjdjZTg1MDlk
10
+ NjQ0MWExMzI1MGM2YjNkYjkwMDVmMjNhNTc5NWQ3MTk5YzY4ZGU5YTM0YTUy
11
+ YjhmOWUzMjg1Yzg0YWIxZGJjMzcxODY5NWYyMDRhMDQ2YzFiN2Y=
12
12
  data.tar.gz: !binary |-
13
- Y2NmZjlmODI1NDAyODk0NjAwYzRmYjUzNDU0ZTllMTNhYmM4NWRkYjQ3YmMz
14
- NDFkNDc2ZTIwNTBhOWZlNmQyYTQ2YTc0NDViYmY3NDg4Yzc0ZGNlN2JjMDA2
15
- MjRmOGNlNjdiNTE2YWQxMGE5Mjc5NDdkYTk1YTkzNWNlZDI0MjI=
13
+ OGI2OWRiNzAxZjhjMzM4N2QyZGFkMDc2N2U1NDM1N2YwNGM2NGJjYTE1MDg4
14
+ YmNkMTE1MGNlZTk3ODk5MWMwODVlY2UyYWUwYWIyNzllOTViMDA2NWYxNjI2
15
+ MjIxMDUzNmVlZTg4YTQxYWE1MWQ2NGMwNjYwMGQ5NDU5NzM3YmE=
data/CHANGELOG.markdown CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.17.1 (2014-10-06)
6
+
7
+ * Fix bin path resolving method missing vendor directory [@toy](https://github.com/toy)
8
+
5
9
  ## v0.17.0 (2014-10-04)
6
10
 
7
11
  * Use pure ruby detection of bin path [@toy](https://github.com/toy)
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.0'
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
- ENV['PATH'].to_s.split(File::PATH_SEPARATOR).each do |dir|
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.0
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-04 00:00:00.000000000 Z
11
+ date: 2014-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fspath