image_optim 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NWIyNWIzNTYyNmNhOGViOTE3NWU0NmFiMGYyYjk3NTM3ZDNkYzJhMA==
4
+ MzgwMDNmYjBmYjlhNDU2ZDgwY2IwYWEwZjRhN2QxZDg3OTM0NjEzNw==
5
5
  data.tar.gz: !binary |-
6
- Mjg0NmZlYTAzYmQyYTQyMDBhNjA0ZTg0MjVlYWIwNTE1MTJiYmE5MQ==
6
+ ZWY0YTRjOWExMGYzZWQ5NmE0OWQ3NDg3NDUwOWI3ZDliNTQ5NGNmMg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- Y2QzMDBmZTAwNjY4OGIyNGMwZGNkMmQyZTMyODM3ZTc0NzY3YTE5Y2I4Mzcx
10
- MmZhZDBjYzc4ZGU4MDE5MTI2YzNiOTgyNTU1NGE0Mzg3NDUzOWNkNGFlM2Jj
11
- OTY4MGM5NGIxYWRiYjQxNmNiOWI0ZDllY2E3YjUwZjMyNGZmZGM=
9
+ ODg4MGE0OWM2YjdhZjM1YzQ4MjczMWYwODdjYTMyYTcyOTRmOWVlOTExZDJl
10
+ MTZkM2U2N2UzM2JmOWNiOGQwNGIxZjI3NzJmNTk5NzM3MjllMmM3MGJmZGJk
11
+ YTRkMjg3OGYzNmI1OGQxMTg0N2E2Nzk0YTEwZjI1OWExMjgzM2U=
12
12
  data.tar.gz: !binary |-
13
- NmRjNmMwMDllZDk1ZjFkN2I5NTk1Nzc4ODhlZjFiMWZjMjBiNmQzOTBmZDYy
14
- MmEzZTFmNWViYTg2NDAzOTM4ZjU0NTViZTJmYWU5MjI4MDcwYjc3ZDY2ZmE5
15
- YzM5MGE3ZDVmMzA5OTg0NzI4Y2FjNmU0OWZkM2FjNTIxOWNjNDc=
13
+ NjY5NWM1Yjk5NDExMDAzOTkyZDc2NmVkNDQxMGFiNzczMDBmOWMyZDhiNmIy
14
+ NGNiNTcxZGM0MmI2M2ZkMWFhM2ZhM2M5Nzc1OGM1NjRlNjVmNzg1NmZhZDVm
15
+ OWVhZTAyYTMwYmUyNmI1MTRjYzBhNTc2NTE3ZDY1Zjc4NWYwZDg=
@@ -25,6 +25,23 @@ Based on [ImageOptim.app](http://imageoptim.com/).
25
25
  gem install image_optim
26
26
  ```
27
27
 
28
+ ### Bundler
29
+
30
+ Add to your `Gemfile`:
31
+ ```ruby
32
+ gem 'image_optim'
33
+ ```
34
+
35
+ With version:
36
+ ```ruby
37
+ gem 'image_optim', '~> 0.11'
38
+ ```
39
+
40
+ If you want to check latest changes:
41
+ ```ruby
42
+ gem 'image_optim', :git => 'git://github.com/toy/image_optim.git'
43
+ ```
44
+
28
45
  ## Binaries location
29
46
 
30
47
  Simplest way for `image_optim` to locate binaries is to install them in common location present in `PATH` (see [Binaries installation](#binaries-installation)).
@@ -125,7 +142,7 @@ image_optim -h
125
142
 
126
143
  ### From ruby
127
144
 
128
- Initilize optimizer:
145
+ Initilize optimizer (or you can call optimization methods directly on `ImageOptim`):
129
146
 
130
147
  ```ruby
131
148
  image_optim = ImageOptim.new
@@ -169,11 +186,9 @@ image_optim.optimize_images_data(datas)
169
186
 
170
187
  ### From rails
171
188
 
172
- `ImageOptim::Railtie` will automatically initialize processing of assets if `config.assets.compress` is true.
173
-
174
- As image optimization can be time consuming you may prefer to optimize original asset files.
189
+ `ImageOptim::Railtie` will automatically register sprockets preprocessor unless you set `config.assets.image_optim = false` or `config.assets.compress = false` (later for partial rails 3 compatibility).
175
190
 
176
- Automatic assets processing can be turned off by setting `config.assets.image_optim = false`.
191
+ Image optimization can be time consuming, so depending on your deployment process you may prefer to optimize original asset files.
177
192
 
178
193
  ## Configuration
179
194
 
@@ -3,7 +3,6 @@
3
3
 
4
4
  require 'image_optim/runner'
5
5
 
6
- args = ARGV.dup
7
6
  options = {}
8
7
 
9
8
  option_parser = OptionParser.new do |op|
@@ -97,6 +96,12 @@ option_parser = OptionParser.new do |op|
97
96
  end
98
97
 
99
98
  begin
99
+ args = ARGV.dup
100
+
101
+ if args == %w[-v]
102
+ args = %w[--version]
103
+ end
104
+
100
105
  option_parser.parse!(args)
101
106
  ImageOptim::Runner.run!(args, options) or exit 1
102
107
  rescue OptionParser::ParseError => e
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim'
5
- s.version = '0.11.0'
5
+ s.version = '0.11.1'
6
6
  s.summary = %q{Optimize (lossless compress) images (jpeg, png, gif, svg) using external utilities (advpng, gifsicle, jpegoptim, jpegtran, optipng, pngcrush, pngout, svgo)}
7
7
  s.homepage = "http://github.com/toy/#{s.name}"
8
8
  s.authors = ['Ivan Kuchin']
@@ -3,7 +3,7 @@ require 'image_optim'
3
3
  class ImageOptim
4
4
  class Railtie < Rails::Railtie
5
5
  initializer 'image_optim.initializer' do |app|
6
- if app.config.assets.compress && app.config.assets.image_optim != false
6
+ if app.config.assets.compress != false && app.config.assets.image_optim != false
7
7
  image_optim = if app.config.assets.image_optim == true
8
8
  ImageOptim.new
9
9
  else
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.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Kuchin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-16 00:00:00.000000000 Z
11
+ date: 2014-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fspath