image_optim_rails 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MTM1OWI4NGJjYTY3YjllZWRlZTVmNzM4ZWY0YjhiOWM5OTdmNTNkOQ==
5
- data.tar.gz: !binary |-
6
- NjA4ZWIyM2VmMTc5MzlmYmQzMTk2MDlkODAyMjFjOGZhYmYwMmVlMw==
2
+ SHA1:
3
+ metadata.gz: 7ec6959ffaf8e94146e51857bbd6fa8d61c12d43
4
+ data.tar.gz: b151102a5974a95aecb7eb9d4238a23d3a6cf4d3
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NjM5YTE5NWI4MWI4YWEwMTIwN2QzODYyZWE2MmYxNTc1MjY0MzY4ZmFlYzkw
10
- NmQwZWI1MDFhNzVhOTQwZDAyYzUzNDg4YjMwNzQ2MTVjMmY4NDdlZDE2Yzll
11
- ODFiNmYzNDUxOWVlODNlNzZjNzE4Y2Y5MzQ3N2IwOGNjZTdkYTk=
12
- data.tar.gz: !binary |-
13
- YmU0ZDYwODkwMjcyOTIzMGRhN2RlNDRjNjBkZmY5NWM3MThmOGNhNjI1ODY1
14
- YTEzODczZmIyZjhmMTk5ZjNmZTZiMzkxYTEyZDRiNjQ0ODRmNzAxMWY3Njcy
15
- ZGViZWQzMWM4Y2ExZWM2YjFhZGZkZTgwYjM0MGExNTlhYjI3OTI=
6
+ metadata.gz: a9189dec0dc6125fa5db0345732c35b4e788c13e8ec25839eab4799920cd05e2a2ab0640c7299911435e85f8125d4897884748a3926425ba8d151903264017a3
7
+ data.tar.gz: 83bb9dc2cde4d1e8a8e5d99decc2f8a1d44673c5c41d4e9a25f11c0fcadd575793c135e1a7d718d7fa7a39ae10ca70474d4c918836f24b0ea09f9306b5871b64
@@ -3,6 +3,30 @@ AllCops:
3
3
  - '*.gemspec'
4
4
  - 'vendor/**/*'
5
5
 
6
+ Layout/AccessModifierIndentation:
7
+ EnforcedStyle: outdent
8
+
9
+ Layout/CaseIndentation:
10
+ EnforcedStyle: end
11
+
12
+ Layout/DotPosition:
13
+ EnforcedStyle: trailing
14
+
15
+ Layout/IndentArray:
16
+ EnforcedStyle: consistent
17
+
18
+ Layout/IndentAssignment:
19
+ Enabled: false
20
+
21
+ Layout/IndentHash:
22
+ EnforcedStyle: consistent
23
+
24
+ Layout/SpaceBeforeBlockBraces:
25
+ EnforcedStyle: no_space
26
+
27
+ Layout/SpaceInsideHashLiteralBraces:
28
+ EnforcedStyle: no_space
29
+
6
30
  Lint/EndAlignment:
7
31
  EnforcedStyleAlignWith: variable
8
32
 
@@ -19,18 +43,9 @@ Metrics/LineLength:
19
43
  Metrics/MethodLength:
20
44
  Max: 25
21
45
 
22
- Style/AccessModifierIndentation:
23
- EnforcedStyle: outdent
24
-
25
46
  Style/Alias:
26
47
  EnforcedStyle: prefer_alias_method
27
48
 
28
- Style/CaseIndentation:
29
- EnforcedStyle: end
30
-
31
- Style/DotPosition:
32
- EnforcedStyle: trailing
33
-
34
49
  Style/DoubleNegation:
35
50
  Enabled: false
36
51
 
@@ -46,35 +61,15 @@ Style/HashSyntax:
46
61
  Style/IfUnlessModifier:
47
62
  MaxLineLength: 40
48
63
 
49
- Style/IndentArray:
50
- EnforcedStyle: consistent
51
-
52
- Style/IndentAssignment:
53
- Enabled: false
54
-
55
- Style/IndentHash:
56
- EnforcedStyle: consistent
57
-
58
64
  Style/ParallelAssignment:
59
65
  Enabled: false
60
66
 
61
- Style/PercentLiteralDelimiters:
62
- PreferredDelimiters:
63
- '%w': '[]'
64
- '%W': '[]'
65
-
66
67
  Style/Semicolon:
67
68
  AllowAsExpressionSeparator: true
68
69
 
69
70
  Style/SignalException:
70
71
  EnforcedStyle: semantic
71
72
 
72
- Style/SpaceBeforeBlockBraces:
73
- EnforcedStyle: no_space
74
-
75
- Style/SpaceInsideHashLiteralBraces:
76
- EnforcedStyle: no_space
77
-
78
73
  Style/TrailingCommaInArguments:
79
74
  EnforcedStyleForMultiline: no_comma
80
75
 
@@ -23,16 +23,16 @@ matrix:
23
23
  - env: RAILS_VERSION='~> 4.0' SPROCKETS_VERSION='>= 4.0.beta'
24
24
  rvm: '2.0.0-p648'
25
25
  - env: RAILS_VERSION='~> 5.0' SPROCKETS_RAILS_VERSION='~> 2.0'
26
- rvm: '2.2.6'
26
+ rvm: '2.2.7'
27
27
  - env: RAILS_VERSION='~> 5.0' SPROCKETS_VERSION='~> 3.0'
28
- rvm: '2.2.6'
28
+ rvm: '2.2.7'
29
29
  - env: RAILS_VERSION='~> 5.0' SPROCKETS_VERSION='>= 4.0.beta'
30
- rvm: '2.2.6'
30
+ rvm: '2.2.7'
31
31
  - env: RUBOCOP=✓
