ptools 1.3.6-universal-mingw32 → 1.3.7-universal-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7137b9d1e8f2be72fc7c5fecaad1101105dfcdec8b20ce4a14613290eb654d7f
4
- data.tar.gz: f6277cd2a7c718b3fba6e219fcb67a550b97ce05986770b1badc760c9be527ba
3
+ metadata.gz: 69b0c5a7f01036c4e8b29773fcda191482ec37cef11ed835d77e84d6d1113e09
4
+ data.tar.gz: 6acb8b4b8b4a0bc479d912bbf9f8eae991725f6a766f6c1c85c2149b771a1dfc
5
5
  SHA512:
6
- metadata.gz: 35a63af1addb2fb3e5bce61393941586a2f5bdd137408afeb437207502e61bc21ed92f72ff392ffc8adf7b67a4353604f713ce5cbcbd64245d4e4860efdf46ba
7
- data.tar.gz: 408a73f0219d50632a63265b3a72f13f120962f5bee89a3a36ece8f8671a896015b1f2442c129558b4b079b5723efee37beaac3d56893f8246d3cb298c648885
6
+ metadata.gz: 8bed3889606d6351aa7c2a636be91c3a17a05470516355db715a9fa2f88f5d3cf7442771938cd70c2a796e26eb1f5c04a87e03d007793fffcfbed09175178bd1
7
+ data.tar.gz: 793779b97fdd26452c6066ba7416d770a6d02e4c862e0637c40531c374955c54507616b466916f4d1130022f7f2f363e5c377c0cd673bfd9f63cd9c7e2cee5ce
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
@@ -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: 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
@@ -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