ptools 1.3.4 → 1.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +5 -0
- data/MANIFEST +1 -0
- data/certs/djberg96_pub.pem +15 -15
- data/lib/ptools.rb +9 -5
- data/ptools.gemspec +1 -1
- data/test/img/test.ico +0 -0
- data/test/test_constants.rb +1 -1
- data/test/test_image.rb +5 -0
- metadata +18 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d84987b222f9b080bd61559d152790acfc5c17c9
|
4
|
+
data.tar.gz: 05f9fbe563ca0e70cdbe4983a43e0ae1132c8ee9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd49ca3dee0986e8f9d287de7fbfcad81492858b556a678692ff3510fd5400928b44b84b8fb701d13c40b3f34953ca213c849709f0c8666aacad6a8b2001314e
|
7
|
+
data.tar.gz: b0d5eb2e3b457c4d9ff23866b385e209c46e8f8b394ba0c29d45520b906b09173fb14dbdc436f344f8e65b7236b842277a9ba61d1f28dc746c36b5f6f8c891ad
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
== 1.3.5 - 3-Sep-2017
|
2
|
+
* The File.image? method now checks against .ico files.
|
3
|
+
* Eliminated Fixnum warning that showed up in Ruby 2.4.x.
|
4
|
+
* Updated cert.
|
5
|
+
|
1
6
|
== 1.3.4 - 4-Jul-2017
|
2
7
|
* The File.binary? method now lets you set your own percentage for the
|
3
8
|
internal heuristic as an optional second argument.
|
data/MANIFEST
CHANGED
data/certs/djberg96_pub.pem
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|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|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
15
|
+
ggEBAJh/dmRaTpJAUeJ2x9CEyy9gSP6SZjMeAwWgPNdowPDyw0JzlpBIrYiTnCYK
|
16
|
+
2OqxvIi8L38+rHw3KYL0fEyNqP3RbMl6+SljRwiU0JwEqj9e1pqIx99RTLKeI9PM
|
17
|
+
F8LxxmDHreGOaY4R8JBOMxys1wBkF/Iilx4qoT4LBn+DzraAlmYjr6O6itIxGten
|
18
|
+
NFJFS/tFBTTeNW6SJLdDnGd2b7vBBEd/ZpIhuZNxriU6FKWC5FJeBdAiuw6lqHun
|
19
|
+
QLLepVJthIvwmfc8AU5TJGMawtVAUHIWiuQPoBBVVKOkeEhioO0cV8UabKsKMbE8
|
20
|
+
VpiARrgH+4lYiRFJ+gKpIbSEJvk=
|
21
21
|
-----END CERTIFICATE-----
|
data/lib/ptools.rb
CHANGED
@@ -3,7 +3,7 @@ require 'win32/file' if File::ALT_SEPARATOR
|
|
3
3
|
|
4
4
|
class File
|
5
5
|
# The version of the ptools library.
|
6
|
-
PTOOLS_VERSION = '1.3.
|
6
|
+
PTOOLS_VERSION = '1.3.5'.freeze
|
7
7
|
|
8
8
|
# :stopdoc:
|
9
9
|
|
@@ -23,8 +23,8 @@ class File
|
|
23
23
|
|
24
24
|
# :startdoc:
|
25
25
|
|
26
|
-
# Returns whether or not the file is an image. Only JPEG, PNG, BMP
|
27
|
-
# GIF are checked against.
|
26
|
+
# Returns whether or not the file is an image. Only JPEG, PNG, BMP,
|
27
|
+
# GIF, and ICO are checked against.
|
28
28
|
#
|
29
29
|
# This method does some simple read and extension checks. For a version
|
30
30
|
# that is more robust, but which depends on a 3rd party C library (and is
|
@@ -39,8 +39,8 @@ class File
|
|
39
39
|
# http://en.wikipedia.org/wiki/Magic_number_(programming)
|
40
40
|
#
|
41
41
|
def self.image?(file)
|
42
|
-
bool = IMAGE_EXT.include?(File.extname(file).downcase)
|
43
|
-
bool = bmp?(file) || jpg?(file) || png?(file) || gif?(file) || tiff?(file)
|
42
|
+
bool = IMAGE_EXT.include?(File.extname(file).downcase)
|
43
|
+
bool = bmp?(file) || jpg?(file) || png?(file) || gif?(file) || tiff?(file) || ico?(file)
|
44
44
|
bool
|
45
45
|
end
|
46
46
|
|
@@ -483,4 +483,8 @@ class File
|
|
483
483
|
|
484
484
|
true
|
485
485
|
end
|
486
|
+
|
487
|
+
def self.ico?(file)
|
488
|
+
["\000\000\001\000", "\000\000\002\000"].include?(IO.read(file, 4, nil, :encoding => 'binary'))
|
489
|
+
end
|
486
490
|
end
|
data/ptools.gemspec
CHANGED
data/test/img/test.ico
ADDED
Binary file
|
data/test/test_constants.rb
CHANGED
@@ -15,7 +15,7 @@ class TC_Ptools_Constants < Test::Unit::TestCase
|
|
15
15
|
end
|
16
16
|
|
17
17
|
test "PTOOLS_VERSION constant is set to expected value" do
|
18
|
-
assert_equal('1.3.
|
18
|
+
assert_equal('1.3.5', File::PTOOLS_VERSION)
|
19
19
|
end
|
20
20
|
|
21
21
|
test "IMAGE_EXT constant is set to array of values" do
|
data/test/test_image.rb
CHANGED
@@ -18,6 +18,7 @@ class TC_Ptools_Image < Test::Unit::TestCase
|
|
18
18
|
@jpg_file = File.join(Dir.pwd, 'img', 'test.jpg')
|
19
19
|
@png_file = File.join(Dir.pwd, 'img', 'test.png')
|
20
20
|
@gif_file = File.join(Dir.pwd, 'img', 'test.gif')
|
21
|
+
@ico_file = File.join(Dir.pwd, 'img', 'test.ico')
|
21
22
|
end
|
22
23
|
|
23
24
|
test "image? method basic functionality" do
|
@@ -43,6 +44,10 @@ class TC_Ptools_Image < Test::Unit::TestCase
|
|
43
44
|
assert_true(File.image?(@png_file))
|
44
45
|
end
|
45
46
|
|
47
|
+
test "image? method returns true for an ico" do
|
48
|
+
assert_true(File.image?(@ico_file))
|
49
|
+
end
|
50
|
+
|
46
51
|
test "image? method raises an error if the file does not exist" do
|
47
52
|
assert_raises(Errno::ENOENT, ArgumentError){ File.image?('bogus') }
|
48
53
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ptools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -12,25 +12,25 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
|
14
14
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
|
15
|
+
MB4XDTE3MDkwMzE1MjMxM1oXDTE4MDkwMzE1MjMxM1owPzERMA8GA1UEAwwIZGpi
|
16
16
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJ8y4kEssxNpAdPhNNw2
|
18
|
+
p4zkERFndPAnmOKDdErczFYYUA9uYpA7/iTjkLlNyRwvsNHpnMXdSF7vy++YIU+F
|
19
|
+
Ux3AGTmspupbdSzqBNUhSEJ9TmpjMer1dMYMR9fRw3r3qQreiO2u/O/tV4VpzrDj
|
20
|
+
28JC0b1PcKtfobxbnk+hporZqTH6ClOxDsRx+trlkr7q7FLZwTZn0ywjAV8WMVTO
|
21
|
+
SMmkzXQ37s2Nnrq6r+dDZI0voBxyQkAUzmdBOQTrvOFAo3tuWcnJNR/RRdFhJ9nK
|
22
|
+
mYMPmEd1z0s+cU0SUEeTvhGv/9LCmbSyZqKezDLYNR4Gb0FOA9D50+4OOi2+3G1o
|
23
|
+
1U0CAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJCx
|
24
|
+
ukSSioTiLtwQCdML0IyEZAJ/MB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
|
25
25
|
bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
ggEBAJh/dmRaTpJAUeJ2x9CEyy9gSP6SZjMeAwWgPNdowPDyw0JzlpBIrYiTnCYK
|
27
|
+
2OqxvIi8L38+rHw3KYL0fEyNqP3RbMl6+SljRwiU0JwEqj9e1pqIx99RTLKeI9PM
|
28
|
+
F8LxxmDHreGOaY4R8JBOMxys1wBkF/Iilx4qoT4LBn+DzraAlmYjr6O6itIxGten
|
29
|
+
NFJFS/tFBTTeNW6SJLdDnGd2b7vBBEd/ZpIhuZNxriU6FKWC5FJeBdAiuw6lqHun
|
30
|
+
QLLepVJthIvwmfc8AU5TJGMawtVAUHIWiuQPoBBVVKOkeEhioO0cV8UabKsKMbE8
|
31
|
+
VpiARrgH+4lYiRFJ+gKpIbSEJvk=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2017-
|
33
|
+
date: 2017-09-03 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rake
|
@@ -85,6 +85,7 @@ files:
|
|
85
85
|
- test
|
86
86
|
- test/img
|
87
87
|
- test/img/test.gif
|
88
|
+
- test/img/test.ico
|
88
89
|
- test/img/test.jpg
|
89
90
|
- test/img/test.png
|
90
91
|
- test/test_binary.rb
|
metadata.gz.sig
CHANGED
Binary file
|