jpegtran 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (8) hide show
  1. data/CHANGES.txt +10 -0
  2. data/Gemfile +4 -5
  3. data/Gemfile.lock +11 -11
  4. data/Rakefile +4 -11
  5. data/VERSION +1 -1
  6. data/jpegtran.gemspec +16 -18
  7. data/lib/jpegtran.rb +17 -27
  8. metadata +16 -26
@@ -0,0 +1,10 @@
1
+
2
+ 0.1.2 (2011-07-30)
3
+ * executing directly by 'command-builder'
4
+ * switch to more modern 'hash-utils'
5
+
6
+ 0.1.1 (2011-02-30)
7
+ * some subminor issues
8
+
9
+ 0.1.0 (2011-05-28)
10
+ * initial version
data/Gemfile CHANGED
@@ -1,15 +1,14 @@
1
1
  source "http://rubygems.org"
2
2
  # Add dependencies required to use your gem here.
3
3
  # Example:
4
- gem "hash-utils", ">= 0.15.0"
5
- gem "pipe-run", ">= 0.2.1"
6
- gem "command-builder", ">= 0.1.0"
4
+ gem "hash-utils", ">= 0.18.0"
5
+ gem "command-builder", ">= 0.2.0"
7
6
  gem "unix-whereis", ">= 0.1.0"
8
7
  gem "lookup-hash", ">= 0.2.0"
9
8
 
10
9
  # Add dependencies to develop your gem here.
11
10
  # Include everything needed to run rake, tests, features, etc.
12
11
  group :development do
13
- gem "bundler", "~> 1.0.0"
14
- gem "jeweler", "~> 1.5.2"
12
+ gem "bundler", ">= 1.0.0"
13
+ gem "jeweler", ">= 1.5.2"
15
14
  end
@@ -1,18 +1,19 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- command-builder (0.1.0)
5
- hash-utils (>= 0.7.0)
4
+ command-builder (0.2.0)
5
+ hash-utils (>= 0.18.0)
6
+ pipe-run (>= 0.2.1)
6
7
  git (1.2.5)
7
- hash-utils (0.15.0)
8
- jeweler (1.5.2)
9
- bundler (~> 1.0.0)
8
+ hash-utils (0.18.0)
9
+ jeweler (1.6.4)
10
+ bundler (~> 1.0)
10
11
  git (>= 1.2.5)
11
12
  rake
12
13
  lookup-hash (0.2.0)
13
14
  hash-utils (>= 0.11.0)
14
15
  pipe-run (0.2.1)
15
- rake (0.9.0)
16
+ rake (0.9.2)
16
17
  unix-whereis (0.1.0)
17
18
  command-builder (>= 0.1.0)
18
19
  hash-utils (>= 0.9.0)
@@ -22,10 +23,9 @@ PLATFORMS
22
23
  ruby
23
24
 
24
25
  DEPENDENCIES
25
- bundler (~> 1.0.0)
26
- command-builder (>= 0.1.0)
27
- hash-utils (>= 0.15.0)
28
- jeweler (~> 1.5.2)
26
+ bundler (>= 1.0.0)
27
+ command-builder (>= 0.2.0)
28
+ hash-utils (>= 0.18.0)
29
+ jeweler (>= 1.5.2)
29
30
  lookup-hash (>= 0.2.0)
30
- pipe-run (>= 0.2.1)
31
31
  unix-whereis (>= 0.1.0)
data/Rakefile CHANGED
@@ -1,6 +1,8 @@
1
1
  # encoding: utf-8
2
+
2
3
  require 'rubygems'
3
4
  require 'bundler'
5
+
4
6
  begin
5
7
  Bundler.setup(:default, :development)
6
8
  rescue Bundler::BundlerError => e
@@ -8,9 +10,10 @@ rescue Bundler::BundlerError => e
8
10
  $stderr.puts "Run `bundle install` to install missing gems"
9
11
  exit e.status_code
10
12
  end
11
- require 'rake'
12
13
 
14
+ require 'rake'
13
15
  require 'jeweler'
16
+
14
17
  Jeweler::Tasks.new do |gem|
15
18
  # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
