zpng 0.2.5 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +4 -3
- data/Gemfile.lock +70 -49
- data/VERSION +1 -1
- data/lib/zpng/text_chunk.rb +7 -1
- data/spec/adam7_spec.rb +6 -3
- data/spec/create_image_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- data/spec/support/png_suite.rb +1 -1
- data/zpng.gemspec +27 -30
- metadata +41 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: e41225a534a9464c03362fe6d39ece7919758fe92d3e4677fcfa3008317b481d
|
4
|
+
data.tar.gz: 9af6c65af89d398d786cb4f99494da2d45e9c4174d007d61f54d890cd3c01b7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51cdbd15de8dfb293509bb94178de5f8cf2dd78d7c3cc411dbdf6e236f4b9d83d986a7b1be97f7077b12e5b0ed95b5f6b6a1212b84e97d0b6ee1a8ba9537b22
|
7
|
+
data.tar.gz: 33e0a05d30dc57a2cdedd47c3434cfbdb023438e5a03abb7282e5f8a5ec4f183063606876144c83a261603c0a918078c34b2991506c827cc90dea3b788182339
|
data/Gemfile
CHANGED
@@ -7,8 +7,9 @@ gem 'rainbow'
|
|
7
7
|
# Add dependencies to develop your gem here.
|
8
8
|
# Include everything needed to run rake, tests, features, etc.
|
9
9
|
group :development do
|
10
|
-
gem "rspec", "
|
11
|
-
gem "
|
12
|
-
gem "
|
10
|
+
gem "rspec", "~> 3.9.0"
|
11
|
+
gem "rspec-its", "~> 1.3.0"
|
12
|
+
gem "bundler", "~> 2.2.3"
|
13
|
+
gem "jeweler", "~> 2.3.9"
|
13
14
|
gem "what_methods"
|
14
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,66 +1,87 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.
|
5
|
-
builder (3.2.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
addressable (2.4.0)
|
5
|
+
builder (3.2.4)
|
6
|
+
descendants_tracker (0.0.4)
|
7
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
8
|
+
diff-lcs (1.4.4)
|
9
|
+
faraday (0.9.2)
|
10
|
+
multipart-post (>= 1.2, < 3)
|
11
|
+
git (1.8.1)
|
12
|
+
rchardet (~> 1.8)
|
13
|
+
github_api (0.16.0)
|
14
|
+
addressable (~> 2.4.0)
|
15
|
+
descendants_tracker (~> 0.0.4)
|
16
|
+
faraday (~> 0.8, < 0.10)
|
17
|
+
hashie (>= 3.4)
|
18
|
+
mime-types (>= 1.16, < 3.0)
|
19
|
+
oauth2 (~> 1.0)
|
20
|
+
hashie (4.1.0)
|
21
|
+
highline (2.0.3)
|
22
|
+
jeweler (2.3.9)
|
21
23
|
builder
|
22
|
-
bundler
|
24
|
+
bundler
|
23
25
|
git (>= 1.2.5)
|
24
|
-
github_api (
|
26
|
+
github_api (~> 0.16.0)
|
25
27
|
highline (>= 1.6.15)
|
26
|
-
nokogiri (
|
28
|
+
nokogiri (>= 1.5.10)
|
29
|
+
psych
|
27
30
|
rake
|
28
31
|
rdoc
|
29
|
-
|
30
|
-
jwt (
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
32
|
+
semver2
|
33
|
+
jwt (2.2.2)
|
34
|
+
mime-types (2.99.3)
|
35
|
+
mini_portile2 (2.6.1)
|
36
|
+
multi_json (1.15.0)
|
37
|
+
multi_xml (0.6.0)
|
38
|
+
multipart-post (2.1.1)
|
39
|
+
nokogiri (1.12.5)
|
40
|
+
mini_portile2 (~> 2.6.1)
|
41
|
+
racc (~> 1.4)
|
42
|
+
oauth2 (1.4.4)
|
43
|
+
faraday (>= 0.8, < 2.0)
|
44
|
+
jwt (>= 1.0, < 3.0)
|
45
|
+
multi_json (~> 1.3)
|
41
46
|
multi_xml (~> 0.5)
|
42
|
-
rack (
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
rspec-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
47
|
+
rack (>= 1.2, < 3)
|
48
|
+
psych (3.3.0)
|
49
|
+
racc (1.5.2)
|
50
|
+
rack (2.2.3)
|
51
|
+
rainbow (3.0.0)
|
52
|
+
rake (13.0.3)
|
53
|
+
rchardet (1.8.0)
|
54
|
+
rdoc (6.3.2)
|
55
|
+
rspec (3.9.0)
|
56
|
+
rspec-core (~> 3.9.0)
|
57
|
+
rspec-expectations (~> 3.9.0)
|
58
|
+
rspec-mocks (~> 3.9.0)
|
59
|
+
rspec-core (3.9.3)
|
60
|
+
rspec-support (~> 3.9.3)
|
61
|
+
rspec-expectations (3.9.4)
|
62
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
63
|
+
rspec-support (~> 3.9.0)
|
64
|
+
rspec-its (1.3.0)
|
65
|
+
rspec-core (>= 3.0.0)
|
66
|
+
rspec-expectations (>= 3.0.0)
|
67
|
+
rspec-mocks (3.9.1)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.9.0)
|
70
|
+
rspec-support (3.9.4)
|
71
|
+
semver2 (3.4.2)
|
72
|
+
thread_safe (0.3.6)
|
56
73
|
what_methods (1.0.1)
|
57
74
|
|
58
75
|
PLATFORMS
|
59
76
|
ruby
|
60
77
|
|
61
78
|
DEPENDENCIES
|
62
|
-
bundler (
|
63
|
-
jeweler (~>
|
79
|
+
bundler (~> 2.2.3)
|
80
|
+
jeweler (~> 2.3.9)
|
64
81
|
rainbow
|
65
|
-
rspec (
|
82
|
+
rspec (~> 3.9.0)
|
83
|
+
rspec-its (~> 1.3.0)
|
66
84
|
what_methods
|
85
|
+
|
86
|
+
BUNDLED WITH
|
87
|
+
2.2.3
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.3
|
data/lib/zpng/text_chunk.rb
CHANGED
@@ -2,13 +2,19 @@ module ZPNG
|
|
2
2
|
class TextChunk < Chunk
|
3
3
|
attr_accessor :keyword, :text
|
4
4
|
|
5
|
+
if RUBY_VERSION > "2.4"
|
6
|
+
INTEGER_CLASS = Integer
|
7
|
+
else
|
8
|
+
INTEGER_CLASS = Fixnum
|
9
|
+
end
|
10
|
+
|
5
11
|
def inspect verbosity = 10
|
6
12
|
vars = %w'keyword text language translated_keyword cmethod cflag'
|
7
13
|
vars -= %w'text translated_keyword' if verbosity <=0
|
8
14
|
super.sub(/ *>$/,'') + ", " +
|
9
15
|
vars.map do |var|
|
10
16
|
t = instance_variable_get("@#{var}")
|
11
|
-
unless t.is_a?(
|
17
|
+
unless t.is_a?(INTEGER_CLASS)
|
12
18
|
t = t.to_s
|
13
19
|
t = t[0..20] + "..." if t.size > 20
|
14
20
|
end
|
data/spec/adam7_spec.rb
CHANGED
@@ -13,7 +13,8 @@ describe ZPNG::Adam7Decoder do
|
|
13
13
|
}.each do |dims, slw|
|
14
14
|
it "should be right for #{dims} image" do
|
15
15
|
w,h = dims.split('x').map(&:to_i)
|
16
|
-
img =
|
16
|
+
img = Object.new
|
17
|
+
allow(img).to receive_messages(:width => w, :height => h)
|
17
18
|
adam7 = ZPNG::Adam7Decoder.new(img)
|
18
19
|
slw.size.times.map{ |i| adam7.scanline_width(i) }.should == slw
|
19
20
|
end
|
@@ -33,7 +34,8 @@ describe ZPNG::Adam7Decoder do
|
|
33
34
|
}.each do |dims, n|
|
34
35
|
it "should be right for #{dims} image" do
|
35
36
|
w,h = dims.split('x').map(&:to_i)
|
36
|
-
img =
|
37
|
+
img = Object.new
|
38
|
+
allow(img).to receive_messages(:width => w, :height => h)
|
37
39
|
adam7 = ZPNG::Adam7Decoder.new(img)
|
38
40
|
adam7.scanlines_count.should == n
|
39
41
|
end
|
@@ -52,7 +54,8 @@ describe ZPNG::Adam7Decoder do
|
|
52
54
|
}.each do |dims, pst|
|
53
55
|
it "should be right for #{dims} image" do
|
54
56
|
w,h = dims.split('x').map(&:to_i)
|
55
|
-
img =
|
57
|
+
img = Object.new
|
58
|
+
allow(img).to receive_messages(:width => w, :height => h)
|
56
59
|
adam7 = ZPNG::Adam7Decoder.new(img)
|
57
60
|
adam7.instance_variable_get("@pass_starts").should == pst
|
58
61
|
end
|
data/spec/create_image_spec.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
2
2
|
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
3
3
|
require 'rspec'
|
4
|
+
require 'rspec/its'
|
4
5
|
require 'zpng'
|
5
6
|
|
6
7
|
# Requires supporting files with custom matchers and macros, etc,
|
@@ -33,6 +34,7 @@ end
|
|
33
34
|
PNGSuite.init( File.join(SAMPLES_DIR, "png_suite") )
|
34
35
|
|
35
36
|
RSpec.configure do |config|
|
37
|
+
config.expect_with(:rspec) { |c| c.syntax = :should }
|
36
38
|
config.before :suite do
|
37
39
|
end
|
38
40
|
end
|
data/spec/support/png_suite.rb
CHANGED
data/zpng.gemspec
CHANGED
@@ -2,16 +2,18 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
+
# stub: zpng 0.3.3 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name = "zpng"
|
8
|
-
s.version = "0.
|
8
|
+
s.name = "zpng".freeze
|
9
|
+
s.version = "0.3.3"
|
9
10
|
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.
|
14
|
-
s.
|
11
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
|
+
s.require_paths = ["lib".freeze]
|
13
|
+
s.authors = ["Andrey \"Zed\" Zaikin".freeze]
|
14
|
+
s.date = "2021-12-07"
|
15
|
+
s.email = "zed.0xff@gmail.com".freeze
|
16
|
+
s.executables = ["zpng".freeze]
|
15
17
|
s.extra_rdoc_files = [
|
16
18
|
"LICENSE.txt",
|
17
19
|
"README.md",
|
@@ -90,34 +92,29 @@ Gem::Specification.new do |s|
|
|
90
92
|
"spec/support/png_suite.rb",
|
91
93
|
"zpng.gemspec"
|
92
94
|
]
|
93
|
-
s.homepage = "http://github.com/zed-0xff/zpng"
|
94
|
-
s.licenses = ["MIT"]
|
95
|
-
s.
|
96
|
-
s.
|
97
|
-
s.summary = "pure ruby PNG file manipulation & validation"
|
95
|
+
s.homepage = "http://github.com/zed-0xff/zpng".freeze
|
96
|
+
s.licenses = ["MIT".freeze]
|
97
|
+
s.rubygems_version = "3.2.22".freeze
|
98
|
+
s.summary = "pure ruby PNG file manipulation & validation".freeze
|
98
99
|
|
99
100
|
if s.respond_to? :specification_version then
|
100
101
|
s.specification_version = 4
|
102
|
+
end
|
101
103
|
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
s.add_dependency(%q<rainbow>, [">= 0"])
|
110
|
-
s.add_dependency(%q<rspec>, [">= 2.8.0"])
|
111
|
-
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
112
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
113
|
-
s.add_dependency(%q<what_methods>, [">= 0"])
|
114
|
-
end
|
104
|
+
if s.respond_to? :add_runtime_dependency then
|
105
|
+
s.add_runtime_dependency(%q<rainbow>.freeze, [">= 0"])
|
106
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
107
|
+
s.add_development_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
108
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 2.2.3"])
|
109
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
110
|
+
s.add_development_dependency(%q<what_methods>.freeze, [">= 0"])
|
115
111
|
else
|
116
|
-
s.add_dependency(%q<rainbow
|
117
|
-
s.add_dependency(%q<rspec
|
118
|
-
s.add_dependency(%q<
|
119
|
-
s.add_dependency(%q<
|
120
|
-
s.add_dependency(%q<
|
112
|
+
s.add_dependency(%q<rainbow>.freeze, [">= 0"])
|
113
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
114
|
+
s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
115
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 2.2.3"])
|
116
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
117
|
+
s.add_dependency(%q<what_methods>.freeze, [">= 0"])
|
121
118
|
end
|
122
119
|
end
|
123
120
|
|
metadata
CHANGED
@@ -1,86 +1,100 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zpng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey "Zed" Zaikin
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 3.9.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 3.9.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-its
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 1.3.0
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 1.3.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
44
58
|
requirements:
|
45
|
-
- -
|
59
|
+
- - "~>"
|
46
60
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
61
|
+
version: 2.2.3
|
48
62
|
type: :development
|
49
63
|
prerelease: false
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
51
65
|
requirements:
|
52
|
-
- -
|
66
|
+
- - "~>"
|
53
67
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
68
|
+
version: 2.2.3
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: jeweler
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
58
72
|
requirements:
|
59
|
-
- - ~>
|
73
|
+
- - "~>"
|
60
74
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
75
|
+
version: 2.3.9
|
62
76
|
type: :development
|
63
77
|
prerelease: false
|
64
78
|
version_requirements: !ruby/object:Gem::Requirement
|
65
79
|
requirements:
|
66
|
-
- - ~>
|
80
|
+
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
82
|
+
version: 2.3.9
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: what_methods
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- -
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
89
|
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- -
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
96
|
version: '0'
|
83
|
-
description:
|
97
|
+
description:
|
84
98
|
email: zed.0xff@gmail.com
|
85
99
|
executables:
|
86
100
|
- zpng
|
@@ -91,8 +105,8 @@ extra_rdoc_files:
|
|
91
105
|
- README.md.tpl
|
92
106
|
- TODO
|
93
107
|
files:
|
94
|
-
- .document
|
95
|
-
- .rspec
|
108
|
+
- ".document"
|
109
|
+
- ".rspec"
|
96
110
|
- Gemfile
|
97
111
|
- Gemfile.lock
|
98
112
|
- LICENSE.txt
|
@@ -165,24 +179,23 @@ homepage: http://github.com/zed-0xff/zpng
|
|
165
179
|
licenses:
|
166
180
|
- MIT
|
167
181
|
metadata: {}
|
168
|
-
post_install_message:
|
182
|
+
post_install_message:
|
169
183
|
rdoc_options: []
|
170
184
|
require_paths:
|
171
185
|
- lib
|
172
186
|
required_ruby_version: !ruby/object:Gem::Requirement
|
173
187
|
requirements:
|
174
|
-
- -
|
188
|
+
- - ">="
|
175
189
|
- !ruby/object:Gem::Version
|
176
190
|
version: '0'
|
177
191
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
178
192
|
requirements:
|
179
|
-
- -
|
193
|
+
- - ">="
|
180
194
|
- !ruby/object:Gem::Version
|
181
195
|
version: '0'
|
182
196
|
requirements: []
|
183
|
-
|
184
|
-
|
185
|
-
signing_key:
|
197
|
+
rubygems_version: 3.2.22
|
198
|
+
signing_key:
|
186
199
|
specification_version: 4
|
187
200
|
summary: pure ruby PNG file manipulation & validation
|
188
201
|
test_files: []
|