image_optim_rails 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/.rubocop.yml +9 -2
- data/.travis.yml +28 -33
- data/CHANGELOG.markdown +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +1 -1
- data/README.markdown +1 -1
- data/image_optim_rails.gemspec +2 -2
- data/lib/image_optim/railtie.rb +5 -1
- data/spec/dummy/app/assets/config/manifest.js +0 -0
- data/spec/image_optim/railtie_spec.rb +5 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MTM1OWI4NGJjYTY3YjllZWRlZTVmNzM4ZWY0YjhiOWM5OTdmNTNkOQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjA4ZWIyM2VmMTc5MzlmYmQzMTk2MDlkODAyMjFjOGZhYmYwMmVlMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NjM5YTE5NWI4MWI4YWEwMTIwN2QzODYyZWE2MmYxNTc1MjY0MzY4ZmFlYzkw
|
10
|
+
NmQwZWI1MDFhNzVhOTQwZDAyYzUzNDg4YjMwNzQ2MTVjMmY4NDdlZDE2Yzll
|
11
|
+
ODFiNmYzNDUxOWVlODNlNzZjNzE4Y2Y5MzQ3N2IwOGNjZTdkYTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YmU0ZDYwODkwMjcyOTIzMGRhN2RlNDRjNjBkZmY5NWM3MThmOGNhNjI1ODY1
|
14
|
+
YTEzODczZmIyZjhmMTk5ZjNmZTZiMzkxYTEyZDRiNjQ0ODRmNzAxMWY3Njcy
|
15
|
+
ZGViZWQzMWM4Y2ExZWM2YjFhZGZkZTgwYjM0MGExNTlhYjI3OTI=
|
data/.rubocop.yml
CHANGED
@@ -4,11 +4,18 @@ AllCops:
|
|
4
4
|
- 'vendor/**/*'
|
5
5
|
|
6
6
|
Lint/EndAlignment:
|
7
|
-
|
7
|
+
EnforcedStyleAlignWith: variable
|
8
8
|
|
9
9
|
Metrics/AbcSize:
|
10
10
|
Max: 30
|
11
11
|
|
12
|
+
Metrics/BlockLength:
|
13
|
+
Exclude:
|
14
|
+
- 'spec/**/*.rb'
|
15
|
+
|
16
|
+
Metrics/LineLength:
|
17
|
+
Max: 120
|
18
|
+
|
12
19
|
Metrics/MethodLength:
|
13
20
|
Max: 25
|
14
21
|
|
@@ -19,7 +26,7 @@ Style/Alias:
|
|
19
26
|
EnforcedStyle: prefer_alias_method
|
20
27
|
|
21
28
|
Style/CaseIndentation:
|
22
|
-
|
29
|
+
EnforcedStyle: end
|
23
30
|
|
24
31
|
Style/DotPosition:
|
25
32
|
EnforcedStyle: trailing
|
data/.travis.yml
CHANGED
@@ -3,41 +3,36 @@ language: ruby
|
|
3
3
|
cache:
|
4
4
|
bundler: true
|
5
5
|
directories:
|
6
|
-
|
7
|
-
|
8
|
-
script:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
bundle exec rspec
|
16
|
-
fi
|
17
|
-
)
|
18
|
-
before_install: |
|
19
|
-
(
|
20
|
-
set -ex
|
21
|
-
if [ -z "$RUBOCOP" ]; then
|
22
|
-
command -v svgo || npm install svgo
|
23
|
-
command -v pngout || {
|
24
|
-
mkdir -p ~/bin
|
25
|
-
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'
|
26
|
-
}
|
27
|
-
fi
|
28
|
-
)
|
6
|
+
- $(npm root)
|
7
|
+
- ~/bin
|
8
|
+
script:
|
9
|
+
- bundle exec image_optim --info
|
10
|
+
- bundle exec rspec
|
11
|
+
before_install:
|
12
|
+
- mkdir -p ~/bin
|
13
|
+
- command -v svgo || npm install svgo
|
14
|
+
- 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'
|
29
15
|
matrix:
|
30
|
-
fast_finish: true
|
31
16
|
include:
|
32
17
|
- env: RAILS_VERSION='~> 3.2'
|
33
|
-
rvm:
|
18
|
+
rvm: '1.9.3-p551'
|
34
19
|
- env: RAILS_VERSION='~> 4.0' SPROCKETS_RAILS_VERSION='~> 2.0'
|
35
|
-
rvm: '2'
|
36
|
-
- env: RAILS_VERSION='~> 4.0'
|
37
|
-
rvm: '2'
|
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'
|
38
25
|
- env: RAILS_VERSION='~> 5.0' SPROCKETS_RAILS_VERSION='~> 2.0'
|
39
|
-
rvm: '2.2.
|
40
|
-
- env: RAILS_VERSION='~> 5.0'
|
41
|
-
rvm: '2.2.
|
42
|
-
- env:
|
43
|
-
rvm: '2.2.
|
26
|
+
rvm: '2.2.6'
|
27
|
+
- env: RAILS_VERSION='~> 5.0' SPROCKETS_VERSION='~> 3.0'
|
28
|
+
rvm: '2.2.6'
|
29
|
+
- env: RAILS_VERSION='~> 5.0' SPROCKETS_VERSION='>= 4.0.beta'
|
30
|
+
rvm: '2.2.6'
|
31
|
+
- env: RUBOCOP=✓
|
32
|
+
rvm: '2.4.0'
|
33
|
+
script: bundle exec rubocop
|
34
|
+
before_install:
|
35
|
+
- env: CHECK_RUBIES=✓
|
36
|
+
rvm: '2.4.0'
|
37
|
+
script: bundle exec travis_check_rubies
|
38
|
+
before_install:
|
data/CHANGELOG.markdown
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
## unreleased
|
4
4
|
|
5
|
+
## v0.3.0 (2017-03-13)
|
6
|
+
|
7
|
+
* Add sprockets 4 support [toy/image_optim_rails#2](https://github.com/toy/image_optim_rails/issues/2) [@toy](https://github.com/toy)
|
8
|
+
|
5
9
|
## v0.2.0 (2016-10-03)
|
6
10
|
|
7
11
|
* Use railsy config paths `config/image_optim.yml` and `config/image_optim/#{RAILS_ENV}.yml` and cache to `tmp/cache/image_optim` by default [@toy](https://github.com/toy)
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
data/README.markdown
CHANGED
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.
|
5
|
+
s.version = '0.3.0'
|
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']
|
@@ -22,6 +22,6 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.add_development_dependency 'image_optim_pack', '~> 0.2', '>= 0.2.2'
|
23
23
|
s.add_development_dependency 'rspec', '~> 3.0'
|
24
24
|
if RUBY_VERSION >= '2.0'
|
25
|
-
s.add_development_dependency 'rubocop', '~> 0.
|
25
|
+
s.add_development_dependency 'rubocop', '~> 0.47'
|
26
26
|
end
|
27
27
|
end
|
data/lib/image_optim/railtie.rb
CHANGED
@@ -68,7 +68,11 @@ class ImageOptim
|
|
68
68
|
app.assets.register_preprocessor mime_type, :image_optim, &processor
|
69
69
|
else
|
70
70
|
app.config.assets.configure do |env|
|
71
|
-
|
71
|
+
if Sprockets::Processing.instance_method(:register_config_processor).arity == -3
|
72
|
+
env.register_preprocessor mime_type, &processor
|
73
|
+
else
|
74
|
+
env.register_preprocessor mime_type, :image_optim, &processor
|
75
|
+
end
|
72
76
|
end
|
73
77
|
end
|
74
78
|
end
|
File without changes
|
@@ -31,6 +31,10 @@ describe 'ImageOptim::Railtie' do
|
|
31
31
|
end.initialize!
|
32
32
|
end
|
33
33
|
|
34
|
+
before do
|
35
|
+
allow(Rails).to receive(:root).and_return(Pathname('spec/dummy').expand_path)
|
36
|
+
end
|
37
|
+
|
34
38
|
after do
|
35
39
|
Rails.application = nil
|
36
40
|
end
|
@@ -149,7 +153,7 @@ describe 'ImageOptim::Railtie' do
|
|
149
153
|
asset = init_rails_app.assets.find_asset(asset_name)
|
150
154
|
|
151
155
|
asset_data = asset.source
|
152
|
-
original = Path.convert(asset.pathname)
|
156
|
+
original = Path.convert(asset.respond_to?(:filename) ? asset.filename : asset.pathname)
|
153
157
|
|
154
158
|
expect(asset_data).to be_smaller_than(original)
|
155
159
|
|
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
|
+
version: 0.3.0
|
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: 2017-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: image_optim
|
@@ -102,6 +102,7 @@ files:
|
|
102
102
|
- image_optim_rails.gemspec
|
103
103
|
- lib/image_optim/railtie.rb
|
104
104
|
- lib/image_optim_rails.rb
|
105
|
+
- spec/dummy/app/assets/config/manifest.js
|
105
106
|
- spec/image_optim/railtie_spec.rb
|
106
107
|
- spec/spec_helper.rb
|
107
108
|
homepage: http://github.com/toy/image_optim_rails
|
@@ -129,6 +130,7 @@ signing_key:
|
|
129
130
|
specification_version: 4
|
130
131
|
summary: Optimize image assets using image_optim
|
131
132
|
test_files:
|
133
|
+
- spec/dummy/app/assets/config/manifest.js
|
132
134
|
- spec/image_optim/railtie_spec.rb
|
133
135
|
- spec/spec_helper.rb
|
134
136
|
has_rdoc:
|