16
19
  gem.name = "jpegtran"
@@ -25,13 +28,3 @@ Jeweler::Tasks.new do |gem|
25
28
  # gem.add_development_dependency 'rspec', '> 1.2.3'
26
29
  end
27
30
  Jeweler::RubygemsDotOrgTasks.new
28
-
29
- require 'rake/rdoctask'
30
- Rake::RDocTask.new do |rdoc|
31
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
32
-
33
- rdoc.rdoc_dir = 'rdoc'
34
- rdoc.title = "qrpc #{version}"
35
- rdoc.rdoc_files.include('README*')
36
- rdoc.rdoc_files.include('lib/**/*.rb')
37
- end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{jpegtran}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Martin Kozák}]
12
- s.date = %q{2011-05-29}
12
+ s.date = %q{2011-07-30}
13
13
  s.email = %q{martinkozak@martinkozak.net}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE.txt",
@@ -17,6 +17,7 @@ Gem::Specification.new do |s|
17
17
  ]
18
18
  s.files = [
19
19
  ".document",
20
+ "CHANGES.txt",
20
21
  "Gemfile",
21
22
  "Gemfile.lock",
22
23
  "LICENSE.txt",
@@ -31,37 +32,34 @@ Gem::Specification.new do |s|
31
32
  s.homepage = %q{https://github.com/martinkozak/jpegtran}
32
33
  s.licenses = [%q{MIT}]
33
34
  s.require_paths = [%q{lib}]
34
- s.rubygems_version = %q{1.8.4}
35
+ s.rubygems_version = %q{1.8.5}
35
36
  s.summary = %q{Ruby interface to 'jpegtran' tool.}
36
37
 
37
38
  if s.respond_to? :specification_version then
38
39
  s.specification_version = 3
39
40
 
40
41
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
41
- s.add_runtime_dependency(%q<hash-utils>, [">= 0.15.0"])
42
- s.add_runtime_dependency(%q<pipe-run>, [">= 0.2.1"])
43
- s.add_runtime_dependency(%q<command-builder>, [">= 0.1.0"])
42
+ s.add_runtime_dependency(%q<hash-utils>, [">= 0.18.0"])
43
+ s.add_runtime_dependency(%q<command-builder>, [">= 0.2.0"])
44
44
  s.add_runtime_dependency(%q<unix-whereis>, [">= 0.1.0"])
45
45
  s.add_runtime_dependency(%q<lookup-hash>, [">= 0.2.0"])
46
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
47
- s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
46
+ s.add_development_dependency(%q<bundler>, [">= 1.0.0"])
47
+ s.add_development_dependency(%q<jeweler>, [">= 1.5.2"])
48
48
  else
49
- s.add_dependency(%q<hash-utils>, [">= 0.15.0"])
50
- s.add_dependency(%q<pipe-run>, [">= 0.2.1"])
51
- s.add_dependency(%q<command-builder>, [">= 0.1.0"])
49
+ s.add_dependency(%q<hash-utils>, [">= 0.18.0"])
50
+ s.add_dependency(%q<command-builder>, [">= 0.2.0"])
52
51
  s.add_dependency(%q<unix-whereis>, [">= 0.1.0"])
53
52
  s.add_dependency(%q<lookup-hash>, [">= 0.2.0"])
54
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
55
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
53
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
54
+ s.add_dependency(%q<jeweler>, [">= 1.5.2"])
56
55
  end
57
56
  else
58
- s.add_dependency(%q<hash-utils>, [">= 0.15.0"])
59
- s.add_dependency(%q<pipe-run>, [">= 0.2.1"])
60
- s.add_dependency(%q<command-builder>, [">= 0.1.0"])
57
+ s.add_dependency(%q<hash-utils>, [">= 0.18.0"])
58
+ s.add_dependency(%q<command-builder>, [">= 0.2.0"])
61
59
  s.add_dependency(%q<unix-whereis>, [">= 0.1.0"])
62
60
  s.add_dependency(%q<lookup-hash>, [">= 0.2.0"])
63
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
64
- s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
61
+ s.add_dependency(%q<bundler>, [">= 1.0.0"])
62
+ s.add_dependency(%q<jeweler>, [">= 1.5.2"])
65
63
  end
66
64
  end
67
65
 
@@ -1,11 +1,10 @@
1
1
  # encoding: utf-8
2
2
  # (c) 2011 Martin Kozák (martinkozak@martinkozak.net)
3
3
 
4
- require "command-builder"
5
- require "pipe-run"
4
+ require "command-builder" # >= 0.2.0
6
5
  require "unix/whereis"
7
6
  require "lookup-hash"
8
- require "hash-utils/object" # >= 0.15.0
7
+ require "hash-utils/object" # >= 0.18.0
9
8
 
10
9
  ##
11
10
  # The +jpegtran+ tool command frontend.
@@ -90,7 +89,7 @@ module Jpegtran
90
89
 
91
90
  # Turn on/off arguments
92
91
  options.each_pair do |k, v|
93
- if v.true? and self::BOOLEAN_ARGS.has_key? k
92
+ if v.true? and k.in? self::BOOLEAN_ARGS
94
93
  cmd << k
95
94
  end
96
95
  end
@@ -98,35 +97,35 @@ module Jpegtran
98
97
  # Rotate
99
98
  if options[:rotate].kind_of? Integer
100
99
  cmd.arg(:rotate, options[:rotate].to_i)
101
- elsif options.has_key? :rotate
100
+ elsif :rotate.in? options
102
101
  raise Exception::new("Invalid value for :rotate option. Integer expected.")
103
102
  end
104
103
 
105
104
  # Rotate
106
105
  if options[:restart].kind_of? Integer
107
106
  cmd.arg(:restart, options[:restart].to_i)
108
- elsif options.has_key? :restart
107
+ elsif :restart.in? options
109
108
  raise Exception::new("Invalid value for :restart option. Integer expected.")
110
109
  end
111
110
 
112
111
  # Crop
113
- if options[:crop].kind_of? String
112
+ if options[:crop].string?
114
113
  cmd.arg(:crop, options[:crop].to_s)
115
- elsif options.has_key? :crop
114
+ elsif :crop.in? options
116
115
  raise Exception::new("Invalid value for :crop option. Structured string expected. See 'jpegtran' reference.")
117
116
  end
118
117
 
119
118
  # Scans
120
- if options[:scans].kind_of? String
119
+ if options[:scans].string?
121
120
  cmd.arg(:scans, options[:scans].to_s)
122
- elsif options.has_key? :scans
121
+ elsif :scans.in? options
123
122
  raise Exception::new("Invalid value for :scans option. String expected.")
124
123
  end
125
124
 
126
125
  # Copy
127
- if options.has_key? :copy
126
+ if :copy.in? options
128
127
  value = options[:copy].to_sym
129
- if self::COPY_OPTIONS.has_key? value
128
+ if vlaue.in? self::COPY_OPTIONS
130
129
  cmd.arg(:copy, value)
131
130
  else
132
131
  raise Exception::new("Invalid value for :copy. Expected " << self::COPY_OPTIONS.to_s)
@@ -134,9 +133,9 @@ module Jpegtran
134
133
  end
135
134
 
136
135
  # Flip
137
- if options.has_key? :flip
136
+ if :flip.in? options
138
137
  value = options[:flip].to_sym
139
- if self::FLIP_OPTIONS.has_key? value
138
+ if value.in? self::FLIP_OPTIONS
140
139
  cmd.arg(:flip, value)
141
140
  else
142
141
  raise Exception::new("Invalid value for :flip. Expected " << self::FLIP_OPTIONS.to_s)
@@ -144,8 +143,8 @@ module Jpegtran
144
143
  end
145
144
 
146
145
  # Outfile
147
- if options.has_key? :outfile
148
- if options[:outfile].kind_of? String
146
+ if :outfile.in? options
147
+ if options[:outfile].string?
149
148
  value = options[:outfile].to_s
150
149
  else
151
150
  raise Exception::new("Invalid value for :outfile option. String expected.")
@@ -163,22 +162,13 @@ module Jpegtran
163
162
  STDERR.write cmd.to_s + "\n"
164
163
  end
165
164
 
166
- cmd = cmd.to_s
167
-
168
165
  # Blocking
169
166
  if block.nil?
170
- #output = Pipe.run(cmd)
171
- Pipe.run(cmd)
167
+ cmd.execute!
172
168
 
173
- # Parses output
174
- #errors = __parse_output(output)
175
- #return self::Result::new(errors)
176
-
177
169
  # Non-blocking
178
170
  else
179
- Pipe.run(cmd) do #|output|
180
- # errors = __parse_output(output)
181
- # block.call(self::Result::new(errors))
171
+ cmd.execute do |output|
182
172
  block.call()
183
173
  end
184
174
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: jpegtran
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.1
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - "Martin Koz\xC3\xA1k"
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-05-29 00:00:00 Z
13
+ date: 2011-07-30 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: hash-utils
@@ -19,23 +19,23 @@ dependencies:
19
19
  requirements:
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.15.0
22
+ version: 0.18.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: *id001
26
26
  - !ruby/object:Gem::Dependency
27
- name: pipe-run
27
+ name: command-builder
28
28
  requirement: &id002 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.2.1
33
+ version: 0.2.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: *id002
37
37
  - !ruby/object:Gem::Dependency
38
- name: command-builder
38
+ name: unix-whereis
39
39
  requirement: &id003 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
@@ -46,49 +46,38 @@ dependencies:
46
46
  prerelease: false
47
47
  version_requirements: *id003
48
48
  - !ruby/object:Gem::Dependency
49
- name: unix-whereis
49
+ name: lookup-hash
50
50
  requirement: &id004 !ruby/object:Gem::Requirement
51
51
  none: false
52
52
  requirements:
53
53
  - - ">="
54
54
  - !ruby/object:Gem::Version
55
- version: 0.1.0
55
+ version: 0.2.0
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: *id004
59
59
  - !ruby/object:Gem::Dependency
60
- name: lookup-hash
60
+ name: bundler
61
61
  requirement: &id005 !ruby/object:Gem::Requirement
62
62
  none: false
63
63
  requirements:
64
64
  - - ">="
65
- - !ruby/object:Gem::Version
66
- version: 0.2.0
67
- type: :runtime
68
- prerelease: false
69
- version_requirements: *id005
70
- - !ruby/object:Gem::Dependency
71
- name: bundler
72
- requirement: &id006 !ruby/object:Gem::Requirement
73
- none: false
74
- requirements:
75
- - - ~>
76
65
  - !ruby/object:Gem::Version
77
66
  version: 1.0.0
78
67
  type: :development
79
68
  prerelease: false
80
- version_requirements: *id006
69
+ version_requirements: *id005
81
70
  - !ruby/object:Gem::Dependency
82
71
  name: jeweler
83
- requirement: &id007 !ruby/object:Gem::Requirement
72
+ requirement: &id006 !ruby/object:Gem::Requirement
84
73
  none: false
85
74
  requirements:
86
- - - ~>
75
+ - - ">="
87
76
  - !ruby/object:Gem::Version
88
77
  version: 1.5.2
89
78
  type: :development
90
79
  prerelease: false
91
- version_requirements: *id007
80
+ version_requirements: *id006
92
81
  description:
93
82
  email: martinkozak@martinkozak.net
94
83
  executables: []
@@ -100,6 +89,7 @@ extra_rdoc_files:
100
89
  - README.md
101
90
  files:
102
91
  - .document
92
+ - CHANGES.txt
103
93
  - Gemfile
104
94
  - Gemfile.lock
105
95
  - LICENSE.txt
@@ -123,7 +113,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
123
113
  requirements:
124
114
  - - ">="
125
115
  - !ruby/object:Gem::Version
126
- hash: -1256859169856077807
116
+ hash: 4556189913197607796
127
117
  segments:
128
118
  - 0
129
119
  version: "0"
@@ -136,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
126
  requirements: []
137
127
 
138
128
  rubyforge_project:
139
- rubygems_version: 1.8.4
129
+ rubygems_version: 1.8.5
140
130
  signing_key:
141
131
  specification_version: 3
142
132
  summary: Ruby interface to 'jpegtran' tool.