image_optim 0.26.1 → 0.26.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ee767f813631dc2d9c8e6fa29215c7a03fc27c47
4
- data.tar.gz: 1e6475763f0e1f2966d9f6eef4ae5b39e1daa700
2
+ SHA256:
3
+ metadata.gz: 07b7d1d96cc0bc6f16e0a2b6a512c4ad06015eea55359dcc9c32c2b19714c786
4
+ data.tar.gz: be1136efd362c8f13f8a286728fc3c49f62af439cdea90d60c68e4093c1be72a
5
5
  SHA512:
6
- metadata.gz: 059eb206df2283758e5e937728b57a0e9aa558b791a2b07a01eb6087b3fdd268dfb9520b9b9f35b63e6fd604f7f26e2c3f53589818ef6c887a1e1d178282b758
7
- data.tar.gz: 6fc6ac440fdb1661372d038c1bdb50eed3a782b04846a22de2757cb2e8c770de665ca6d5ab1d90f91025c078a44ff684177522469c6af733ea216c13ec179280
6
+ metadata.gz: 82ac7498fa95948f7e6a6380695be2da56436245d4fd595d704b4a8e78d59bb4c483690e8a8ac992ea5bf34fc0f37180ea1e103d76c8ac523975bd8a7690b1e5
7
+ data.tar.gz: cb3d17d491ec5accbf9d94caac4725b849e5e42f212b464b1a08b1f0545f0844193154c8c2c141377193a5234e45b70a207fb4a642f2625e0668e08e8821f046
@@ -1,7 +1,7 @@
1
1
  version: '{build}-{branch}'
2
2
  install:
3
3
  - mkdir tmp\bin || exit 0
4
- - set PATH=%cd%\tmp\bin;%PATH%
4
+ - set PATH=C:\Ruby25-x64\bin;%cd%\tmp\bin;%PATH%
5
5
  - ruby --version
6
6
  - bundle package --all
7
7
 
@@ -15,6 +15,9 @@ Layout/CaseIndentation:
15
15
  Layout/DotPosition:
16
16
  EnforcedStyle: trailing
17
17
 
18
+ Layout/EndAlignment:
19
+ EnforcedStyleAlignWith: variable
20
+
18
21
  Layout/IndentArray:
19
22
  EnforcedStyle: consistent
20
23
 
@@ -29,6 +32,7 @@ Layout/IndentHeredoc:
29
32
 
30
33
  Layout/SpaceBeforeBlockBraces:
31
34
  EnforcedStyle: no_space
35
+ EnforcedStyleForEmptyBraces: no_space
32
36
 
33
37
  Layout/SpaceInsideHashLiteralBraces:
34
38
  EnforcedStyle: no_space
@@ -37,12 +41,12 @@ Lint/AmbiguousBlockAssociation:
37
41
  Exclude:
38
42
  - spec/**/*_spec.rb
39
43
 
40
- Lint/EndAlignment:
41
- EnforcedStyleAlignWith: variable
42
-
43
44
  Lint/NestedPercentLiteral:
44
45
  Enabled: false
45
46
 
47
+ Lint/UnneededRequireStatement:
48
+ Enabled: false
49
+
46
50
  Lint/UnneededSplatExpansion:
47
51
  Enabled: false
48
52
 
@@ -83,6 +87,9 @@ Style/EmptyCaseCondition:
83
87
  Style/Encoding:
84
88
  Enabled: false
85
89
 
90
+ Style/ExpandPathArguments:
91
+ Enabled: false
92
+
86
93
  Style/FormatStringToken:
87
94
  Enabled: false
88
95
 
@@ -110,5 +117,8 @@ Style/SymbolArray:
110
117
  Style/TrailingCommaInArguments:
111
118
  EnforcedStyleForMultiline: no_comma
112
119
 
113
- Style/TrailingCommaInLiteral:
120
+ Style/TrailingCommaInArrayLiteral:
121
+ EnforcedStyleForMultiline: comma
122
+
123
+ Style/TrailingCommaInHashLiteral:
114
124
  EnforcedStyleForMultiline: comma
@@ -10,9 +10,10 @@ rvm:
10
10
  - '1.9.3-p551'
11
11
  - '2.0.0-p648'
12
12
  - '2.1.10'
13
- - '2.2.8'
14
- - '2.3.5'
15
- - '2.4.2'
13
+ - '2.2.10'
14
+ - '2.3.7'
15
+ - '2.4.4'
16
+ - '2.5.1'
16
17
  - 'jruby-9.0.5.0'
17
18
  - 'jruby-9.1.9.0'
18
19
  script:
@@ -20,24 +21,24 @@ script:
20
21
  - bundle exec rspec
21
22
  before_install:
22
23
  - gem update --system
