image-optimizer 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,17 +1,17 @@
1
1
  source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
- gem "yaop", ">= 0.1.0"
5
- gem "jpegtran", ">= 0.1.0"
4
+ gem "yaop"
5
+ gem "jpegtran"
6
6
  gem "optipng", ">= 0.2.0"
7
7
  gem "jpegoptim", ">= 0.2.0"
8
- gem "mini_magick", ">= 3.2.1"
9
- gem "unix-whereis", ">= 0.1.0"
10
- gem "options-hash", ">= 0.1.0"
8
+ gem "unix-whereis"
9
+ gem "options-hash"
10
+ gem "command-builder"
11
11
 
12
12
  # Add dependencies to develop your gem here.
13
13
  # Include everything needed to run rake, tests, features, etc.
14
14
  group :development do
15
- gem "bundler", "~> 1.0.14"
16
- gem "jeweler", "~> 1.6.0"
15
+ gem "bundler", ">= 1.0.14"
16
+ gem "jeweler2", ">= 2.0.0"
17
17
  end
data/Gemfile.lock CHANGED
@@ -2,46 +2,37 @@ GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
4
  abstract (1.0.0)
5
- command-builder (0.1.0)
6
- hash-utils (>= 0.7.0)
5
+ command-builder (0.2.2)
6
+ hash-utils (>= 0.18.0)
7
+ pipe-run (>= 0.2.1)
7
8
  git (1.2.5)
8
- hash-utils (0.15.0)
9
- hashie (1.0.0)
10
- jeweler (1.6.2)
11
- bundler (~> 1.0)
9
+ hash-utils (1.1.0)
10
+ ruby-version
11
+ hashie (1.2.0)
12
+ jeweler2 (2.0.9)
12
13
  git (>= 1.2.5)
13
- rake
14
- jpegoptim (0.2.0)
15
- command-builder (>= 0.1.0)
16
- pipe-run (>= 0.2.0)
14
+ jpegoptim (0.2.1)
15
+ command-builder (>= 0.2.0)
17
16
  unix-whereis (>= 0.1.0)
18
- jpegtran (0.1.1)
19
- command-builder (>= 0.1.0)
20
- hash-utils (>= 0.15.0)
21
- lookup-hash (>= 0.2.0)
22
- pipe-run (>= 0.2.1)
17
+ jpegtran (0.1.3)
18
+ command-builder (>= 0.2.0)
19
+ hash-utils (>= 0.18.0)
23
20
  unix-whereis (>= 0.1.0)
24
- lookup-hash (0.2.0)
25
- hash-utils (>= 0.11.0)
26
- mini_magick (3.2.1)
27
- subexec (~> 0.0.4)
28
- multitype-introspection (0.1.2)
21
+ multitype-introspection (0.2.0)
22
+ hash-utils (>= 0.16.0)
29
23
  options-hash (0.1.0)
30
24
  hashie (>= 1.0.0)
31
- optipng (0.2.0)
32
- command-builder (>= 0.1.0)
33
- pipe-run (>= 0.2.0)
25
+ optipng (0.2.1)
26
+ command-builder (>= 0.2.0)
34
27
  unix-whereis (>= 0.1.0)
35
- pipe-run (0.2.1)
36
- rake (0.9.1)
37
- subexec (0.0.4)
28
+ pipe-run (0.3.0)
29
+ ruby-version (0.3.1)
38
30
  types (0.1.3)
39
31
  abstract (>= 1.0.0)
40
32
  multitype-introspection (>= 0.1.0)
41
- unix-whereis (0.1.0)
42
- command-builder (>= 0.1.0)
43
- hash-utils (>= 0.9.0)
44
- pipe-run (>= 0.1.0)
33
+ unix-whereis (0.1.1)
34
+ command-builder (>= 0.2.0)
35
+ hash-utils (>= 0.18.0)
45
36
  yaop (0.1.0)
46
37
  hash-utils (>= 0.1.0)
47
38
  types (>= 0.1.0)
@@ -50,12 +41,12 @@ PLATFORMS
50
41
  ruby
51
42
 
52
43
  DEPENDENCIES
53
- bundler (~> 1.0.14)
54
- jeweler (~> 1.6.0)
44
+ bundler (>= 1.0.14)
45
+ command-builder
46
+ jeweler2 (>= 2.0.0)
55
47
  jpegoptim (>= 0.2.0)
56
- jpegtran (>= 0.1.0)
57
- mini_magick (>= 3.2.1)
58
- options-hash (>= 0.1.0)
48
+ jpegtran
49
+ options-hash
59
50
  optipng (>= 0.2.0)
