pnm 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/Rakefile +1 -1
- data/benchmark/bm_converter.rb +1 -1
- data/lib/pnm.rb +2 -2
- data/lib/pnm/image.rb +5 -5
- data/lib/pnm/version.rb +2 -2
- data/pnm.gemspec +2 -2
- data/test/test_converter.rb +1 -1
- data/test/test_exceptions.rb +2 -2
- data/test/test_image.rb +1 -1
- data/test/test_parser.rb +1 -1
- data/test/test_pnm.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc9dad70777226b16da4d7039a1321372519e048
|
4
|
+
data.tar.gz: 0e7d6f07393f439bc0a644aa8fb54e147142ec2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3445e084ae5d392516e8a169e1b5f2340537447fce806969cf5e1c3ff882b9c140b0bb592a57106fd277e289e3f3bbba40b8f13868637b6cd73e3d42f39440dc
|
7
|
+
data.tar.gz: 051ead6ff5724ce49cc21bf66c9087cc5a60c10a94edac62907a700b29f13829f92b1d3a3413c78c8dbfc03b3e63c0deb17b20165b988ed959f2573dee384709
|
data/README.md
CHANGED
@@ -98,6 +98,8 @@ Requirements
|
|
98
98
|
|
99
99
|
- PNM has been tested with
|
100
100
|
|
101
|
+
- Ruby 2.4,
|
102
|
+
- Ruby 2.3,
|
101
103
|
- Ruby 2.2,
|
102
104
|
- Ruby 2.1,
|
103
105
|
- Ruby 2.0.0,
|
@@ -119,7 +121,7 @@ Report bugs on the PNM home page: <https://github.com/stomar/pnm/>
|
|
119
121
|
License
|
120
122
|
-------
|
121
123
|
|
122
|
-
Copyright © 2013-
|
124
|
+
Copyright © 2013-2016 Marcus Stollsteimer
|
123
125
|
|
124
126
|
`PNM` is free software: you can redistribute it and/or modify
|
125
127
|
it under the terms of the GNU General Public License version 3 or later (GPLv3+),
|
data/Rakefile
CHANGED
data/benchmark/bm_converter.rb
CHANGED
data/lib/pnm.rb
CHANGED
@@ -85,7 +85,7 @@ require_relative 'pnm/exceptions'
|
|
85
85
|
#
|
86
86
|
# == Author
|
87
87
|
#
|
88
|
-
# Copyright (C) 2013-
|
88
|
+
# Copyright (C) 2013-2016 Marcus Stollsteimer
|
89
89
|
#
|
90
90
|
# License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
|
91
91
|
#
|
@@ -96,7 +96,7 @@ module PNM
|
|
96
96
|
TAGLINE = 'create/read/write PNM image files (PBM, PGM, PPM)'
|
97
97
|
|
98
98
|
COPYRIGHT = <<-copyright.gsub(/^ +/, '')
|
99
|
-
Copyright (C) 2013-
|
99
|
+
Copyright (C) 2013-2016 Marcus Stollsteimer.
|
100
100
|
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
|
101
101
|
This is free software: you are free to change and redistribute it.
|
102
102
|
There is NO WARRANTY, to the extent permitted by law.
|
data/lib/pnm/image.rb
CHANGED
@@ -166,16 +166,16 @@ module PNM
|
|
166
166
|
end
|
167
167
|
|
168
168
|
def self.assert_valid_pixel(pixel) # :nodoc:
|
169
|
-
unless
|
170
|
-
msg = "invalid pixel value:
|
169
|
+
unless Integer === pixel
|
170
|
+
msg = "invalid pixel value: Integer expected - #{pixel.inspect}"
|
171
171
|
raise PNM::DataError, msg
|
172
172
|
end
|
173
173
|
end
|
174
174
|
|
175
175
|
def self.assert_valid_color_pixel(pixel) # :nodoc:
|
176
|
-
unless Array === pixel && pixel.map
|
176
|
+
unless Array === pixel && pixel.map {|p| Integer === p } == [true, true, true]
|
177
177
|
msg = "invalid pixel value: "
|
178
|
-
msg << "Array of 3
|
178
|
+
msg << "Array of 3 Integers expected - #{pixel.inspect}"
|
179
179
|
|
180
180
|
raise PNM::DataError, msg
|
181
181
|
end
|
@@ -184,7 +184,7 @@ module PNM
|
|
184
184
|
def self.assert_valid_maxgray(maxgray) # :nodoc:
|
185
185
|
return unless maxgray
|
186
186
|
|
187
|
-
unless
|
187
|
+
unless Integer === maxgray && maxgray > 0 && maxgray <= 255
|
188
188
|
raise PNM::ArgumentError, "invalid maxgray value - #{maxgray.inspect}"
|
189
189
|
end
|
190
190
|
end
|
data/lib/pnm/version.rb
CHANGED
data/pnm.gemspec
CHANGED
@@ -21,14 +21,14 @@ Gem::Specification.new do |s|
|
|
21
21
|
s.email = 'sto.mar@web.de'
|
22
22
|
s.homepage = homepage
|
23
23
|
|
24
|
-
s.license = 'GPL-3'
|
24
|
+
s.license = 'GPL-3.0'
|
25
25
|
|
26
26
|
s.required_ruby_version = '>= 1.9.3'
|
27
27
|
|
28
28
|
s.add_development_dependency 'rake', '>= 10.0'
|
29
29
|
s.add_development_dependency 'minitest', '>= 5.0'
|
30
30
|
|
31
|
-
s.
|
31
|
+
s.require_paths = ['lib']
|
32
32
|
|
33
33
|
s.test_files = Dir.glob('test/**/test_*.rb')
|
34
34
|
|
data/test/test_converter.rb
CHANGED
data/test/test_exceptions.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# test_exceptions.rb: Unit tests for the PNM library.
|
2
2
|
#
|
3
|
-
# Copyright (C) 2013-
|
3
|
+
# Copyright (C) 2013-2016 Marcus Stollsteimer
|
4
4
|
|
5
5
|
require 'minitest/autorun'
|
6
6
|
require 'stringio'
|
@@ -34,7 +34,7 @@ describe 'PNM.create' do
|
|
34
34
|
lambda { PNM.create(data, :maxgray => 0) }.must_raise PNM::ArgumentError
|
35
35
|
end
|
36
36
|
|
37
|
-
it 'raises an exception for invalid comment (
|
37
|
+
it 'raises an exception for invalid comment (Integer)' do
|
38
38
|
data = [[0, 0], [0, 0]]
|
39
39
|
lambda { PNM.create(data, :comment => 1) }.must_raise PNM::ArgumentError
|
40
40
|
end
|
data/test/test_image.rb
CHANGED
data/test/test_parser.rb
CHANGED
data/test/test_pnm.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pnm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcus Stollsteimer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -76,7 +76,7 @@ files:
|
|
76
76
|
- test/test_pnm.rb
|
77
77
|
homepage: https://github.com/stomar/pnm
|
78
78
|
licenses:
|
79
|
-
- GPL-3
|
79
|
+
- GPL-3.0
|
80
80
|
metadata: {}
|
81
81
|
post_install_message:
|
82
82
|
rdoc_options:
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.5.2
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: PNM - create/read/write PNM image files (PBM, PGM, PPM)
|