23
- - gem update bundler
24
+ - gem install bundler
24
25
  - nvm install stable
25
26
  - mkdir -p ~/bin
26
27
  - command -v svgo || npm install -g svgo
27
- - command -v pngout || curl -L "http://static.jonof.id.au/dl/kenutils/pngout-20130221-linux.tar.gz" | tar -xz -C ~/bin --strip-components 2 --wildcards '*/x86_64/pngout'
28
+ - command -v pngout || curl -L "http://static.jonof.id.au/dl/kenutils/pngout-20150319-linux.tar.gz" | tar -xz -C ~/bin --strip-components 2 --wildcards '*/x86_64/pngout'
28
29
  matrix:
29
30
  include:
30
31
  - env: CODECLIMATE=✓
31
- rvm: '2.4.2'
32
+ rvm: '2.4.4'
32
33
  after_success: bundle exec codeclimate-test-reporter
33
34
  - env: RUBOCOP=✓
34
- rvm: '2.4.2'
35
+ rvm: '2.4.4'
35
36
  script: bundle exec rubocop
36
- before_install:
37
+ before_install: gem update --system && gem install bundler
37
38
  - env: CHECK_RUBIES=✓
38
- rvm: '2.4.2'
39
+ rvm: '2.4.4'
39
40
  script: bundle exec travis_check_rubies
40
- before_install:
41
+ before_install: gem update --system && gem install bundler
41
42
  addons:
42
43
  code_climate:
43
44
  repo_token:
