ptools 1.3.6 → 1.3.7
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 +2 -1
- 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 +3 -3
- 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: 60d8a2d183abbb54bd0140d4681625c0c6d1aec1a4f03c0de4a63ef7e6b8625e
|
4
|
+
data.tar.gz: 8e850bf76e10e887dd089b15a580e63dae8b32f159a7120f4bd2a4700870101c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22ed87d408f7f324838f3cd6a88428e28fcc5fcba6356c9c40117ec08be5fbc1dd6f36a1da75cfea6bd4d1ebc8d51bb219a8cff0435c326e89b704552c8464e5
|
7
|
+
data.tar.gz: a7a276fc8b777a95edd4ac38cc4637fcde6567f9e321f02bc2b3b094c56556034d465bc60c9f834fd696c3b0928b9c65130ce853275b6b977b4571ec95e20b38
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
|
1
|
+
N�/U����$��0?.����PU�+���`8�pO�1���ޑa|�C�ҥ�O��SwX��t���7�칅�է���Z���6-�4���
|
2
|
+
�$ܕD���[�{t;x~���q�6�Pn��X��Т�m^�ȣ��M��^����(4��W�qEI0�?�WAc��C+�`*1�
|
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: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- test
|
81
81
|
- test/test_constants.rb
|
82
82
|
- test/txt
|
83
|
+
- test/txt/empty.txt
|
83
84
|
- test/txt/english.utf16
|
84
85
|
- test/txt/english.txt
|
85
86
|
- test/txt/korean.txt
|
@@ -109,7 +110,6 @@ files:
|
|
109
110
|
- lib
|
110
111
|
- lib/ptools.rb
|
111
112
|
- Gemfile
|
112
|
-
- Gemfile.lock
|
113
113
|
homepage: https://github.com/djberg96/ptools
|
114
114
|
licenses:
|
115
115
|
- Artistic-2.0
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.0.
|
132
|
+
rubygems_version: 3.0.3
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Extra methods for the File class
|
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
|