image_optim 0.13.1 → 0.13.2

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
- ZGYwMjk1NTg3NjgwZWExMmQzN2YzYzg0YWYwNGM2MWVkOGZhZDMwYw==
4
+ ZjJiNmYyYjgxZjljNThmZGM0YzI1NzI0OTNmMzAwYmQ2MWNlY2UyOQ==
5
5
  data.tar.gz: !binary |-
6
- NTNjNjBmYTQ4YjhiNzExYmE4NzJmYjQwYWQwY2JiZjczZTJlNjhiYw==
6
+ NmQxNWY2ZTE3MTJkYTBhNDI2MGE4OGRkZjQ1ZjgxMTc4YjUyY2NkNg==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YWNjOGFiOTkwNjE4NmM4ZTViN2QxZjMzOTA4ZjAwMDIxYTAxMzI1YjZhN2My
10
- YzE0OGVlN2M4NzBmYmVlMGFlYjJlNDk5ZjM3ZmQzYzZjZTg4YTI4NGRkNDI5
11
- N2ZlYzUyZDI3NDBhMDQwYTkwZDYyZmRmYzZhZWVjMThlZjNkYTE=
9
+ MDkyYzYyMmRjOTlhMGVhMDNlMmM5MWRjYzU0N2I1NGZmYzg5YzMxYmM1NmY1
10
+ NWFlZWQxMDI0ODU4MTVjNTY4NTEyYTlkMjRhZWFkODJjYWI1MmRlZDFjMDg2
11
+ ZGE0NGMzNWVkYzY0MGZjMDZhOGIyYzU0YzBmNTk3OTNjNTNhNGM=
12
12
  data.tar.gz: !binary |-
13
- ODYxMmFmNzg0N2Q1N2FiMzg0OGZiYjFlNDNhNWNlYWM0NmNkODRmZTQ0OGNl
14
- OTNlNGRjNThjNDQxOGU2ZTFkMzkyNGU1ZDg5NjE0OGU2Nzk3OWUxMzYxMGI0
15
- YmI5YTFiMjliODc2MjVhNWZmNjA3NWQ1NWQzNzY0OGE3ZWQ1ZTc=
13
+ MjU1YWU3ZDY3OWJmYTQ5NzMzODdiM2M2NzAwNjA5ZjgwNzE3ZmM2ZTNjZWNk
14
+ OGEyMzQ2YzFhNTRmNmE0YjE0NzUzZTUxODE1YWQ0MTc1MzcyZDA3ZjVlNjVi
15
+ ZTg1MGU3Mjk5NjdjMjI0MGM5ZTIwMjExNzMzZjY4OTdhY2RhNWE=
data/README.markdown CHANGED
@@ -89,9 +89,9 @@ You will also need to install `jpegoptim` and `pngcrush` from source:
89
89
 
90
90
  ```bash
91
91
  cd /tmp
92
- curl -O http://www.kokkonen.net/tjko/src/jpegoptim-1.3.0.tar.gz
93
- tar zxf jpegoptim-1.3.0.tar.gz
94
- cd jpegoptim-1.3.0
92
+ curl -O http://www.kokkonen.net/tjko/src/jpegoptim-1.3.1.tar.gz
93
+ tar zxf jpegoptim-1.3.1.tar.gz
94
+ cd jpegoptim-1.3.1
95
95
  ./configure && make && make install
96
96
  ```
97
97
 
@@ -99,9 +99,9 @@ cd jpegoptim-1.3.0
99
99
 
100
100
  ```bash
101
101
  cd /tmp
102
- curl -O http://iweb.dl.sourceforge.net/project/pmt/pngcrush/1.7.70/pngcrush-1.7.70.tar.gz
103
- tar zxf pngcrush-1.7.70.tar.gz
104
- cd pngcrush-1.7.70
102
+ curl -O http://iweb.dl.sourceforge.net/project/pmt/pngcrush/1.7.70/pngcrush-1.7.73.tar.gz
103
+ tar zxf pngcrush-1.7.73.tar.gz
104
+ cd pngcrush-1.7.73
105
105
  make && cp -f pngcrush /usr/local/bin
106
106
  ```
107
107
 
@@ -143,7 +143,7 @@ image_optim -h
143
143
 
144
144
  ### From ruby
145
145
 
146
- Initilize optimizer (or you can call optimization methods directly on `ImageOptim`):
146
+ Initialize optimizer (or you can call optimization methods directly on `ImageOptim`):
147
147
 
148
148
  ```ruby
149
149
  image_optim = ImageOptim.new
data/image_optim.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'image_optim'
5
- s.version = '0.13.1'
5
+ s.version = '0.13.2'
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']
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+
4
+ $:.unshift File.expand_path('../../lib', __FILE__)
5
+
6
+ require 'net/http'
7
+ require 'uri'
8
+ require 'image_optim/bin_resolver/simple_version'
9
+
10
+ README_FILE = File.expand_path('../../README.markdown', __FILE__)
11
+
12
+ def fetch_url(url)
13
+ res = Net::HTTP.get_response(URI(url))
14
+ raise "Got #{res.class}" unless res.is_a?(Net::HTTPSuccess)
15
+ res.body
16
+ end
17
+
18
+ def v(s)
19
+ ImageOptim::BinResolver::SimpleVersion.new(s)
20
+ end
21
+
22
+ def update_instructions(text)
23
+ latest_versions = Hash.new do |h, project|
24
+ data = fetch_url("http://freecode.com/projects/#{project}/releases.atom")
25
+ versions = data.scan(%r{<title>[a-z]+ (\d+(?:\.\d+)+)</title>}).map{ |m| v(m[0]) }
26
+ h[project] = versions.max
27
+ end
28
+
29
+ updated = text.gsub(/([a-z]+)-(\d+(?:\.\d+)+)/) do |m|
30
+ project, current = $1, v($2)
31
+ latest = latest_versions[project]
32
+ "#{project}-#{[current, latest].max}"
33
+ end
34
+ updated unless text == updated
35
+ end
36
+
37
+ readme = File.read(README_FILE)
38
+ if readme = update_instructions(readme)
39
+ File.open(README_FILE, 'w') do |f|
40
+ f.write readme
41
+ end
42
+ else
43
+ abort "Did not update instructions"
44
+ 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.13.1
4
+ version: 0.13.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: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fspath
@@ -133,6 +133,7 @@ files:
133
133
  - lib/image_optim/worker/pngcrush.rb
134
134
  - lib/image_optim/worker/pngout.rb
135
135
  - lib/image_optim/worker/svgo.rb
136
+ - script/update_instructions_in_readme
136
137
  - script/update_worker_options_in_readme
137
138
  - spec/image_optim/bin_resolver/comparable_condition_spec.rb
138
139
  - spec/image_optim/bin_resolver/simple_version_spec.rb