60
- unix-whereis (>= 0.1.0)
61
- yaop (>= 0.1.0)
51
+ unix-whereis
52
+ yaop
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2011 Martin Kozák (martinkozak@martinkozak.net)
1
+ Copyright (c) 2011 - 2012 Martin Kozák (martinkozak@martinkozak.net)
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ rescue Bundler::BundlerError => e
12
12
  end
13
13
 
14
14
  require 'rake'
15
- require 'jeweler'
15
+ require 'jeweler2'
16
16
 
17
17
  Jeweler::Tasks.new do |gem|
18
18
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{image-optimizer}
8
- s.version = "0.1.2"
7
+ s.name = "image-optimizer"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = [%q{Martin Kozák}]
12
- s.date = %q{2011-06-01}
13
- s.email = %q{martinkozak@martinkozak.net}
14
- s.executables = [%q{image-optimizer}]
11
+ s.authors = ["Martin Koz\u{e1}k"]
12
+ s.date = "2012-01-22"
13
+ s.email = "martinkozak@martinkozak.net"
14
+ s.executables = ["image-optimizer"]
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE.txt",
17
17
  "README.md"
@@ -28,46 +28,46 @@ Gem::Specification.new do |s|
28
28
  "image-optimizer.gemspec",
29
29
  "lib/image-optimizer.rb"
30
30
  ]
