sugar_png 0.4.1 → 0.5.3
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 +72 -48
- data/VERSION +1 -1
- data/samples/damaged_signature.png +0 -0
- data/spec/magic/pixels_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- data/spec/sugar_png/datastream_spec.rb +1 -1
- data/spec/support/png_suite.rb +4 -3
- data/sugar_png.gemspec +27 -29
- metadata +44 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 26b93aae2b1d1cbe9fb4b9bfebd3e6d3e482e1a1829b2b1b45f8b198b9d6d470
|
4
|
+
data.tar.gz: 5a5be0f173111eec5885664c7b9c181afa169f30d70e851b499cd2244cd1f9e9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f40c59329db021cc4987fe1dfe052b2da058a946857191b93068730518a05f0345628dfccb31f8f47191a6f7f974abeaa801826f2ca670b66e6ac4c53be213d5
|
7
|
+
data.tar.gz: 530447b48e06b71ba00cd2b9d10d627ba87233b98d4bbe055614dbc171e59bafdcfd3e2e8f3cbd9eae6f8106678d02a1b659cee3aaed3a40c5f2e2057aaf0408
|
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 'zpng', ">= 0.
|
5
|
+
gem 'zpng', ">= 0.3.3"
|
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.2.3"
|
13
|
+
gem "jeweler", "~> 2.3.9"
|
13
14
|
gem "awesome_print"
|
14
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,57 +1,77 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.
|
5
|
-
awesome_print (1.
|
6
|
-
builder (3.2.
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
addressable (2.4.0)
|
5
|
+
awesome_print (1.8.0)
|
6
|
+
builder (3.2.4)
|
7
|
+
descendants_tracker (0.0.4)
|
8
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
9
|
+
diff-lcs (1.4.4)
|
10
|
+
faraday (0.9.2)
|
11
|
+
multipart-post (>= 1.2, < 3)
|
12
|
+
git (1.8.1)
|
13
|
+
rchardet (~> 1.8)
|
14
|
+
github_api (0.16.0)
|
15
|
+
addressable (~> 2.4.0)
|
16
|
+
descendants_tracker (~> 0.0.4)
|
17
|
+
faraday (~> 0.8, < 0.10)
|
18
|
+
hashie (>= 3.4)
|
19
|
+
mime-types (>= 1.16, < 3.0)
|
20
|
+
oauth2 (~> 1.0)
|
21
|
+
hashie (4.1.0)
|
22
|
+
highline (2.0.3)
|
23
|
+
jeweler (2.3.9)
|
21
24
|
builder
|
22
|
-
bundler
|
25
|
+
bundler
|
23
26
|
git (>= 1.2.5)
|
24
|
-
github_api (
|
27
|
+
github_api (~> 0.16.0)
|
25
28
|
highline (>= 1.6.15)
|
26
|
-
nokogiri (
|
29
|
+
nokogiri (>= 1.5.10)
|
30
|
+
psych
|
27
31
|
rake
|
28
32
|
rdoc
|
29
|
-
|
30
|
-
jwt (
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
semver2
|
34
|
+
jwt (2.2.2)
|
35
|
+
mime-types (2.99.3)
|
36
|
+
mini_portile2 (2.6.1)
|
37
|
+
multi_json (1.15.0)
|
38
|
+
multi_xml (0.6.0)
|
39
|
+
multipart-post (2.1.1)
|
40
|
+
nokogiri (1.12.5)
|
41
|
+
mini_portile2 (~> 2.6.1)
|
42
|
+
racc (~> 1.4)
|
43
|
+
oauth2 (1.4.4)
|
44
|
+
faraday (>= 0.8, < 2.0)
|
45
|
+
jwt (>= 1.0, < 3.0)
|
38
46
|
multi_json (~> 1.3)
|
39
47
|
multi_xml (~> 0.5)
|
40
|
-
rack (
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
rspec-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
48
|
+
rack (>= 1.2, < 3)
|
49
|
+
psych (3.3.0)
|
50
|
+
racc (1.5.2)
|
51
|
+
rack (2.2.3)
|
52
|
+
rainbow (3.0.0)
|
53
|
+
rake (13.0.3)
|
54
|
+
rchardet (1.8.0)
|
55
|
+
rdoc (6.3.2)
|
56
|
+
rspec (3.9.0)
|
57
|
+
rspec-core (~> 3.9.0)
|
58
|
+
rspec-expectations (~> 3.9.0)
|
59
|
+
rspec-mocks (~> 3.9.0)
|
60
|
+
rspec-core (3.9.3)
|
61
|
+
rspec-support (~> 3.9.3)
|
62
|
+
rspec-expectations (3.9.4)
|
63
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
64
|
+
rspec-support (~> 3.9.0)
|
65
|
+
rspec-its (1.3.0)
|
66
|
+
rspec-core (>= 3.0.0)
|
67
|
+
rspec-expectations (>= 3.0.0)
|
68
|
+
rspec-mocks (3.9.1)
|
69
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
+
rspec-support (~> 3.9.0)
|
71
|
+
rspec-support (3.9.4)
|
72
|
+
semver2 (3.4.2)
|
73
|
+
thread_safe (0.3.6)
|
74
|
+
zpng (0.3.3)
|
55
75
|
rainbow
|
56
76
|
|
57
77
|
PLATFORMS
|
@@ -59,7 +79,11 @@ PLATFORMS
|
|
59
79
|
|
60
80
|
DEPENDENCIES
|
61
81
|
awesome_print
|
62
|
-
bundler (
|
63
|
-
jeweler (~>
|
64
|
-
rspec (
|
65
|
-
|
82
|
+
bundler (~> 2.2.3)
|
83
|
+
jeweler (~> 2.3.9)
|
84
|
+
rspec (~> 3.9.0)
|
85
|
+
rspec-its (~> 1.3.0)
|
86
|
+
zpng (>= 0.3.3)
|
87
|
+
|
88
|
+
BUNDLED WITH
|
89
|
+
2.2.22
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.3
|
Binary file
|
data/spec/magic/pixels_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 'sugar_png'
|
5
6
|
require 'awesome_print'
|
6
7
|
|
@@ -60,6 +61,7 @@ module ResourceFileHelper
|
|
60
61
|
end
|
61
62
|
|
62
63
|
RSpec.configure do |config|
|
64
|
+
config.expect_with(:rspec) { |c| c.syntax = [:should, :expect] }
|
63
65
|
config.extend PNGSuite
|
64
66
|
config.include PNGSuite
|
65
67
|
config.include ResourceFileHelper
|
@@ -5,7 +5,7 @@ describe SugarPNG::Datastream do
|
|
5
5
|
describe '.from_io'do
|
6
6
|
it "should raise an error when loading a file with a bad signature" do
|
7
7
|
filename = resource_file('damaged_signature.png')
|
8
|
-
lambda { SugarPNG::Datastream.from_file(filename) }.should raise_error
|
8
|
+
lambda { SugarPNG::Datastream.from_file(filename) }.should raise_error(ZPNG::NotSupported)
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should NOT raise an error if the CRC of a chunk is incorrect" do
|
data/spec/support/png_suite.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
#coding: binary
|
1
2
|
module PNGSuite
|
2
3
|
PNG_SUITE_URL = "http://www.schaik.com/pngsuite/PngSuite-2011apr25.tgz"
|
3
4
|
|
@@ -16,12 +17,12 @@ module PNGSuite
|
|
16
17
|
end
|
17
18
|
require 'open-uri'
|
18
19
|
puts "[.] fetching PNG test-suite from #{PNG_SUITE_URL} .. "
|
19
|
-
data = open(PNG_SUITE_URL).read
|
20
|
+
data = URI.open(PNG_SUITE_URL).read
|
20
21
|
|
21
22
|
fname = File.join(dir, "png_suite.tgz")
|
22
23
|
File.open(fname, "wb"){ |f| f<<data }
|
23
|
-
puts "[.] unpacking .. "
|
24
|
-
system "tar", "
|
24
|
+
puts "[.] unpacking #{fname} .. "
|
25
|
+
system "tar", "xf", fname, "-C", dir
|
25
26
|
end
|
26
27
|
|
27
28
|
def each *prefixes
|
data/sugar_png.gemspec
CHANGED
@@ -2,15 +2,17 @@
|
|
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: sugar_png 0.5.3 ruby lib
|
5
6
|
|
6
7
|
Gem::Specification.new do |s|
|
7
|
-
s.name = "sugar_png"
|
8
|
-
s.version = "0.
|
8
|
+
s.name = "sugar_png".freeze
|
9
|
+
s.version = "0.5.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.
|
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
|
14
16
|
s.extra_rdoc_files = [
|
15
17
|
"LICENSE.txt",
|
16
18
|
"README.md",
|
@@ -261,6 +263,7 @@ Gem::Specification.new do |s|
|
|
261
263
|
"lib/sugar_png/glyph.rb",
|
262
264
|
"lib/sugar_png/image.rb",
|
263
265
|
"samples/damaged_chunk.png",
|
266
|
+
"samples/damaged_signature.png",
|
264
267
|
"samples/png_suite/f00n0g08_reference.png",
|
265
268
|
"samples/png_suite/f00n2c08_reference.png",
|
266
269
|
"samples/png_suite/f01n0g08_reference.png",
|
@@ -293,34 +296,29 @@ Gem::Specification.new do |s|
|
|
293
296
|
"spec/support/png_suite.rb",
|
294
297
|
"sugar_png.gemspec"
|
295
298
|
]
|
296
|
-
s.homepage = "http://github.com/zed-0xff/sugar_png"
|
297
|
-
s.licenses = ["MIT"]
|
298
|
-
s.
|
299
|
-
s.
|
300
|
-
s.summary = "a syntax sugar of PNG manipulation"
|
299
|
+
s.homepage = "http://github.com/zed-0xff/sugar_png".freeze
|
300
|
+
s.licenses = ["MIT".freeze]
|
301
|
+
s.rubygems_version = "3.2.22".freeze
|
302
|
+
s.summary = "a syntax sugar of PNG manipulation".freeze
|
301
303
|
|
302
304
|
if s.respond_to? :specification_version then
|
303
305
|
s.specification_version = 4
|
306
|
+
end
|
304
307
|
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
s.add_dependency(%q<zpng>, [">= 0.2.5"])
|
313
|
-
s.add_dependency(%q<rspec>, [">= 2.8.0"])
|
314
|
-
s.add_dependency(%q<bundler>, [">= 1.0.0"])
|
315
|
-
s.add_dependency(%q<jeweler>, ["~> 1.8.4"])
|
316
|
-
s.add_dependency(%q<awesome_print>, [">= 0"])
|
317
|
-
end
|
308
|
+
if s.respond_to? :add_runtime_dependency then
|
309
|
+
s.add_runtime_dependency(%q<zpng>.freeze, [">= 0.3.3"])
|
310
|
+
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
311
|
+
s.add_development_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
312
|
+
s.add_development_dependency(%q<bundler>.freeze, ["~> 2.2.3"])
|
313
|
+
s.add_development_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
314
|
+
s.add_development_dependency(%q<awesome_print>.freeze, [">= 0"])
|
318
315
|
else
|
319
|
-
s.add_dependency(%q<zpng
|
320
|
-
s.add_dependency(%q<rspec
|
321
|
-
s.add_dependency(%q<
|
322
|
-
s.add_dependency(%q<
|
323
|
-
s.add_dependency(%q<
|
316
|
+
s.add_dependency(%q<zpng>.freeze, [">= 0.3.3"])
|
317
|
+
s.add_dependency(%q<rspec>.freeze, ["~> 3.9.0"])
|
318
|
+
s.add_dependency(%q<rspec-its>.freeze, ["~> 1.3.0"])
|
319
|
+
s.add_dependency(%q<bundler>.freeze, ["~> 2.2.3"])
|
320
|
+
s.add_dependency(%q<jeweler>.freeze, ["~> 2.3.9"])
|
321
|
+
s.add_dependency(%q<awesome_print>.freeze, [">= 0"])
|
324
322
|
end
|
325
323
|
end
|
326
324
|
|
metadata
CHANGED
@@ -1,86 +1,100 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sugar_png
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.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: zpng
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.3.3
|
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: 0.
|
26
|
+
version: 0.3.3
|
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: awesome_print
|
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
|
extensions: []
|
@@ -89,8 +103,8 @@ extra_rdoc_files:
|
|
89
103
|
- README.md
|
90
104
|
- README.md.tpl
|
91
105
|
files:
|
92
|
-
- .document
|
93
|
-
- .rspec
|
106
|
+
- ".document"
|
107
|
+
- ".rspec"
|
94
108
|
- Gemfile
|
95
109
|
- Gemfile.lock
|
96
110
|
- LICENSE.txt
|
@@ -333,6 +347,7 @@ files:
|
|
333
347
|
- lib/sugar_png/glyph.rb
|
334
348
|
- lib/sugar_png/image.rb
|
335
349
|
- samples/damaged_chunk.png
|
350
|
+
- samples/damaged_signature.png
|
336
351
|
- samples/png_suite/f00n0g08_reference.png
|
337
352
|
- samples/png_suite/f00n2c08_reference.png
|
338
353
|
- samples/png_suite/f01n0g08_reference.png
|
@@ -368,24 +383,23 @@ homepage: http://github.com/zed-0xff/sugar_png
|
|
368
383
|
licenses:
|
369
384
|
- MIT
|
370
385
|
metadata: {}
|
371
|
-
post_install_message:
|
386
|
+
post_install_message:
|
372
387
|
rdoc_options: []
|
373
388
|
require_paths:
|
374
389
|
- lib
|
375
390
|
required_ruby_version: !ruby/object:Gem::Requirement
|
376
391
|
requirements:
|
377
|
-
- -
|
392
|
+
- - ">="
|
378
393
|
- !ruby/object:Gem::Version
|
379
394
|
version: '0'
|
380
395
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
381
396
|
requirements:
|
382
|
-
- -
|
397
|
+
- - ">="
|
383
398
|
- !ruby/object:Gem::Version
|
384
399
|
version: '0'
|
385
400
|
requirements: []
|
386
|
-
|
387
|
-
|
388
|
-
signing_key:
|
401
|
+
rubygems_version: 3.2.22
|
402
|
+
signing_key:
|
389
403
|
specification_version: 4
|
390
404
|
summary: a syntax sugar of PNG manipulation
|
391
405
|
test_files: []
|