ptools 1.3.6-universal-mingw32 → 1.3.7-universal-mingw32
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 +6 -0
- data/MANIFEST +1 -0
- data/lib/ptools.rb +2 -1
- data/ptools.gemspec +1 -1
- data/test/test_binary.rb +2 -0
- data/test/test_constants.rb +2 -1
- data/test/txt/empty.txt +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
- data/Gemfile.lock +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69b0c5a7f01036c4e8b29773fcda191482ec37cef11ed835d77e84d6d1113e09
|
4
|
+
data.tar.gz: 6acb8b4b8b4a0bc479d912bbf9f8eae991725f6a766f6c1c85c2149b771a1dfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8bed3889606d6351aa7c2a636be91c3a17a05470516355db715a9fa2f88f5d3cf7442771938cd70c2a796e26eb1f5c04a87e03d007793fffcfbed09175178bd1
|
7
|
+
data.tar.gz: 793779b97fdd26452c6066ba7416d770a6d02e4c862e0637c40531c374955c54507616b466916f4d1130022f7f2f363e5c377c0cd673bfd9f63cd9c7e2cee5ce
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.3.7 - 24-Jun-2020
|
2
|
+
* Fixed a bug where the File.binary? method would bomb on a zero byte file.
|
3
|
+
Thanks go to Alexandru Emil Lupu for the spot and patch.
|
4
|
+
* Remove Gemfile.lock from repo. You can generate that yourself locally if
|
5
|
+
you want.
|
6
|
+
|
1
7
|
== 1.3.6 - 7-Jun-2020
|
2
8
|
* Updated gemspec, added more versions to .travis.yml file, fixed typo.
|
3
9
|
Thanks go to Al Snow for the updates.
|
data/MANIFEST
CHANGED
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.7'.freeze
|
7
7
|
|
8
8
|
# :stopdoc:
|
9
9
|
|
@@ -92,6 +92,7 @@ class File
|
|
92
92
|
# based on Perl's -B switch).
|
93
93
|
#
|
94
94
|
def self.binary?(file, percentage = 0.30)
|
95
|
+
return false if File.stat(file).zero?
|
95
96
|
return false if image?(file)
|
96
97
|
return false if check_bom?(file)
|
97
98
|
bytes = File.stat(file).blksize
|
data/ptools.gemspec
CHANGED
data/test/test_binary.rb
CHANGED
@@ -21,6 +21,7 @@ class TC_Ptools_Binary < Test::Unit::TestCase
|
|
21
21
|
|
22
22
|
def setup
|
23
23
|
@txt_file = File.join(@@dirname, 'txt', 'english.txt')
|
24
|
+
@emp_file = File.join(@@dirname, 'txt', 'empty.txt')
|
24
25
|
@uni_file = File.join(@@dirname, 'txt', 'korean.txt')
|
25
26
|
@utf_file = File.join(@@dirname, 'txt', 'english.utf16')
|
26
27
|
@png_file = File.join(@@dirname, 'img', 'test.png')
|
@@ -38,6 +39,7 @@ class TC_Ptools_Binary < Test::Unit::TestCase
|
|
38
39
|
end
|
39
40
|
|
40
41
|
test "File.binary? returns false for text files" do
|
42
|
+
assert_false(File.binary?(@emp_file))
|
41
43
|
assert_false(File.binary?(@txt_file))
|
42
44
|
assert_false(File.binary?(@uni_file))
|
43
45
|
assert_false(File.binary?(@utf_file))
|
data/test/test_constants.rb
CHANGED
@@ -15,7 +15,8 @@ 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.7', File::PTOOLS_VERSION)
|
19
|
+
assert_true(File::PTOOLS_VERSION.frozen?)
|
19
20
|
end
|
20
21
|
|
21
22
|
test "IMAGE_EXT constant is set to array of values" do
|
data/test/txt/empty.txt
ADDED
File without changes
|
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.7
|
5
5
|
platform: universal-mingw32
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -95,7 +95,6 @@ files:
|
|
95
95
|
- certs/djberg96_pub.pem
|
96
96
|
- CHANGES
|
97
97
|
- Gemfile
|
98
|
-
- Gemfile.lock
|
99
98
|
- lib
|
100
99
|
- lib/ptools.rb
|
101
100
|
- MANIFEST
|
@@ -121,6 +120,7 @@ files:
|
|
121
120
|
- test/test_whereis.rb
|
122
121
|
- test/test_which.rb
|
123
122
|
- test/txt
|
123
|
+
- test/txt/empty.txt
|
124
124
|
- test/txt/english.txt
|
125
125
|
- test/txt/english.utf16
|
126
126
|
- test/txt/korean.txt
|
metadata.gz.sig
CHANGED
Binary file
|
data/Gemfile.lock
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
power_assert (1.1.5)
|
5
|
-
rake (13.0.1)
|
6
|
-
structured_warnings (0.4.0)
|
7
|
-
test-unit (3.3.5)
|
8
|
-
power_assert
|
9
|
-
|
10
|
-
PLATFORMS
|
11
|
-
ruby
|
12
|
-
|
13
|
-
DEPENDENCIES
|
14
|
-
rake
|
15
|
-
structured_warnings
|
16
|
-
test-unit
|
17
|
-
|
18
|
-
BUNDLED WITH
|
19
|
-
2.1.2
|