31
- s.homepage = %q{http://github.com/martinkozak/image-optimizer}
32
- s.licenses = [%q{MIT}]
33
- s.require_paths = [%q{lib}]
34
- s.rubygems_version = %q{1.8.5}
35
- s.summary = %q{Optimizes given JPEG and PNG images or images in given folder.}
31
+ s.homepage = "http://github.com/martinkozak/image-optimizer"
32
+ s.licenses = ["MIT"]
33
+ s.require_paths = ["lib"]
34
+ s.rubygems_version = "1.8.15"
35
+ s.summary = "Optimizes given JPEG and PNG images or images in given folder."
36
36
 
37
37
  if s.respond_to? :specification_version then
38
38
  s.specification_version = 3
39
39
 
40
40
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
41
- s.add_runtime_dependency(%q<yaop>, [">= 0.1.0"])
42
- s.add_runtime_dependency(%q<jpegtran>, [">= 0.1.0"])
41
+ s.add_runtime_dependency(%q<yaop>, [">= 0"])
42
+ s.add_runtime_dependency(%q<jpegtran>, [">= 0"])
43
43
  s.add_runtime_dependency(%q<optipng>, [">= 0.2.0"])
44
44
  s.add_runtime_dependency(%q<jpegoptim>, [">= 0.2.0"])
45
- s.add_runtime_dependency(%q<mini_magick>, [">= 3.2.1"])
46
- s.add_runtime_dependency(%q<unix-whereis>, [">= 0.1.0"])
47
- s.add_runtime_dependency(%q<options-hash>, [">= 0.1.0"])
48
- s.add_development_dependency(%q<bundler>, ["~> 1.0.14"])
49
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
45
+ s.add_runtime_dependency(%q<unix-whereis>, [">= 0"])
46
+ s.add_runtime_dependency(%q<options-hash>, [">= 0"])
47
+ s.add_runtime_dependency(%q<command-builder>, [">= 0"])
48
+ s.add_development_dependency(%q<bundler>, [">= 1.0.14"])
49
+ s.add_development_dependency(%q<jeweler2>, [">= 2.0.0"])
50
50
  else
51
- s.add_dependency(%q<yaop>, [">= 0.1.0"])
52
- s.add_dependency(%q<jpegtran>, [">= 0.1.0"])
51
+ s.add_dependency(%q<yaop>, [">= 0"])
52
+ s.add_dependency(%q<jpegtran>, [">= 0"])
53
53
  s.add_dependency(%q<optipng>, [">= 0.2.0"])
54
54
  s.add_dependency(%q<jpegoptim>, [">= 0.2.0"])
55
- s.add_dependency(%q<mini_magick>, [">= 3.2.1"])
56
- s.add_dependency(%q<unix-whereis>, [">= 0.1.0"])
57
- s.add_dependency(%q<options-hash>, [">= 0.1.0"])
58
- s.add_dependency(%q<bundler>, ["~> 1.0.14"])
59
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
55
+ s.add_dependency(%q<unix-whereis>, [">= 0"])
56
+ s.add_dependency(%q<options-hash>, [">= 0"])
57
+ s.add_dependency(%q<command-builder>, [">= 0"])
58
+ s.add_dependency(%q<bundler>, [">= 1.0.14"])
59
+ s.add_dependency(%q<jeweler2>, [">= 2.0.0"])
60
60
  end
61
61
  else
62
- s.add_dependency(%q<yaop>, [">= 0.1.0"])
63
- s.add_dependency(%q<jpegtran>, [">= 0.1.0"])
62
+ s.add_dependency(%q<yaop>, [">= 0"])
63
+ s.add_dependency(%q<jpegtran>, [">= 0"])
64
64
  s.add_dependency(%q<optipng>, [">= 0.2.0"])
65
65
  s.add_dependency(%q<jpegoptim>, [">= 0.2.0"])
66
- s.add_dependency(%q<mini_magick>, [">= 3.2.1"])
67
- s.add_dependency(%q<unix-whereis>, [">= 0.1.0"])
68
- s.add_dependency(%q<options-hash>, [">= 0.1.0"])
69
- s.add_dependency(%q<bundler>, ["~> 1.0.14"])
70
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
66
+ s.add_dependency(%q<unix-whereis>, [">= 0"])
67
+ s.add_dependency(%q<options-hash>, [">= 0"])
68
+ s.add_dependency(%q<command-builder>, [">= 0"])
69
+ s.add_dependency(%q<bundler>, [">= 1.0.14"])
70
+ s.add_dependency(%q<jeweler2>, [">= 2.0.0"])
71
71
  end
72
72
  end
73
73
 
@@ -84,12 +84,12 @@ module ImageOptimizer
84
84
  block.call(path.dup)
85
85
 
86
86
  if Whereis.available? :convert
87
- begin
88
- image = MiniMagick::Image.open(path)
89
- image.write(path)
90
- rescue MiniMagick::Error
91
- # skips
92
- end
87
+ cmd = CommandBuilder::new(:convert, ["-", " ", "-", " "])
88
+ cmd << path
89
+ cmd.arg(:quality, 100)
90
+ cmd << path
91
+
92
+ cmd.execute!
93
93
  end
94
94
 
95
95
  if Optipng.available?
metadata CHANGED
@@ -1,126 +1,124 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: image-optimizer
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
4
5
  prerelease:
5
- version: 0.1.2
6
6
  platform: ruby
7
- authors:
8
- - "Martin Koz\xC3\xA1k"
7
+ authors:
8
+ - Martin Kozák
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-06-01 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
12
+ date: 2012-01-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
16
15
  name: yaop
17
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &16022320 !ruby/object:Gem::Requirement
18
17
  none: false
19
- requirements:
20
- - - ">="
21
- - !ruby/object:Gem::Version
22
- version: 0.1.0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
23
22
  type: :runtime
24
23
  prerelease: false
25
- version_requirements: *id001
26
- - !ruby/object:Gem::Dependency
24
+ version_requirements: *16022320
25
+ - !ruby/object:Gem::Dependency
27
26
  name: jpegtran
28
- requirement: &id002 !ruby/object:Gem::Requirement
27
+ requirement: &16020300 !ruby/object:Gem::Requirement
29
28
  none: false
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 0.1.0
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
34
33
  type: :runtime
35
34
  prerelease: false
36
- version_requirements: *id002
37
- - !ruby/object:Gem::Dependency
35
+ version_requirements: *16020300
36
+ - !ruby/object:Gem::Dependency
38
37
  name: optipng
39
- requirement: &id003 !ruby/object:Gem::Requirement
38
+ requirement: &16037180 !ruby/object:Gem::Requirement
40
39
  none: false
41
- requirements:
42
- - - ">="
43
- - !ruby/object:Gem::Version
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
44
43
  version: 0.2.0
45
44
  type: :runtime
46
45
  prerelease: false
47
- version_requirements: *id003
48
- - !ruby/object:Gem::Dependency
46
+ version_requirements: *16037180
47
+ - !ruby/object:Gem::Dependency
49
48
  name: jpegoptim
50
- requirement: &id004 !ruby/object:Gem::Requirement
49
+ requirement: &16035140 !ruby/object:Gem::Requirement
51
50
  none: false
52
- requirements:
53
- - - ">="
54
- - !ruby/object:Gem::Version
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
55
54
  version: 0.2.0
56
55
  type: :runtime
57
56
  prerelease: false
58
- version_requirements: *id004
59
- - !ruby/object:Gem::Dependency
60
- name: mini_magick
61
- requirement: &id005 !ruby/object:Gem::Requirement
57
+ version_requirements: *16035140
58
+ - !ruby/object:Gem::Dependency
59
+ name: unix-whereis
60
+ requirement: &16033740 !ruby/object:Gem::Requirement
62
61
  none: false
63
- requirements:
64
- - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 3.2.1
62
+ requirements:
63
+ - - ! '>='
64
+ - !ruby/object:Gem::Version
65
+ version: '0'
67
66
  type: :runtime
68
67
  prerelease: false
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
71
- name: unix-whereis
72
- requirement: &id006 !ruby/object:Gem::Requirement
68
+ version_requirements: *16033740
69
+ - !ruby/object:Gem::Dependency
70
+ name: options-hash
71
+ requirement: &16031340 !ruby/object:Gem::Requirement
73
72
  none: false
74
- requirements:
75
- - - ">="
76
- - !ruby/object:Gem::Version
77
- version: 0.1.0
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
78
77
  type: :runtime
79
78
  prerelease: false
80
- version_requirements: *id006
81
- - !ruby/object:Gem::Dependency
82
- name: options-hash
83
- requirement: &id007 !ruby/object:Gem::Requirement
79
+ version_requirements: *16031340
80
+ - !ruby/object:Gem::Dependency
81
+ name: command-builder
82
+ requirement: &16030640 !ruby/object:Gem::Requirement
84
83
  none: false
85
- requirements:
86
- - - ">="
87
- - !ruby/object:Gem::Version
88
- version: 0.1.0
84
+ requirements:
85
+ - - ! '>='
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
89
88
  type: :runtime
90
89
  prerelease: false
91
- version_requirements: *id007
92
- - !ruby/object:Gem::Dependency
90
+ version_requirements: *16030640
91
+ - !ruby/object:Gem::Dependency
93
92
  name: bundler
94
- requirement: &id008 !ruby/object:Gem::Requirement
93
+ requirement: &16647120 !ruby/object:Gem::Requirement
95
94
  none: false
96
- requirements:
97
- - - ~>
98
- - !ruby/object:Gem::Version
95
+ requirements:
96
+ - - ! '>='
97
+ - !ruby/object:Gem::Version
99
98
  version: 1.0.14
100
99
  type: :development
101
100
  prerelease: false
102
- version_requirements: *id008
103
- - !ruby/object:Gem::Dependency
104
- name: jeweler
105
- requirement: &id009 !ruby/object:Gem::Requirement
101
+ version_requirements: *16647120
102
+ - !ruby/object:Gem::Dependency
103
+ name: jeweler2
104
+ requirement: &16644900 !ruby/object:Gem::Requirement
106
105
  none: false
107
- requirements:
108
- - - ~>
109
- - !ruby/object:Gem::Version
110
- version: 1.6.0
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: 2.0.0
111
110
  type: :development
112
111
  prerelease: false
113
- version_requirements: *id009
112
+ version_requirements: *16644900
114
113
  description:
115
114
  email: martinkozak@martinkozak.net
116
- executables:
115
+ executables:
117
116
  - image-optimizer
118
117
  extensions: []
119
-
120
- extra_rdoc_files:
118
+ extra_rdoc_files:
121
119
  - LICENSE.txt
122
120
  - README.md
123
- files:
121
+ files:
124
122
  - .document
125
123
  - Gemfile
126
124
  - Gemfile.lock
@@ -132,34 +130,31 @@ files:
132
130
  - image-optimizer.gemspec
133
131
  - lib/image-optimizer.rb
134
132
  homepage: http://github.com/martinkozak/image-optimizer
135
- licenses:
133
+ licenses:
136
134
  - MIT
137
135
  post_install_message:
138
136
  rdoc_options: []
139
-
140
- require_paths:
137
+ require_paths:
141
138
  - lib
142
- required_ruby_version: !ruby/object:Gem::Requirement
139
+ required_ruby_version: !ruby/object:Gem::Requirement
143
140
  none: false
144
- requirements:
145
- - - ">="
146
- - !ruby/object:Gem::Version
147
- hash: -2310788483444750640
148
- segments:
141
+ requirements:
142
+ - - ! '>='
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
145
+ segments:
149
146
  - 0
150
- version: "0"
151
- required_rubygems_version: !ruby/object:Gem::Requirement
147
+ hash: -2436871939392725205
148
+ required_rubygems_version: !ruby/object:Gem::Requirement
152
149
  none: false
153
- requirements:
154
- - - ">="
155
- - !ruby/object:Gem::Version
156
- version: "0"
150
+ requirements:
151
+ - - ! '>='
152
+ - !ruby/object:Gem::Version
153
+ version: '0'
157
154
  requirements: []
158
-
159
155
  rubyforge_project:
160
- rubygems_version: 1.8.5
156
+ rubygems_version: 1.8.15
161
157
  signing_key:
162
158
  specification_version: 3
163
159
  summary: Optimizes given JPEG and PNG images or images in given folder.
164
160
  test_files: []
165
-