@@ -2,6 +2,13 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.26.2 (2018-08-15)
6
+
7
+ * Ignore segmentation fault for `pngout` <= `20150920` [#158](https://github.com/toy/image_optim/issues/158) [@toy](https://github.com/toy)
8
+ * Allow `image_size` 2.x [@toy](https://github.com/toy)
9
+ * Add instructions for installing `svgo` in project folder [#156](https://github.com/toy/image_optim/issues/156) [@brian-kephart](https://github.com/brian-kephart)
10
+ * Show full bin search path in verbose output [@toy](https://github.com/toy)
11
+
5
12
  ## v0.26.1 (2017-12-14)
6
13
 
7
14
  * Require `'date'` which is used in parsing pngout version [toy/image_optim_pack#14](https://github.com/toy/image_optim_pack/issues/14) [@toy](https://github.com/toy)
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012-2017 Ivan Kuchin
1
+ Copyright (c) 2012-2018 Ivan Kuchin
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,14 +1,14 @@
1
1
  [![Gem Version](https://img.shields.io/gem/v/image_optim.svg?style=flat)](https://rubygems.org/gems/image_optim)
2
2
  [![Build Status](https://img.shields.io/travis/toy/image_optim/master.svg?style=flat)](https://travis-ci.org/toy/image_optim)
3
3
  [![AppVeyor Status](https://img.shields.io/appveyor/ci/toy/image-optim/master.svg?style=flat&label=windows)](https://ci.appveyor.com/project/toy/image-optim)
4
- [![Code Climate](https://img.shields.io/codeclimate/github/toy/image_optim.svg?style=flat)](https://codeclimate.com/github/toy/image_optim)
5
- [![Code Climate Coverage](https://img.shields.io/codeclimate/coverage/github/toy/image_optim.svg?style=flat)](https://codeclimate.com/github/toy/image_optim)
4
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/toy/image_optim.svg?style=flat)](https://codeclimate.com/github/toy/image_optim)
5
+ [![Code Climate Coverage](https://img.shields.io/codeclimate/c/toy/image_optim.svg?style=flat)](https://codeclimate.com/github/toy/image_optim)
6
6
  [![Dependency Status](https://img.shields.io/gemnasium/toy/image_optim.svg?style=flat)](https://gemnasium.com/toy/image_optim)
7
7
  [![Inch CI](https://inch-ci.org/github/toy/image_optim.svg?branch=master&style=flat)](https://inch-ci.org/github/toy/image_optim)
8
8
 
9
9
  # image_optim
10
10
 
11
- Optimize (lossless compress, optionally lossy) images (jpeg, png, gif, svg) using external utilities:
11
+ Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities:
12
12
 
13
13
  * [advpng](http://advancemame.sourceforge.net/doc-advpng.html) from [AdvanceCOMP](http://advancemame.sourceforge.net/comp-readme.html)
14
14
  (will use [zopfli](https://code.google.com/p/zopfli/) on default/maximum level 4)
@@ -25,7 +25,7 @@ Optimize (lossless compress, optionally lossy) images (jpeg, png, gif, svg) usin
25
25
 
26
26
  Based on [ImageOptim.app](http://imageoptim.com/).
27
27
 
28
- Documentation for [latest version](http://rubydoc.info/gems/image_optim/frames) and [master](http://rubydoc.info/github/toy/image_optim/master/frames).
28
+ Documentation for [latest gem version](http://rubydoc.info/gems/image_optim/frames) and [master branch](http://rubydoc.info/github/toy/image_optim/master/frames).
29
29
 
30
30
  ## Gem installation
31
31
 
@@ -178,6 +178,20 @@ _Note: pngout is free to use even in commercial soft, but you can not redistribu
178
178
  npm install -g svgo
179
179
  ```
180
180
 
181
+ If you prefer to install `svgo` to your project directory, use one of the following commands instead:
182
+
183
+ ```bash
184
+ npm install svgo
185
+
186
+ yarn add svgo
187
+ ```
188
+
189
+ When installing `svgo` to the project directory, you must add the following to your environment:
190
+
191
+ ```
192
+ SVGO_BIN='node_modules/svgo/bin/svgo'
193
+ ```
194
+
181
195
  ### jpeg-recompress installation (optional)
182
196
 
183
197
  Download and install the `jpeg-recompress` binary from the [JPEG-Archive Releases](https://github.com/danielgtaylor/jpeg-archive/releases) page,
@@ -341,4 +355,4 @@ In separate file [CHANGELOG.markdown](CHANGELOG.markdown).
341
355
 
342
356
  ## Copyright
343
357
 
344
- Copyright (c) 2012-2017 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
358
+ Copyright (c) 2012-2018 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
@@ -2,14 +2,21 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim'
5
- s.version = '0.26.1'
6
- s.summary = %q{Optimize (lossless compress, optionally lossy) images (jpeg, png, gif, svg) using external utilities (advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout, pngquant, svgo)}
5
+ s.version = '0.26.2'
6
+ s.summary = %q{Command line tool and ruby interface to optimize (lossless compress, optionally lossy) jpeg, png, gif and svg images using external utilities (advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout, pngquant, svgo)}
7
7
  s.homepage = "http://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
9
9
  s.license = 'MIT'
10
10
 
11
11
  s.rubyforge_project = s.name
12
12
 
13
+ s.metadata = {
14
+ 'bug_tracker_uri' => "https://github.com/toy/#{s.name}/issues",
15
+ 'changelog_uri' => "https://github.com/toy/#{s.name}/CHANGELOG.markdown",
16
+ 'documentation_uri' => "https://www.rubydoc.info/gems/#{s.name}/#{s.version}",
17
+ 'source_code_uri' => "https://github.com/toy/#{s.name}",
18
+ }
19
+
13
20
  s.files = `git ls-files`.split("\n")
14
21
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
22
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
@@ -21,14 +28,14 @@ You can safely remove `config.assets.image_optim = false` if you are not going t
21
28
  EOF
22
29
 
23
30
  s.add_dependency 'fspath', '~> 3.0'
24
- s.add_dependency 'image_size', '~> 1.5'
31
+ s.add_dependency 'image_size', '>= 1.5', '< 3'
25
32
  s.add_dependency 'exifr', '~> 1.2', '>= 1.2.2'
26
33
  s.add_dependency 'progress', '~> 3.0', '>= 3.0.1'
27
34
  s.add_dependency 'in_threads', '~> 1.3'
28
35
 
29
36
  s.add_development_dependency 'image_optim_pack', '~> 0.2', '>= 0.2.2'
30
37
  s.add_development_dependency 'rspec', '~> 3.0'
31
- if RUBY_VERSION >= '2.1'
32
- s.add_development_dependency 'rubocop', '~> 0.52'
38
+ if RUBY_VERSION >= '2.2'
39
+ s.add_development_dependency 'rubocop', '~> 0.58'
33
40
  end
34
41
  end
@@ -83,6 +83,8 @@ class ImageOptim
83
83
 
84
84
  @bin_resolver = BinResolver.new(self)
85
85
 
86
+ $stderr << "PATH: #{@bin_resolver.env_path}\n" if verbose
87
+
86
88
  @workers_by_format = Worker.create_all_by_format(self) do |klass|
87
89
  config.for_worker(klass)
88
90
  end
@@ -15,8 +15,8 @@ class ImageOptim
15
15
  end
16
16
 
17
17
  # Returns a new hash with recursive merge of all keys
18
- def deep_merge(a, b)
19
- a.merge(b) do |_key, value_a, value_b|
18
+ def deep_merge(hash_a, hash_b)
19
+ hash_a.merge(hash_b) do |_key, value_a, value_b|
20
20
  if value_a.is_a?(Hash) && value_b.is_a?(Hash)
21
21
  deep_merge(value_a, value_b)
22
22
  else
@@ -9,8 +9,8 @@ class ImageOptim
9
9
  end
10
10
 
11
11
  # Convert everything truthy to `true`, leave `false` and `nil` as is
12
- def self.convert(v)
13
- v && true
12
+ def self.convert(value)
13
+ value && true
14
14
  end
15
15
  end
16
16
  end
@@ -21,7 +21,7 @@ class ImageOptim
21
21
 
22
22
  # Underscored class name symbol
23
23
  def bin_sym
24
- @underscored_name ||=
24
+ @bin_sym ||=
25
25
  name.
26
26
  split('::').last. # get last part
27
27
  gsub(/([a-z])([A-Z])/, '\1_\2').downcase. # convert AbcDef to abc_def
@@ -32,6 +32,10 @@ class ImageOptim
32
32
  #{dst}
33
33
  ]
34
34
  execute(:pngout, *args) && optimized?(src, dst)
35
+ rescue SignalException => e
36
+ raise unless Signal.list.key(e.signo) == 'SEGV'
37
+ raise unless resolve_bin!(:pngout).version <= '20150920'
38
+ warn "pngout caused Segmentation fault for #{src}"
35
39
  end
36
40
  end
37
41
  end
@@ -167,7 +167,7 @@ class Analyser
167
167
  end
168
168
 
169
169
  def source_digest
170
- @digest ||= begin
170
+ @source_digest ||= begin
171
171
  source_path = __getobj__.method(:optimize).source_location[0]
172
172
  Digest::SHA256.file(source_path).hexdigest
173
173
  end
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.26.1
4
+ version: 0.26.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: 2017-12-14 00:00:00.000000000 Z
11
+ date: 2018-08-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fspath
@@ -28,16 +28,22 @@ dependencies:
28
28
  name: image_size
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '1.5'
34
+ - - "<"
35
+ - !ruby/object:Gem::Version
36
+ version: '3'
34
37
  type: :runtime
35
38
  prerelease: false
36
39
  version_requirements: !ruby/object:Gem::Requirement
37
40
  requirements:
38
- - - "~>"
41
+ - - ">="
39
42
  - !ruby/object:Gem::Version
40
43
  version: '1.5'
44
+ - - "<"
45
+ - !ruby/object:Gem::Version
46
+ version: '3'
41
47
  - !ruby/object:Gem::Dependency
42
48
  name: exifr
43
49
  requirement: !ruby/object:Gem::Requirement
@@ -132,14 +138,14 @@ dependencies:
132
138
  requirements:
133
139
  - - "~>"
134
140
  - !ruby/object:Gem::Version
135
- version: '0.52'
141
+ version: '0.58'
136
142
  type: :development
137
143
  prerelease: false
138
144
  version_requirements: !ruby/object:Gem::Requirement
139
145
  requirements:
140
146
  - - "~>"
141
147
  - !ruby/object:Gem::Version
142
- version: '0.52'
148
+ version: '0.58'
143
149
  description:
144
150
  email:
145
151
  executables:
@@ -254,7 +260,11 @@ files:
254
260
  homepage: http://github.com/toy/image_optim
255
261
  licenses:
256
262
  - MIT
257
- metadata: {}
263
+ metadata:
264
+ bug_tracker_uri: https://github.com/toy/image_optim/issues
265
+ changelog_uri: https://github.com/toy/image_optim/CHANGELOG.markdown
266
+ documentation_uri: https://www.rubydoc.info/gems/image_optim/0.26.2
267
+ source_code_uri: https://github.com/toy/image_optim
258
268
  post_install_message: |
259
269
  Rails image assets optimization is extracted into image_optim_rails gem
260
270
  You can safely remove `config.assets.image_optim = false` if you are not going to use that gem
@@ -273,12 +283,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
273
283
  version: '0'
274
284
  requirements: []
275
285
  rubyforge_project: image_optim
276
- rubygems_version: 2.6.14
286
+ rubygems_version: 2.7.7
277
287
  signing_key:
278
288
  specification_version: 4
279
- summary: Optimize (lossless compress, optionally lossy) images (jpeg, png, gif, svg)
280
- using external utilities (advpng, gifsicle, jhead, jpeg-recompress, jpegoptim, jpegrescan,
281
- jpegtran, optipng, pngcrush, pngout, pngquant, svgo)
289
+ summary: Command line tool and ruby interface to optimize (lossless compress, optionally
290
+ lossy) jpeg, png, gif and svg images using external utilities (advpng, gifsicle,
291
+ jhead, jpeg-recompress, jpegoptim, jpegrescan, jpegtran, optipng, pngcrush, pngout,
292
+ pngquant, svgo)
282
293
  test_files:
283
294
  - spec/image_optim/bin_resolver/comparable_condition_spec.rb
284
295
  - spec/image_optim/bin_resolver/simple_version_spec.rb