32
- rvm: '2.4.0'
32
+ rvm: '2.4.1'
33
33
  script: bundle exec rubocop
34
34
  before_install:
35
35
  - env: CHECK_RUBIES=✓
36
- rvm: '2.4.0'
36
+ rvm: '2.4.1'
37
37
  script: bundle exec travis_check_rubies
38
38
  before_install:
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## unreleased
4
4
 
5
+ ## v0.4.0 (2017-05-31)
6
+
7
+ * Use absolute path to Rails root for default options [#3](https://github.com/toy/image_optim_rails/pull/3) [@wjordan](https://github.com/wjordan)
8
+
5
9
  ## v0.3.0 (2017-03-13)
6
10
 
7
11
  * Add sprockets 4 support [toy/image_optim_rails#2](https://github.com/toy/image_optim_rails/issues/2) [@toy](https://github.com/toy)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim_rails'
5
- s.version = '0.3.0'
5
+ s.version = '0.4.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.47'
25
+ s.add_development_dependency 'rubocop', '~> 0.49'
26
26
  end
27
27
  end
@@ -18,7 +18,7 @@ class ImageOptim
18
18
  hash[key] = ActiveSupport::OrderedOptions.new
19
19
  end
20
20
  end
21
- app.config.assets.image_optim.merge!(default_options)
21
+ app.config.assets.image_optim.merge!(default_options(app))
22
22
  end
23
23
 
24
24
  initializer 'image_optim.initializer' do |app|
@@ -42,19 +42,21 @@ class ImageOptim
42
42
 
43
43
  def options(app)
44
44
  if app.config.assets.image_optim == true
45
- default_options
45
+ default_options(app)
46
46
  else
47
- app.config.assets.image_optim || default_options
47
+ app.config.assets.image_optim || default_options(app)
48
48
  end
49
49
  end
50
50
 
51
- def default_options
51
+ def default_options(app)
52
+ config_path = app.config.paths['config'].first
53
+ tmp_path = app.config.paths['tmp'].first
52
54
  {
53
55
  :config_paths => [
54
- 'config/image_optim.yml',
55
- "config/image_optim/#{Rails.env}.yml",
56
+ "#{config_path}/image_optim.yml",
57
+ "#{config_path}/image_optim/#{Rails.env}.yml",
56
58
  ],
57
- :cache_dir => 'tmp/cache/image_optim',
59
+ :cache_dir => "#{tmp_path}/cache/image_optim",
58
60
  }
59
61
  end
60
62
 
@@ -68,12 +68,13 @@ describe 'ImageOptim::Railtie' do
68
68
 
69
69
  describe 'options' do
70
70
  let(:default_options) do
71
+ root = File.expand_path('../../..', __FILE__)
71
72
  {
72
73
  :config_paths => [
73
- 'config/image_optim.yml',
74
- 'config/image_optim/xxx.yml',
74
+ "#{root}/config/image_optim.yml",
75
+ "#{root}/config/image_optim/xxx.yml",
75
76
  ],
76
- :cache_dir => 'tmp/cache/image_optim',
77
+ :cache_dir => "#{root}/tmp/cache/image_optim",
77
78
  }
78
79
  end
79
80
 
metadata CHANGED
@@ -1,100 +1,114 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: image_optim_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.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: 2017-03-13 00:00:00.000000000 Z
11
+ date: 2017-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: image_optim
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.24.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.24.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rails
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sprockets
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: image_optim_pack
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.2'
62
- - - ! '>='
62
+ - - ">="
63
63
  - !ruby/object:Gem::Version
64
64
  version: 0.2.2
65
65
  type: :development
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
- - - ~>
69
+ - - "~>"
70
70
  - !ruby/object:Gem::Version
71
71
  version: '0.2'
72
- - - ! '>='
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
74
  version: 0.2.2
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rspec
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '3.0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '3.0'
89
+ - !ruby/object:Gem::Dependency
90
+ name: rubocop
91
+ requirement: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.49'
96
+ type: :development
97
+ prerelease: false
98
+ version_requirements: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - "~>"
101
+ - !ruby/object:Gem::Version
102
+ version: '0.49'
89
103
  description:
90
104
  email:
91
105
  executables: []
92
106
  extensions: []
93
107
  extra_rdoc_files: []
94
108
  files:
95
- - .gitignore
96
- - .rubocop.yml
97
- - .travis.yml
109
+ - ".gitignore"
110
+ - ".rubocop.yml"
111
+ - ".travis.yml"
98
112
  - CHANGELOG.markdown
99
113
  - Gemfile
100
114
  - LICENSE.txt
@@ -115,17 +129,17 @@ require_paths:
115
129
  - lib
116
130
  required_ruby_version: !ruby/object:Gem::Requirement
117
131
  requirements:
118
- - - ! '>='
132
+ - - ">="
119
133
  - !ruby/object:Gem::Version
120
134
  version: '0'
121
135
  required_rubygems_version: !ruby/object:Gem::Requirement
122
136
  requirements:
123
- - - ! '>='
137
+ - - ">="
124
138
  - !ruby/object:Gem::Version
125
139
  version: '0'
126
140
  requirements: []
127
141
  rubyforge_project: image_optim_rails
128
- rubygems_version: 2.6.4
142
+ rubygems_version: 2.6.11
129
143
  signing_key:
130
144
  specification_version: 4
131
145
  summary: Optimize image assets using image_optim
@@ -133,4 +147,3 @@ test_files:
133
147
  - spec/dummy/app/assets/config/manifest.js
134
148
  - spec/image_optim/railtie_spec.rb
135
149
  - spec/spec_helper.rb
136
- has_rdoc: