ptools 1.4.0 → 1.4.1
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 → CHANGES.md} +36 -32
- data/{MANIFEST → MANIFEST.md} +3 -3
- data/{README → README.md} +26 -24
- data/Rakefile +1 -1
- data/lib/ptools.rb +2 -2
- data/ptools.gemspec +10 -3
- data/spec/constants_spec.rb +1 -1
- metadata +14 -11
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f02ac0737f1acf24a7edccb33f60990b5690259fe715520eeb803badc514ae
|
4
|
+
data.tar.gz: 469380e8d9f7107868b0ec17e8ca7aa4c8e5e1db19a7263c88995e1346f9c634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 114dec925795c5ebfc3f84209602490d22d54031fede8cf9914d635c4bb4180cce1d77dcb3f87d970f491a43b307f7017a29a1239b7d23442aaa01f701d13071
|
7
|
+
data.tar.gz: 60b1f3ad73a5019ed89b24ae82b0032f014b8770d8feb6b447ad72f459a6029cf678fa0fe96c5e8ec23eb1dc2818a66dbbabc499d4bc8ac858c256ad786236b0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/{CHANGES → CHANGES.md}
RENAMED
@@ -1,50 +1,54 @@
|
|
1
|
-
|
1
|
+
## 1.4.1 - 29-Dec-2020
|
2
|
+
* Switch from rdoc to markdown since github is not rendering rdoc properly.
|
3
|
+
* Added metadata to gemspec.
|
4
|
+
|
5
|
+
## 1.4.0 - 20-Aug-2020
|
2
6
|
* Switched from test-unit to rspec, and reworked the tests bit in general.
|
3
7
|
* Removed the File.null method since Ruby has IO::NULL.
|
4
8
|
|
5
|
-
|
9
|
+
## 1.3.7 - 24-Jun-2020
|
6
10
|
* Fixed a bug where the File.binary? method would bomb on a zero byte file.
|
7
11
|
Thanks go to Alexandru Emil Lupu for the spot and patch.
|
8
12
|
* Remove Gemfile.lock from repo. You can generate that yourself locally if
|
9
13
|
you want.
|
10
14
|
|
11
|
-
|
15
|
+
## 1.3.6 - 7-Jun-2020
|
12
16
|
* Updated gemspec, added more versions to .travis.yml file, fixed typo.
|
13
17
|
Thanks go to Al Snow for the updates.
|
14
18
|
* Fixed a bug where the File.binary? method would return true for utf16
|
15
19
|
or utf32 encoded files. Thanks go to Andrew McAndre for the spot.
|
16
20
|
* Updated cert.
|
17
21
|
|
18
|
-
|
22
|
+
## 1.3.5 - 3-Sep-2017
|
19
23
|
* The File.image? method now checks against .ico files.
|
20
24
|
* Eliminated Fixnum warning that showed up in Ruby 2.4.x.
|
21
25
|
* Updated cert.
|
22
26
|
|
23
|
-
|
27
|
+
## 1.3.4 - 4-Jul-2017
|
24
28
|
* The File.binary? method now lets you set your own percentage for the
|
25
29
|
internal heuristic as an optional second argument.
|
26
30
|
* The VERSION constant is now frozen.
|
27
31
|
* Minor updates to the Rakefile and gemspec.
|
28
32
|
* Updated cert file.
|
29
33
|
|
30
|
-
|
34
|
+
## 1.3.3 - 25-Sep-2015
|
31
35
|
* This gem is now signed.
|
32
36
|
* The Rakefile tasks now assume Rubygems 2.x.
|
33
37
|
|
34
|
-
|
38
|
+
## 1.3.2 - 11-Dec-2014
|
35
39
|
* Update to the File.tail method that prevents potential line ending issues in JRuby.
|
36
40
|
* Added known issues with JRuby to the README.
|
37
41
|
|
38
|
-
|
42
|
+
## 1.3.1 - 9-Dec-2014
|
39
43
|
* Fixed some potential issues with File.tail. Thanks go to Matt Hoyle for
|
40
44
|
the patch.
|
41
45
|
|
42
|
-
|
46
|
+
## 1.3.0 - 8-Dec-2014
|
43
47
|
* Made the File.tail method efficient. It's no longer slurpy, and it also no
|
44
48
|
longer includes line endings in the result.
|
45
49
|
* Removed the File.middle method. I don't think it's useful.
|
46
50
|
|
47
|
-
|
51
|
+
## 1.2.7 - 6-Dec-2014
|
48
52
|
* File.which now expands ~ for paths. Thanks go to dg-vrnetze for the patch.
|
49
53
|
* Use /dev/null for cygwin instead of NUL.
|
50
54
|
* Use mv instead of cp in the nl_convert method.
|
@@ -52,12 +56,12 @@
|
|
52
56
|
* Modified the binary? method to check 4096 bytes at most.
|
53
57
|
* Thanks to Matt Hoyle for many of the changes implemented in this release.
|
54
58
|
|
55
|
-
|
59
|
+
## 1.2.6 - 14-Jul-2014
|
56
60
|
* Updated the png? and jpg? methods so they explicitly specify the
|
57
61
|
offset argument so that it works with 1.9.2 and earlier. Thanks go to
|
58
62
|
Anurag Priyam for the spot.
|
59
63
|
|
60
|
-
|
64
|
+
## 1.2.5 - 11-Jul-2014
|
61
65
|
* Added a Gemfile, mostly for Travis CI.
|
62
66
|
* Added rake as a development dependency.
|
63
67
|
* Revert back to hash syntax supported by 1.8.x.
|
@@ -65,19 +69,19 @@
|
|
65
69
|
* Updated the tests for File.sparse? so that it doesn't rely on
|
66
70
|
an external file.
|
67
71
|
|
68
|
-
|
72
|
+
## 1.2.4 - 25-Feb-2014
|
69
73
|
* The File.binary method now always returns false for images. It is meant to
|
70
74
|
detect executables, shared objects, etc. Use File.image? to detect images.
|
71
75
|
* Encoding fixes for the File.image? method.
|
72
76
|
|
73
|
-
|
77
|
+
## 1.2.3 - 19-Feb-2014
|
74
78
|
* Fixed a bug where File.binary? would return true for unicode text. Thanks go
|
75
79
|
to Ben Hollis for the spot.
|
76
80
|
* Updated the win32-file and test-unit dependencies.
|
77
81
|
* Replace all instances of File.exists? with File.exist? because the former
|
78
82
|
is deprecated in Ruby 2.1 and later.
|
79
83
|
|
80
|
-
|
84
|
+
## 1.2.2 - 6-Apr-2012
|
81
85
|
* Yet another sparse file test fix for OSX, which does not support
|
82
86
|
sparse file generation on HFS+.
|
83
87
|
* Fixed a bug in the File.whereis method on Windows when dealing with
|
@@ -85,15 +89,15 @@
|
|
85
89
|
* Some Config vs RbConfig fixes to silence 1.9.3 warnings.
|
86
90
|
* Refactored and cleaned up some tests.
|
87
91
|
|
88
|
-
|
92
|
+
## 1.2.1 - 20-May-2011
|
89
93
|
* Added an (empty) .gemtest file so that it can be used with test.rubygems.org.
|
90
94
|
* Fixed a sparse file test.
|
91
95
|
|
92
|
-
|
96
|
+
## 1.2.0 - 8-Jan-2011
|
93
97
|
* Added the File.sparse? method for Unix platforms. This method already
|
94
98
|
exists on Windows courtesy of the win32-file library.
|
95
99
|
|
96
|
-
|
100
|
+
## 1.1.9 - 25-Mar-2010
|
97
101
|
* Refactored File.which and File.whereis and added additional tests for each.
|
98
102
|
* Removed the block form of File.whereis.
|
99
103
|
* Reorganized the Rakefile a bit and put the test tasks under the 'test'
|
@@ -101,7 +105,7 @@
|
|
101
105
|
* Updated the test-unit development dependency.
|
102
106
|
* Updates the README.
|
103
107
|
|
104
|
-
|
108
|
+
## 1.1.8 - 6-Oct-2009
|
105
109
|
* Fixed some bad variable names that crept into the File.nl_convert method.
|
106
110
|
* Added the File.null_device alias for File.null.
|
107
111
|
* Added cygwin and mingw to Windows detection code.
|
@@ -113,7 +117,7 @@
|
|
113
117
|
* Documentation updates.
|
114
118
|
* Added the :gem rake task.
|
115
119
|
|
116
|
-
|
120
|
+
## 1.1.7 - 28-Jul-2009
|
117
121
|
* Now compatible with Ruby 1.9.x.
|
118
122
|
* Replaced RUBY_PLATFORM with rbconfig check for the sake of other
|
119
123
|
implementations, such as JRuby.
|
@@ -121,35 +125,35 @@
|
|
121
125
|
* Added Test::Unit 2.x as a development dependency.
|
122
126
|
* Renamed the test files.
|
123
127
|
|
124
|
-
|
128
|
+
## 1.1.6 - 31-Aug-2007
|
125
129
|
* Fixed the File.touch method so that it doesn't whack existing files. Thanks
|
126
130
|
go to Thomas Preymesser for the spot.
|
127
131
|
* Added corresponding tests to the tc_touch.rb file.
|
128
132
|
|
129
|
-
|
133
|
+
## 1.1.5 - 19-Jul-2007
|
130
134
|
* Added the File.image? method. Inspired by ruby-talk: 260487.
|
131
135
|
|
132
|
-
|
136
|
+
## 1.1.4 - 21-May-2007
|
133
137
|
* Removed the install.rb file. Installation is now handled exclusively by the
|
134
138
|
rake install task.
|
135
139
|
* Updated the MANIFEST file, and made it rdoc friendly.
|
136
140
|
* Manual installation corrections in the README file.
|
137
141
|
|
138
|
-
|
142
|
+
## 1.1.3 - 29-Apr-2007
|
139
143
|
* I changed the way that the constants IS_WINDOWS and WIN32EXTS are defined.
|
140
144
|
* The IS_WINDOWS and WIN32EXTS are no long documented publically. They were
|
141
145
|
never meant for public use.
|
142
146
|
* The tc_constants.rb file was modified to only run certain tests on Windows.
|
143
147
|
|
144
|
-
|
148
|
+
## 1.1.2 - 28-Apr-2007
|
145
149
|
* Fixed a require line that could cause problems on MS Windows.
|
146
150
|
* Added a Rakefile which includes tasks for installation and testing.
|
147
151
|
* Some cleanup and improvement in the various test files.
|
148
152
|
|
149
|
-
|
153
|
+
## 1.1.1 - 24-Aug-2006
|
150
154
|
* Added the File.binary? method, based on code from Ryan Davis.
|
151
155
|
|
152
|
-
|
156
|
+
## 1.1.0 - 23-Aug-2006
|
153
157
|
* Added the File.null method which returns the bit bucket on your platform.
|
154
158
|
* The suffixes on MS Windows are now based on the PATHEXT environment variable,
|
155
159
|
and defaults to '.com', '.bat' and '.exe' only if it's not defined.
|
@@ -158,7 +162,7 @@
|
|
158
162
|
* Modified the platform checking and path separator handling.
|
159
163
|
* Added and tweaked some tests.
|
160
164
|
|
161
|
-
|
165
|
+
## 1.0.0 - 2-Jun-2005
|
162
166
|
* Modified the File.middle method to accept an optional block.
|
163
167
|
* File.whereis is now limited to unique values so that redundant PATH entries
|
164
168
|
do not cause redundant entries in the returned array (or block).
|
@@ -172,12 +176,12 @@
|
|
172
176
|
* Removed the INSTALL file. See the README instead.
|
173
177
|
* Moved project to RubyForge.
|
174
178
|
|
175
|
-
|
179
|
+
## 0.1.3 - 5-Dec-2003
|
176
180
|
* Modified File#which and File#whereis for Win32 to handle extensions better,
|
177
181
|
i.e. you can send "ruby" or "ruby.exe" and get back the same result.
|
178
182
|
* Minor test changes to tc_which.rb and tc_whereis.rb.
|
179
183
|
|
180
|
-
|
184
|
+
## 0.1.2 - 14-May-2003
|
181
185
|
* Modified nl_convert() to allow the destination filename to be the same as the
|
182
186
|
source file. In that case, a tempfile is used and copied back over the
|
183
187
|
original file.
|
@@ -187,7 +191,7 @@
|
|
187
191
|
* Test suite additions/fixes.
|
188
192
|
* Updates to MANIFEST.
|
189
193
|
|
190
|
-
|
194
|
+
## 0.1.1 - 21-Mar-2003
|
191
195
|
* Modified File.tail to return data in the same order that 'tail' does.
|
192
196
|
* Modified File.which to return nil if the program is not found.
|
193
197
|
* Modified File.whereis now uses '\' instead of '/' on MS Windows.
|
@@ -196,5 +200,5 @@
|
|
196
200
|
* Thanks go to Shanko for both the spot and patch for tail, which, whereis
|
197
201
|
and middle.
|
198
202
|
|
199
|
-
|
203
|
+
## 0.1.0 - 18-Mar-2003
|
200
204
|
* Initial release
|
data/{MANIFEST → MANIFEST.md}
RENAMED
data/{README → README.md}
RENAMED
@@ -1,32 +1,34 @@
|
|
1
|
-
|
1
|
+
## Description
|
2
2
|
The ptools (power tools) library is an additional set of commands for the
|
3
3
|
File class based on Unix command line tools.
|
4
4
|
|
5
|
-
|
5
|
+
## Prerequisites
|
6
6
|
On MS Windows you will need the win32-file gem.
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
## Installation
|
9
|
+
`gem install ptools`
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
## Synopsis
|
12
|
+
```ruby
|
13
|
+
require "ptools"
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
File.which("ruby") # '/usr/local/bin/ruby'
|
16
|
+
File.whereis("ruby") # ['/usr/local/bin/ruby','/opt/bin/ruby']
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
File.head("myfile") # Returns first 10 lines of 'myfile'
|
19
|
+
File.tail("myfile",3) # Returns last 3 lines of 'myfile'
|
20
|
+
File.wc("myfile",'words') # Returns the number of words in 'myfile'
|
20
21
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
22
|
+
File.touch("newfile") # "newfile" now exists
|
23
|
+
File.null # '/dev/null' on Unix, 'NUL' on Windows
|
24
|
+
File.binary?('some_file') # true or false
|
25
|
+
File.sparse?('some_file') # true or false
|
25
26
|
|
26
|
-
|
27
|
-
|
27
|
+
# Creates a copy of 'myfile' called 'newfile', in DOS format
|
28
|
+
File.nl_convert("myfile", "newfile", "dos")
|
29
|
+
```
|
28
30
|
|
29
|
-
|
31
|
+
## Known Bugs
|
30
32
|
The File.which and File.whereis methods may fail when using JRuby on Windows.
|
31
33
|
See https://github.com/jruby/jruby/issues/2291 for details.
|
32
34
|
|
@@ -34,7 +36,7 @@
|
|
34
36
|
|
35
37
|
http://www.github.com/djberg96/ptools
|
36
38
|
|
37
|
-
|
39
|
+
## Acknowledgements
|
38
40
|
The File.which method was originally adopted from the FileWhich code posted
|
39
41
|
by Michael Granger on the now defunct rubygarden.org website. That code was
|
40
42
|
later replaced by a version based on the ruby-which library.
|
@@ -49,20 +51,20 @@
|
|
49
51
|
|
50
52
|
And thanks to any and all contributors!
|
51
53
|
|
52
|
-
|
54
|
+
## Future Plans
|
53
55
|
Add whatever other tools people think might be useful.
|
54
56
|
|
55
|
-
|
57
|
+
## License
|
56
58
|
Artistic-2.0
|
57
59
|
|
58
|
-
|
60
|
+
## Copyright
|
59
61
|
(C) 2003-2020 Daniel J. Berger
|
60
62
|
All Rights Reserved.
|
61
63
|
|
62
|
-
|
64
|
+
## Warranty
|
63
65
|
This package is provided "as is" and without any express or
|
64
66
|
implied warranties, including, without limitation, the implied
|
65
67
|
warranties of merchantability and fitness for a particular purpose.
|
66
68
|
|
67
|
-
|
69
|
+
## Author
|
68
70
|
Daniel J. Berger
|
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ require 'rbconfig'
|
|
5
5
|
require 'rspec/core/rake_task'
|
6
6
|
include RbConfig
|
7
7
|
|
8
|
-
CLEAN.include("**/*.gem", "**/*.rbc", "**/*coverage*")
|
8
|
+
CLEAN.include("**/*.gem", "**/*.rbc", "**/*coverage*", "**/*.lock")
|
9
9
|
|
10
10
|
desc 'Install the ptools package (non-gem)'
|
11
11
|
task :install do
|
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.4.
|
6
|
+
PTOOLS_VERSION = '1.4.1'.freeze
|
7
7
|
|
8
8
|
# :stopdoc:
|
9
9
|
|
@@ -455,7 +455,7 @@ class File
|
|
455
455
|
bytes = IO.read(file, 4)
|
456
456
|
|
457
457
|
# II is Intel, MM is Motorola
|
458
|
-
if bytes[0..1] != 'II'&& bytes[0..1] != 'MM'
|
458
|
+
if bytes[0..1] != 'II' && bytes[0..1] != 'MM'
|
459
459
|
return false
|
460
460
|
end
|
461
461
|
|
data/ptools.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rbconfig'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'ptools'
|
5
|
-
spec.version = '1.4.
|
5
|
+
spec.version = '1.4.1'
|
6
6
|
spec.license = 'Artistic-2.0'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -12,14 +12,21 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = ['certs/djberg96_pub.pem']
|
14
14
|
|
15
|
-
spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
16
|
-
|
17
15
|
spec.description = <<-EOF
|
18
16
|
The ptools (power tools) library provides several handy methods to
|
19
17
|
Ruby's core File class, such as File.which for finding executables,
|
20
18
|
File.null to return the null device on your platform, and so on.
|
21
19
|
EOF
|
22
20
|
|
21
|
+
spec.metadata = {
|
22
|
+
'homepage_uri' => 'https://github.com/djberg96/ptools',
|
23
|
+
'bug_tracker_uri' => 'https://github.com/djberg96/ptools/issues',
|
24
|
+
'changelog_uri' => 'https://github.com/djberg96/ptools/blob/master/CHANGES.md',
|
25
|
+
'documentation_uri' => 'https://github.com/djberg96/ptools/wiki',
|
26
|
+
'source_code_uri' => 'https://github.com/djberg96/ptools',
|
27
|
+
'wiki_uri' => 'https://github.com/djberg96/ptools/wiki'
|
28
|
+
}
|
29
|
+
|
23
30
|
spec.add_development_dependency('rake')
|
24
31
|
spec.add_development_dependency('rspec', '~> 3.9')
|
25
32
|
|
data/spec/constants_spec.rb
CHANGED
@@ -13,7 +13,7 @@ RSpec.describe File, :constants do
|
|
13
13
|
let(:windows) { File::ALT_SEPARATOR }
|
14
14
|
|
15
15
|
example "PTOOLS_VERSION constant is set to expected value" do
|
16
|
-
expect(File::PTOOLS_VERSION).to eq('1.4.
|
16
|
+
expect(File::PTOOLS_VERSION).to eq('1.4.1')
|
17
17
|
expect(File::PTOOLS_VERSION.frozen?).to be true
|
18
18
|
end
|
19
19
|
|
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-
|
38
|
+
date: 2020-12-29 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rake
|
@@ -72,15 +72,12 @@ description: |2
|
|
72
72
|
email: djberg96@gmail.com
|
73
73
|
executables: []
|
74
74
|
extensions: []
|
75
|
-
extra_rdoc_files:
|
76
|
-
- README
|
77
|
-
- CHANGES
|
78
|
-
- MANIFEST
|
75
|
+
extra_rdoc_files: []
|
79
76
|
files:
|
80
|
-
- CHANGES
|
77
|
+
- CHANGES.md
|
81
78
|
- Gemfile
|
82
|
-
- MANIFEST
|
83
|
-
- README
|
79
|
+
- MANIFEST.md
|
80
|
+
- README.md
|
84
81
|
- Rakefile
|
85
82
|
- certs/djberg96_pub.pem
|
86
83
|
- lib/ptools.rb
|
@@ -107,7 +104,13 @@ files:
|
|
107
104
|
homepage: https://github.com/djberg96/ptools
|
108
105
|
licenses:
|
109
106
|
- Artistic-2.0
|
110
|
-
metadata:
|
107
|
+
metadata:
|
108
|
+
homepage_uri: https://github.com/djberg96/ptools
|
109
|
+
bug_tracker_uri: https://github.com/djberg96/ptools/issues
|
110
|
+
changelog_uri: https://github.com/djberg96/ptools/blob/master/CHANGES.md
|
111
|
+
documentation_uri: https://github.com/djberg96/ptools/wiki
|
112
|
+
source_code_uri: https://github.com/djberg96/ptools
|
113
|
+
wiki_uri: https://github.com/djberg96/ptools/wiki
|
111
114
|
post_install_message:
|
112
115
|
rdoc_options: []
|
113
116
|
require_paths:
|
@@ -123,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
126
|
- !ruby/object:Gem::Version
|
124
127
|
version: '0'
|
125
128
|
requirements: []
|
126
|
-
rubygems_version: 3.
|
129
|
+
rubygems_version: 3.2.3
|
127
130
|
signing_key:
|
128
131
|
specification_version: 4
|
129
132
|
summary: Extra methods for the File class
|
metadata.gz.sig
CHANGED
Binary file
|