image_optim_rails 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/.rubocop.yml +13 -9
- data/.travis.yml +23 -22
- data/Appraisals +35 -0
- data/CHANGELOG.markdown +4 -0
- data/Gemfile +3 -8
- data/LICENSE.txt +1 -1
- data/README.markdown +3 -3
- data/image_optim_rails.gemspec +10 -3
- data/lib/image_optim/railtie.rb +2 -0
- data/lib/image_optim_rails.rb +2 -0
- data/spec/image_optim/railtie_spec.rb +10 -2
- data/spec/spec_helper.rb +3 -0
- metadata +11 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 53afd5ad50a758965ed64c23340131612afedccfb46b7c8073a750f4105b540f
|
4
|
+
data.tar.gz: d3fb459d37b9c60d5668129a2dd75ec04a017a619236f176bd96c84682666478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b277e5276946759b5d3b83ec5ca878a3931633a80529abfd1d04b590e01c0a3b80d2e9b8459e41dc2914d96f2b624d350bc6b7d100605a42dd9658d899e8b0c7
|
7
|
+
data.tar.gz: c1f3b95f442a8091d2bb496b7033536af73a3308cf13a1a605c73299ee946301ffe10ce5dd47af43f7453c223245536d1f9f608c06475cd1b41a4b1acb8f9744
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
@@ -2,6 +2,7 @@ AllCops:
|
|
2
2
|
Exclude:
|
3
3
|
- '*.gemspec'
|
4
4
|
- 'vendor/**/*'
|
5
|
+
- 'gemfiles/*.gemfile'
|
5
6
|
|
6
7
|
Layout/AccessModifierIndentation:
|
7
8
|
EnforcedStyle: outdent
|
@@ -12,13 +13,16 @@ Layout/CaseIndentation:
|
|
12
13
|
Layout/DotPosition:
|
13
14
|
EnforcedStyle: trailing
|
14
15
|
|
15
|
-
Layout/
|
16
|
+
Layout/EndAlignment:
|
17
|
+
EnforcedStyleAlignWith: variable
|
18
|
+
|
19
|
+
Layout/IndentFirstArrayElement:
|
16
20
|
EnforcedStyle: consistent
|
17
21
|
|
18
22
|
Layout/IndentAssignment:
|
19
23
|
Enabled: false
|
20
24
|
|
21
|
-
Layout/
|
25
|
+
Layout/IndentFirstHashElement:
|
22
26
|
EnforcedStyle: consistent
|
23
27
|
|
24
28
|
Layout/SpaceBeforeBlockBraces:
|
@@ -27,9 +31,6 @@ Layout/SpaceBeforeBlockBraces:
|
|
27
31
|
Layout/SpaceInsideHashLiteralBraces:
|
28
32
|
EnforcedStyle: no_space
|
29
33
|
|
30
|
-
Lint/EndAlignment:
|
31
|
-
EnforcedStyleAlignWith: variable
|
32
|
-
|
33
34
|
Metrics/AbcSize:
|
34
35
|
Max: 30
|
35
36
|
|
@@ -52,14 +53,14 @@ Style/DoubleNegation:
|
|
52
53
|
Style/EmptyCaseCondition:
|
53
54
|
Enabled: false
|
54
55
|
|
55
|
-
Style/
|
56
|
-
|
56
|
+
Style/ExpandPathArguments:
|
57
|
+
Enabled: false
|
57
58
|
|
58
59
|
Style/HashSyntax:
|
59
60
|
EnforcedStyle: hash_rockets
|
60
61
|
|
61
62
|
Style/IfUnlessModifier:
|
62
|
-
|
63
|
+
Enabled: false
|
63
64
|
|
64
65
|
Style/ParallelAssignment:
|
65
66
|
Enabled: false
|
@@ -73,5 +74,8 @@ Style/SignalException:
|
|
73
74
|
Style/TrailingCommaInArguments:
|
74
75
|
EnforcedStyleForMultiline: no_comma
|
75
76
|
|
76
|
-
Style/
|
77
|
+
Style/TrailingCommaInArrayLiteral:
|
78
|
+
EnforcedStyleForMultiline: comma
|
79
|
+
|
80
|
+
Style/TrailingCommaInHashLiteral:
|
77
81
|
EnforcedStyleForMultiline: comma
|
data/.travis.yml
CHANGED
@@ -5,34 +5,35 @@ cache:
|
|
5
5
|
directories:
|
6
6
|
- $(npm root)
|
7
7
|
- ~/bin
|
8
|
+
rvm:
|
9
|
+
- '1.9.3-p551'
|
10
|
+
- '2.0.0-p648'
|
11
|
+
- '2.1.10'
|
12
|
+
- '2.2.10'
|
13
|
+
- '2.3.8'
|
14
|
+
- '2.4.6'
|
15
|
+
- '2.5.5'
|
16
|
+
- '2.6.3'
|
8
17
|
script:
|
9
|
-
- bundle exec image_optim --info
|
10
|
-
- bundle exec rspec
|
18
|
+
- ./bundle exec image_optim --info
|
19
|
+
- ./bundle exec appraisal rspec
|
11
20
|
before_install:
|
21
|
+
- gem install rubygems-update || gem install rubygems-update --version '< 3'
|
22
|
+
- gem update --system
|
23
|
+
- gem install bundler --version '< 2'
|
24
|
+
- ruby -e 'puts "#!/bin/sh", %{bundle _#{Gem::Dependency.new("bundler", "< 2.0").to_spec.version}_ "$@"}' > bundle
|
25
|
+
- chmod +x bundle
|
12
26
|
- mkdir -p ~/bin
|
13
|
-
- command -v svgo || npm install svgo
|
14
|
-
- command -v pngout || curl -L "http://static.jonof.id.au/dl/kenutils/pngout-
|
27
|
+
- command -v svgo || npm install -g svgo
|
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'
|
29
|
+
install:
|
30
|
+
- ./bundle install --jobs=3 --retry=3
|
31
|
+
- ./bundle exec appraisal install --jobs=3 --retry=3
|
15
32
|
matrix:
|
16
33
|
include:
|
17
|
-
- env: RAILS_VERSION='~> 3.2'
|
18
|
-
rvm: '1.9.3-p551'
|
19
|
-
- env: RAILS_VERSION='~> 4.0' SPROCKETS_RAILS_VERSION='~> 2.0'
|
20
|
-
rvm: '2.0.0-p648'
|
21
|
-
- env: RAILS_VERSION='~> 4.0' SPROCKETS_VERSION='~> 3.0'
|
22
|
-
rvm: '2.0.0-p648'
|
23
|
-
- env: RAILS_VERSION='~> 4.0' SPROCKETS_VERSION='>= 4.0.beta'
|
24
|
-
rvm: '2.0.0-p648'
|
25
|
-
- env: RAILS_VERSION='~> 5.0' SPROCKETS_RAILS_VERSION='~> 2.0'
|
26
|
-
rvm: '2.2.7'
|
27
|
-
- env: RAILS_VERSION='~> 5.0' SPROCKETS_VERSION='~> 3.0'
|
28
|
-
rvm: '2.2.7'
|
29
|
-
- env: RAILS_VERSION='~> 5.0' SPROCKETS_VERSION='>= 4.0.beta'
|
30
|
-
rvm: '2.2.7'
|
31
34
|
- env: RUBOCOP=✓
|
32
|
-
rvm: '2.
|
35
|
+
rvm: '2.6.3'
|
33
36
|
script: bundle exec rubocop
|
34
|
-
before_install:
|
35
37
|
- env: CHECK_RUBIES=✓
|
36
|
-
rvm: '2.
|
38
|
+
rvm: '2.6.3'
|
37
39
|
script: bundle exec travis_check_rubies
|
38
|
-
before_install:
|
data/Appraisals
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
def appgen(gems)
|
4
|
+
description = gems.map{ |name, version| "#{name} #{version}" }.join(', ')
|
5
|
+
appraise description do
|
6
|
+
gems.each do |name, version|
|
7
|
+
gem name, version
|
8
|
+
end
|
9
|
+
|
10
|
+
if RUBY_VERSION < '2.0'
|
11
|
+
gem 'concurrent-ruby', '!= 1.1.1'
|
12
|
+
gem 'rack-cache', '< 1.7.2'
|
13
|
+
gem 'rake', '< 12.3'
|
14
|
+
end
|
15
|
+
|
16
|
+
if RUBY_VERSION < '2.1'
|
17
|
+
gem 'nokogiri', '< 1.7'
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
if RUBY_VERSION < '2.3'
|
23
|
+
appgen 'rails' => '~> 3.2'
|
24
|
+
end
|
25
|
+
|
26
|
+
if RUBY_VERSION >= '2.1'
|
27
|
+
appgen 'rails' => '~> 4.0', 'sprockets-rails' => '~> 2.0'
|
28
|
+
appgen 'rails' => '~> 4.0', 'sprockets' => '~> 3.0'
|
29
|
+
end
|
30
|
+
|
31
|
+
if RUBY_VERSION >= '2.2'
|
32
|
+
appgen 'rails' => '~> 5.0', 'sprockets-rails' => '~> 2.0'
|
33
|
+
appgen 'rails' => '~> 5.0', 'sprockets' => '~> 3.0'
|
34
|
+
appgen 'rails' => '~> 5.0', 'sprockets' => '>= 4.0.beta'
|
35
|
+
end
|
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## unreleased
|
4
4
|
|
5
|
+
## v0.4.2 (2019-05-25)
|
6
|
+
|
7
|
+
* Enable frozen string literals [@toy](https://github.com/toy)
|
8
|
+
|
5
9
|
## v0.4.1 (2017-07-09)
|
6
10
|
|
7
11
|
* Relax `image_optim` dependency [#5](https://github.com/toy/image_optim_rails/issues/5) [@toy](https://github.com/toy)
|
data/Gemfile
CHANGED
@@ -1,15 +1,10 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
source 'https://rubygems.org'
|
2
4
|
|
3
5
|
gemspec
|
4
6
|
|
5
|
-
|
6
|
-
rails
|
7
|
-
sprockets
|
8
|
-
sprockets-rails
|
9
|
-
].each do |gem_name|
|
10
|
-
version = ENV[gem_name.tr('-', '_').upcase + '_VERSION']
|
11
|
-
gem gem_name, version if version
|
12
|
-
end
|
7
|
+
gem 'appraisal'
|
13
8
|
|
14
9
|
if RUBY_VERSION >= '2.0'
|
15
10
|
gem 'travis_check_rubies', '~> 0.2'
|
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
[![Gem Version](https://img.shields.io/gem/v/image_optim_rails.svg?style=flat)](https://rubygems.org/gems/image_optim_rails)
|
2
2
|
[![Build Status](https://img.shields.io/travis/toy/image_optim_rails/master.svg?style=flat)](https://travis-ci.org/toy/image_optim_rails)
|
3
|
-
[![Code Climate](https://img.shields.io/codeclimate/
|
4
|
-
[![
|
3
|
+
[![Code Climate](https://img.shields.io/codeclimate/maintainability/toy/image_optim_rails.svg?style=flat)](https://codeclimate.com/github/toy/image_optim_rails)
|
4
|
+
[![Depfu](https://badges.depfu.com/badges/713ede61b82ee98a3e86a374b5278d28/overview.svg)](https://depfu.com/github/toy/image_optim_rails)
|
5
5
|
[![Inch CI](https://inch-ci.org/github/toy/image_optim_rails.svg?branch=master&style=flat)](https://inch-ci.org/github/toy/image_optim_rails)
|
6
6
|
|
7
7
|
# image\_optim\_rails
|
@@ -49,4 +49,4 @@ In separate file [CHANGELOG.markdown](CHANGELOG.markdown).
|
|
49
49
|
|
50
50
|
## Copyright
|
51
51
|
|
52
|
-
Copyright (c) 2013-
|
52
|
+
Copyright (c) 2013-2019 Ivan Kuchin. See [LICENSE.txt](LICENSE.txt) for details.
|
data/image_optim_rails.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = 'image_optim_rails'
|
5
|
-
s.version = '0.4.
|
5
|
+
s.version = '0.4.2'
|
6
6
|
s.summary = %q{Optimize image assets using image_optim}
|
7
7
|
s.homepage = "http://github.com/toy/#{s.name}"
|
8
8
|
s.authors = ['Ivan Kuchin']
|
@@ -10,6 +10,13 @@ Gem::Specification.new do |s|
|
|
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}/blob/master/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,7 +28,7 @@ Gem::Specification.new do |s|
|
|
21
28
|
|
22
29
|
s.add_development_dependency 'image_optim_pack', '~> 0.2', '>= 0.2.2'
|
23
30
|
s.add_development_dependency 'rspec', '~> 3.0'
|
24
|
-
if RUBY_VERSION >= '2.
|
25
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
31
|
+
if RUBY_VERSION >= '2.2'
|
32
|
+
s.add_development_dependency 'rubocop', '~> 0.59'
|
26
33
|
end
|
27
34
|
end
|
data/lib/image_optim/railtie.rb
CHANGED
data/lib/image_optim_rails.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'spec_helper'
|
2
4
|
require 'rails/all'
|
3
5
|
require 'image_optim/railtie'
|
4
6
|
|
5
7
|
describe 'ImageOptim::Railtie' do
|
6
|
-
def
|
8
|
+
def rails_app
|
7
9
|
Class.new(Rails::Application) do
|
8
10
|
# Rails 4 requires application class to have name
|
9
11
|
define_singleton_method :name do
|
@@ -27,8 +29,14 @@ describe 'ImageOptim::Railtie' do
|
|
27
29
|
assets.delete(:compress)
|
28
30
|
end
|
29
31
|
|
32
|
+
config.secret_key_base = 'foo/bar'
|
33
|
+
|
30
34
|
yield config if block_given?
|
31
|
-
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def init_rails_app(&block)
|
39
|
+
rails_app(&block).initialize!
|
32
40
|
end
|
33
41
|
|
34
42
|
before do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'image_optim/pack'
|
2
4
|
require 'image_optim/path'
|
3
5
|
|
@@ -49,6 +51,7 @@ def mepp(image_a, image_b)
|
|
49
51
|
unless [0, 1].include?($CHILD_STATUS.exitstatus)
|
50
52
|
fail "compare #{image_a} with #{image_b} failed with `#{output}`"
|
51
53
|
end
|
54
|
+
|
52
55
|
num_r = '\d+(?:\.\d+(?:[eE][-+]?\d+)?)?'
|
53
56
|
output[/\((#{num_r}), #{num_r}\)/, 1].to_f
|
54
57
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image_optim_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.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:
|
11
|
+
date: 2019-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: image_optim
|
@@ -92,14 +92,14 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - "~>"
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: '0.
|
95
|
+
version: '0.59'
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - "~>"
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: '0.
|
102
|
+
version: '0.59'
|
103
103
|
description:
|
104
104
|
email:
|
105
105
|
executables: []
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- ".gitignore"
|
110
110
|
- ".rubocop.yml"
|
111
111
|
- ".travis.yml"
|
112
|
+
- Appraisals
|
112
113
|
- CHANGELOG.markdown
|
113
114
|
- Gemfile
|
114
115
|
- LICENSE.txt
|
@@ -122,7 +123,11 @@ files:
|
|
122
123
|
homepage: http://github.com/toy/image_optim_rails
|
123
124
|
licenses:
|
124
125
|
- MIT
|
125
|
-
metadata:
|
126
|
+
metadata:
|
127
|
+
bug_tracker_uri: https://github.com/toy/image_optim_rails/issues
|
128
|
+
changelog_uri: https://github.com/toy/image_optim_rails/blob/master/CHANGELOG.markdown
|
129
|
+
documentation_uri: https://www.rubydoc.info/gems/image_optim_rails/0.4.2
|
130
|
+
source_code_uri: https://github.com/toy/image_optim_rails
|
126
131
|
post_install_message:
|
127
132
|
rdoc_options: []
|
128
133
|
require_paths:
|
@@ -138,8 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
138
143
|
- !ruby/object:Gem::Version
|
139
144
|
version: '0'
|
140
145
|
requirements: []
|
141
|
-
|
142
|
-
rubygems_version: 2.6.11
|
146
|
+
rubygems_version: 3.0.3
|
143
147
|
signing_key:
|
144
148
|
specification_version: 4
|
145
149
|
summary: Optimize image assets using image_optim
|