zpng 0.2.5 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Gemfile +5 -4
- data/Gemfile.lock +67 -50
- 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/zpng.gemspec +31 -27
- metadata +39 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3aa4c130704a0f1fafe4df8b5e1cd5eb8a32b0dca30c049bf131dc60230fba2e
|
4
|
+
data.tar.gz: 2b7ba7fcfc9e947c74d7dbf59b6f59074353790f55ba20a523e5baf0ff56ace9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9525556c93cc09198a83a825ed25631a6c721227c3b01666dd3f2f2e46457ecf47713b70f64d4e1f02abe4b3ca89d327002d09e616801e204bf8e585a1a14131
|
7
|
+
data.tar.gz: a7e1d8e46704ea176b89728f6c53e441016e6926b47e9d4dda653d60c103bbe2a8dd1877cd86e6c8e567669c86e19c7d1df103e627828f32afa0a0693706c0b8
|
data/Gemfile
CHANGED
@@ -2,13 +2,14 @@ source "http://rubygems.org"
|
|
2
2
|
# Add dependencies required to use your gem here.
|
3
3
|
# Example:
|
4
4
|
# gem "activesupport", ">= 2.3.5"
|
5
|
-
gem 'rainbow'
|
5
|
+
gem 'rainbow', "~> 2.0.0"
|
6
6
|
|
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.1.4"
|
13
|
+
gem "jeweler", "~> 2.3.9"
|
13
14
|
gem "what_methods"
|
14
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,66 +1,83 @@
|
|
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.3)
|
9
|
+
faraday (0.9.2)
|
10
|
+
multipart-post (>= 1.2, < 3)
|
11
|
+
git (1.5.0)
|
12
|
+
github_api (0.16.0)
|
13
|
+
addressable (~> 2.4.0)
|
14
|
+
descendants_tracker (~> 0.0.4)
|
15
|
+
faraday (~> 0.8, < 0.10)
|
16
|
+
hashie (>= 3.4)
|
17
|
+
mime-types (>= 1.16, < 3.0)
|
18
|
+
oauth2 (~> 1.0)
|
19
|
+
hashie (4.0.0)
|
20
|
+
highline (2.0.3)
|
21
|
+
jeweler (2.3.9)
|
21
22
|
builder
|
22
|
-
bundler
|
23
|
+
bundler
|
23
24
|
git (>= 1.2.5)
|
24
|
-
github_api (
|
25
|
+
github_api (~> 0.16.0)
|
25
26
|
highline (>= 1.6.15)
|
26
|
-
nokogiri (
|
27
|
+
nokogiri (>= 1.5.10)
|
28
|
+
psych
|
27
29
|
rake
|
28
30
|
rdoc
|
29
|
-
|
30
|
-
jwt (
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
31
|
+
semver2
|
32
|
+
jwt (2.2.1)
|
33
|
+
mime-types (2.99.3)
|
34
|
+
mini_portile2 (2.4.0)
|
35
|
+
multi_json (1.14.1)
|
36
|
+
multi_xml (0.6.0)
|
37
|
+
multipart-post (2.1.1)
|
38
|
+
nokogiri (1.10.7)
|
39
|
+
mini_portile2 (~> 2.4.0)
|
40
|
+
oauth2 (1.4.2)
|
41
|
+
faraday (>= 0.8, < 2.0)
|
42
|
+
jwt (>= 1.0, < 3.0)
|
43
|
+
multi_json (~> 1.3)
|
41
44
|
multi_xml (~> 0.5)
|
42
|
-
rack (
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
rspec (
|
49
|
-
rspec-core (~>
|
50
|
-
rspec-expectations (~>
|
51
|
-
rspec-mocks (~>
|
52
|
-
rspec-core (
|
53
|
-
|
54
|
-
|
55
|
-
|
45
|
+
rack (>= 1.2, < 3)
|
46
|
+
psych (3.1.0)
|
47
|
+
rack (2.1.1)
|
48
|
+
rainbow (2.0.0)
|
49
|
+
rake (13.0.1)
|
50
|
+
rdoc (6.2.1)
|
51
|
+
rspec (3.9.0)
|
52
|
+
rspec-core (~> 3.9.0)
|
53
|
+
rspec-expectations (~> 3.9.0)
|
54
|
+
rspec-mocks (~> 3.9.0)
|
55
|
+
rspec-core (3.9.1)
|
56
|
+
rspec-support (~> 3.9.1)
|
57
|
+
rspec-expectations (3.9.0)
|
58
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
59
|
+
rspec-support (~> 3.9.0)
|
60
|
+
rspec-its (1.3.0)
|
61
|
+
rspec-core (>= 3.0.0)
|
62
|
+
rspec-expectations (>= 3.0.0)
|
63
|
+
rspec-mocks (3.9.1)
|
64
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
+
rspec-support (~> 3.9.0)
|
66
|
+
rspec-support (3.9.2)
|
67
|
+
semver2 (3.4.2)
|
68
|
+
thread_safe (0.3.6)
|
56
69
|
what_methods (1.0.1)
|
57
70
|
|
58
71
|
PLATFORMS
|
59
72
|
ruby
|
60
73
|
|
61
74
|
DEPENDENCIES
|
62
|
-
bundler (
|
63
|
-
jeweler (~>
|
64
|
-
rainbow
|
65
|
-
rspec (
|
75
|
+
bundler (~> 2.1.4)
|
76
|
+
jeweler (~> 2.3.9)
|
77
|
+
rainbow (~> 2.0.0)
|
78
|
+
rspec (~> 3.9.0)
|
79
|
+
rspec-its (~> 1.3.0)
|
66
80
|
what_methods
|
81
|
+
|
82
|
+
BUNDLED WITH
|
83
|
+
2.1.4
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
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/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.0 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.0"
|
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 = "2020-01-14"
|
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,36 @@ 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 = "2.7.6".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
|
101
102
|
|
102
103
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
103
|
-
s.add_runtime_dependency(%q<rainbow
|
104
|
-
s.add_development_dependency(%q<rspec
|
105
|
-
s.add_development_dependency(%q<
|
106
|
-
s.add_development_dependency(%q<
|
107
|
-
s.add_development_dependency(%q<
|
104
|
+
s.add_runtime_dependency(%q<rainbow>.freeze, ["~> 2.0.0"])
|
105
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
106
|
+
s.add_development_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
107
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 2.1.4"])
|
108
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
109
|
+
s.add_development_dependency(%q<what_methods>.freeze, [">= 0"])
|
108
110
|
else
|
109
|
-
s.add_dependency(%q<rainbow
|
110
|
-
s.add_dependency(%q<rspec
|
111
|
-
s.add_dependency(%q<
|
112
|
-
s.add_dependency(%q<
|
113
|
-
s.add_dependency(%q<
|
111
|
+
s.add_dependency(%q<rainbow>.freeze, ["~> 2.0.0"])
|
112
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
113
|
+
s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
114
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 2.1.4"])
|
115
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
116
|
+
s.add_dependency(%q<what_methods>.freeze, [">= 0"])
|
114
117
|
end
|
115
118
|
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<
|
119
|
+
s.add_dependency(%q<rainbow>.freeze, ["~> 2.0.0"])
|
120
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
121
|
+
s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
122
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 2.1.4"])
|
123
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
124
|
+
s.add_dependency(%q<what_methods>.freeze, [">= 0"])
|
121
125
|
end
|
122
126
|
end
|
123
127
|
|
metadata
CHANGED
@@ -1,83 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zpng
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey "Zed" Zaikin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-14 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
|
-
version:
|
19
|
+
version: 2.0.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
|
-
version:
|
26
|
+
version: 2.0.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 3.9.0
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.9.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec-its
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
47
|
+
version: 1.3.0
|
34
48
|
type: :development
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
|
-
- -
|
52
|
+
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
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: 1.
|
61
|
+
version: 2.1.4
|
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: 1.
|
68
|
+
version: 2.1.4
|
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
97
|
description:
|
@@ -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
|
@@ -171,17 +185,17 @@ 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
197
|
rubyforge_project:
|
184
|
-
rubygems_version: 2.
|
198
|
+
rubygems_version: 2.7.6
|
185
199
|
signing_key:
|
186
200
|
specification_version: 4
|
187
201
|
summary: pure ruby PNG file manipulation & validation
|