zbar 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/spec/zbar/image_spec.rb +26 -26
- data/spec/zbar/jpeg_spec.rb +35 -0
- data/spec/zbar/processor_spec.rb +1 -1
- data/zbar.gemspec +4 -3
- metadata +5 -4
data/Rakefile
CHANGED
@@ -17,7 +17,7 @@ Jeweler::Tasks.new do |gem|
|
|
17
17
|
gem.summary = "Ruby bindings for ZBar, a barcode recognition library"
|
18
18
|
gem.description ="Ruby bindings for ZBar, a barcode recognition library. Uses FFI to interact with the underlying C library, but has no other dependencies."
|
19
19
|
gem.email = "will@willglynn.com"
|
20
|
-
gem.homepage = "http://github.com/
|
20
|
+
gem.homepage = "http://github.com/willglynn/ruby-zbar"
|
21
21
|
gem.authors = ["Will Glynn"]
|
22
22
|
gem.post_install_message = "\nzbar: This gem depends on the \"zbar\" C library.\n If it's not installed, `require \"zbar\"` will fail.\n\n"
|
23
23
|
# dependencies defined in Gemfile
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
data/spec/zbar/image_spec.rb
CHANGED
@@ -16,31 +16,6 @@ describe ZBar::Image do
|
|
16
16
|
|
17
17
|
its(:width) { should == 480 }
|
18
18
|
its(:height) { should == 240 }
|
19
|
-
|
20
|
-
describe "process" do
|
21
|
-
it "delegates to the passed processor" do
|
22
|
-
processor = double("processor")
|
23
|
-
expected_result = Object.new
|
24
|
-
processor.should_receive(:process).with(subject).and_return(expected_result)
|
25
|
-
|
26
|
-
subject.process(processor).should == expected_result
|
27
|
-
end
|
28
|
-
|
29
|
-
it "instantiates a new processor with no arguments" do
|
30
|
-
processor = double("processor")
|
31
|
-
processor.should_receive(:process)
|
32
|
-
ZBar::Processor.should_receive(:new).with().and_return(processor)
|
33
|
-
subject.process
|
34
|
-
end
|
35
|
-
|
36
|
-
it "instantiates a new processor with configuration" do
|
37
|
-
config_hash = { :foo => :bar }
|
38
|
-
processor = double("processor")
|
39
|
-
processor.should_receive(:process)
|
40
|
-
ZBar::Processor.should_receive(:new).with(config_hash).and_return(processor)
|
41
|
-
subject.process(config_hash)
|
42
|
-
end
|
43
|
-
end
|
44
19
|
end
|
45
20
|
end
|
46
21
|
end
|
@@ -52,9 +27,34 @@ describe ZBar::Image do
|
|
52
27
|
|
53
28
|
context "given test.pgm" do
|
54
29
|
let(:pgm_file) { "test.pgm" }
|
55
|
-
|
30
|
+
|
56
31
|
its(:width) { should == 480 }
|
57
32
|
its(:height) { should == 240 }
|
33
|
+
|
34
|
+
describe "process" do
|
35
|
+
it "delegates to the passed processor" do
|
36
|
+
processor = double("processor")
|
37
|
+
expected_result = Object.new
|
38
|
+
processor.should_receive(:process).with(subject).and_return(expected_result)
|
39
|
+
|
40
|
+
subject.process(processor).should == expected_result
|
41
|
+
end
|
42
|
+
|
43
|
+
it "instantiates a new processor with no arguments" do
|
44
|
+
processor = double("processor")
|
45
|
+
processor.should_receive(:process)
|
46
|
+
ZBar::Processor.should_receive(:new).with().and_return(processor)
|
47
|
+
subject.process
|
48
|
+
end
|
49
|
+
|
50
|
+
it "instantiates a new processor with configuration" do
|
51
|
+
config_hash = { :foo => :bar }
|
52
|
+
processor = double("processor")
|
53
|
+
processor.should_receive(:process)
|
54
|
+
ZBar::Processor.should_receive(:new).with(config_hash).and_return(processor)
|
55
|
+
subject.process(config_hash)
|
56
|
+
end
|
57
|
+
end
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
+
|
3
|
+
describe ZBar::JPEG do
|
4
|
+
subject { described_class }
|
5
|
+
|
6
|
+
describe "available?" do
|
7
|
+
specify "should be a boolean" do
|
8
|
+
(!!subject.available?).should == (subject.available?)
|
9
|
+
end
|
10
|
+
|
11
|
+
specify "should memoize the result" do
|
12
|
+
result = Object.new
|
13
|
+
subject.instance_variable_set(:@available, result)
|
14
|
+
subject.available?.should == result
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe "bugged?" do
|
19
|
+
specify "should be a boolean" do
|
20
|
+
(!!subject.bugged?).should == (subject.bugged?)
|
21
|
+
end
|
22
|
+
|
23
|
+
specify "should memoize the result" do
|
24
|
+
result = Object.new
|
25
|
+
subject.instance_variable_set(:@bugged, result)
|
26
|
+
subject.bugged?.should == result
|
27
|
+
end
|
28
|
+
|
29
|
+
specify "should be false if JPEG support is unavailable" do
|
30
|
+
subject.instance_variable_set(:@bugged, nil)
|
31
|
+
subject.should_receive(:available?).and_return(false)
|
32
|
+
subject.bugged?.should == false
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
data/spec/zbar/processor_spec.rb
CHANGED
data/zbar.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "zbar"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Will Glynn"]
|
12
|
-
s.date = "2013-06-
|
12
|
+
s.date = "2013-06-25"
|
13
13
|
s.description = "Ruby bindings for ZBar, a barcode recognition library. Uses FFI to interact with the underlying C library, but has no other dependencies."
|
14
14
|
s.email = "will@willglynn.com"
|
15
15
|
s.extra_rdoc_files = [
|
@@ -37,12 +37,13 @@ Gem::Specification.new do |s|
|
|
37
37
|
"spec/support/test.jpg",
|
38
38
|
"spec/support/test.pgm",
|
39
39
|
"spec/zbar/image_spec.rb",
|
40
|
+
"spec/zbar/jpeg_spec.rb",
|
40
41
|
"spec/zbar/library_version_spec.rb",
|
41
42
|
"spec/zbar/processor_spec.rb",
|
42
43
|
"spec/zbar_spec.rb",
|
43
44
|
"zbar.gemspec"
|
44
45
|
]
|
45
|
-
s.homepage = "http://github.com/
|
46
|
+
s.homepage = "http://github.com/willglynn/ruby-zbar"
|
46
47
|
s.post_install_message = "\nzbar: This gem depends on the \"zbar\" C library.\n If it's not installed, `require \"zbar\"` will fail.\n\n"
|
47
48
|
s.require_paths = ["lib"]
|
48
49
|
s.rubygems_version = "1.8.25"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zbar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-06-
|
12
|
+
date: 2013-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
@@ -136,11 +136,12 @@ files:
|
|
136
136
|
- spec/support/test.jpg
|
137
137
|
- spec/support/test.pgm
|
138
138
|
- spec/zbar/image_spec.rb
|
139
|
+
- spec/zbar/jpeg_spec.rb
|
139
140
|
- spec/zbar/library_version_spec.rb
|
140
141
|
- spec/zbar/processor_spec.rb
|
141
142
|
- spec/zbar_spec.rb
|
142
143
|
- zbar.gemspec
|
143
|
-
homepage: http://github.com/
|
144
|
+
homepage: http://github.com/willglynn/ruby-zbar
|
144
145
|
licenses: []
|
145
146
|
post_install_message: ! "\nzbar: This gem depends on the \"zbar\" C library.\n If
|
146
147
|
it's not installed, `require \"zbar\"` will fail.\n\n"
|
@@ -155,7 +156,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
155
156
|
version: '0'
|
156
157
|
segments:
|
157
158
|
- 0
|
158
|
-
hash:
|
159
|
+
hash: 2616840748018373836
|
159
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
161
|
none: false
|
161
162
|
requirements:
|