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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8af69190c08ac129154e8db30f4e3aebcace84ec56a052638337a2174e9b2112
4
- data.tar.gz: 067e2a998841f349d933f121bc580b4c66e5f022db99ce45617b8ea760f68acb
3
+ metadata.gz: 60d8a2d183abbb54bd0140d4681625c0c6d1aec1a4f03c0de4a63ef7e6b8625e
4
+ data.tar.gz: 8e850bf76e10e887dd089b15a580e63dae8b32f159a7120f4bd2a4700870101c
5
5
  SHA512:
6
- metadata.gz: 6d8b2067490b9af0348c50af062e466d403477a52addb4e1742072a8684be61701afa5e496f0006e459eac9fb1acb6ab0accb02d245a8e05e42e0e8b2212d820
7
- data.tar.gz: aa9770acc57cd8170659f6912e8f3499bb1441f00d668eff0de291cd8276e303f6f9b166b5adf682147015763ac49d97b690eebcb9f57aec86606e58c0489ad4
6
+ metadata.gz: 22ed87d408f7f324838f3cd6a88428e28fcc5fcba6356c9c40117ec08be5fbc1dd6f36a1da75cfea6bd4d1ebc8d51bb219a8cff0435c326e89b704552c8464e5
7
+ data.tar.gz: a7a276fc8b777a95edd4ac38cc4637fcde6567f9e321f02bc2b3b094c56556034d465bc60c9f834fd696c3b0928b9c65130ce853275b6b977b4571ec95e20b38
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,2 @@
1
- Q>�����ӫ� ��방���s[V�c�!vl>#
1
+ N�/U����$��0?.����PU�+���`8�pO1���ޑ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
@@ -1,6 +1,7 @@
1
1
  * CHANGES
2
2
  * README
3
3
  * MANIFEST
4
+ * Gemfile
4
5
  * Rakefile
5
6
  * ptools.gemspec
6
7
  * certs/djberg96_pub.pem
@@ -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'.freeze
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
@@ -2,7 +2,7 @@ require 'rbconfig'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'ptools'
5
- spec.version = '1.3.6'
5
+ spec.version = '1.3.7'
6
6
  spec.license = 'Artistic-2.0'
7
7
  spec.author = 'Daniel J. Berger'
8
8
  spec.email = 'djberg96@gmail.com'
@@ -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))
@@ -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.6', File::PTOOLS_VERSION)
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
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.6
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.8
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
@@ -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