image_optim 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
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.2.0'
5
+ s.version = '0.2.1'
6
6
  s.summary = %q{Optimize images (jpeg, png, gif) using external utilities (advpng, gifsicle, jpegoptim, jpegtran, optipng, pngcrush, pngout)}
7
7
  s.homepage = "http://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
@@ -1,3 +1,5 @@
1
+ require 'shellwords'
2
+
1
3
  class ImageOptim
2
4
  module Util
3
5
  # Run command redirecting both stdout and stderr to /dev/null, raising signal if command was signaled and return successfulness
@@ -35,7 +35,7 @@ class ImageOptim
35
35
  def initialize(options = {})
36
36
  get_option!(options, :bin, default_bin)
37
37
  parse_options(options)
38
- raise "`#{bin}` not found" unless Util.run('which', bin)
38
+ raise "`#{bin}` not found" if `which #{bin.to_s.shellescape}`.empty?
39
39
  assert_options_empty!(options)
40
40
  end
41
41
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_optim
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 0
10
- version: 0.2.0
9
+ - 1
10
+ version: 0.2.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ivan Kuchin