ptools 1.2.4-universal-mingw32 → 1.2.5-universal-mingw32

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
  SHA1:
3
- metadata.gz: ac21ce3ffb8aa8dcb92d1b68a643e8d2f16a3d3a
4
- data.tar.gz: 66be57ae67363a6efa93269a4bcce4003ee45f08
3
+ metadata.gz: 41e1aecc1f93c15856b690c034a659420bcddea5
4
+ data.tar.gz: 10916384ef488f8a0ee3795445960fde10bcb743
5
5
  SHA512:
6
- metadata.gz: 027fce7e6924732d99331c520cc2bcc37979c471f85a0dd28ea141c3dc582a579bea952072a4810b3d8ab544f398c01e59efafde44f353de0471e4fa6c84a337
7
- data.tar.gz: 51ec3df25f8bfdab9ff0253f6bf97d8a1a626b9126edb8a1cb2de70a849502ff841ee9d9accf463c08c24777c7f29d4fa52fbd1b8d4224c1beb0f34c13373608
6
+ metadata.gz: 4638b10a085e82b257b102783c124ef3c78b551cb2f2f8eda12ea7f83b58558def4a61328783b9b95cf0472594f00df01ad357a382552a3ea5516e1796414650
7
+ data.tar.gz: 3ccc72c3b61f4522371dff22fe7660f0659e01aede38da5b0612206525b21510b74bfe101d735a2255f12d5899d8d29009fe7026e8aa5e4b6d487e8f48092429
data/CHANGES CHANGED
@@ -1,3 +1,11 @@
1
+ == 1.2.5 - 11-Jul-2014
2
+ * Added a Gemfile, mostly for Travis CI.
3
+ * Added rake as a development dependency.
4
+ * Revert back to hash syntax supported by 1.9.x.
5
+ * Removed rubyforge_project from gemspec.
6
+ * Updated the tests for File.sparse? so that it doesn't rely on
7
+ an external file.
8
+
1
9
  == 1.2.4 - 25-Feb-2014
2
10
  * The File.binary method now always returns false for images. It is meant to
3
11
  detect executables, shared objects, etc. Use File.image? to detect images.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'structured_warnings'
4
+
5
+ group :production do
6
+ gem 'win32-file' if File::ALT_SEPARATOR
7
+ end
8
+
9
+ group :test do
10
+ gem 'rake'
11
+ gem 'test-unit'
12
+ end
data/MANIFEST CHANGED
@@ -1,17 +1,17 @@
1
- * CHANGES
2
- * README
3
- * MANIFEST
4
- * Rakefile
5
- * ptools.gemspec
6
- * lib/ptools.rb
7
- * test/test_constants.rb
8
- * test/test_head.rb
9
- * test/test_image.rb
10
- * test/test_middle.rb
11
- * test/test_nlconvert.rb
12
- * test/test_null.rb
13
- * test/test_tail.rb
14
- * test/test_touch.rb
15
- * test/test_wc.rb
16
- * test/test_which.rb
17
- * test/test_whereis.rb
1
+ * CHANGES
2
+ * README
3
+ * MANIFEST
4
+ * Rakefile
5
+ * ptools.gemspec
6
+ * lib/ptools.rb
7
+ * test/test_constants.rb
8
+ * test/test_head.rb
9
+ * test/test_image.rb
10
+ * test/test_middle.rb
11
+ * test/test_nlconvert.rb
12
+ * test/test_null.rb
13
+ * test/test_tail.rb
14
+ * test/test_touch.rb
15
+ * test/test_wc.rb
16
+ * test/test_which.rb
17
+ * test/test_whereis.rb
data/README CHANGED
@@ -28,9 +28,8 @@
28
28
  File.nl_convert("myfile", "newfile", "dos")
29
29
 
30
30
  == Known Bugs
31
- None known. Please report any bugs on the github or RubyForge project page.
31
+ None known. Please report any bugs on the github project page.
32
32
 
33
- http://www.rubyforge.org/projects/shards
34
33
  http://www.github.com/djberg96/ptools
35
34
 
36
35
  == Acknowledgements
@@ -53,7 +52,7 @@
53
52
  Artistic 2.0
54
53
 
55
54
  == Copyright
56
- (C) 2003-2012 Daniel J. Berger
55
+ (C) 2003-2014 Daniel J. Berger
57
56
  All Rights Reserved.
58
57
 
59
58
  == Warranty
data/Rakefile CHANGED
@@ -29,7 +29,7 @@ namespace 'gem' do
29
29
  desc 'Install the ptools gem'
30
30
  task :install => [:create] do
31
31
  file = Dir["*.gem"].first
32
- sh "gem install #{file}"
32
+ sh "gem install -l #{file}"
33
33
  end
34
34
  end
35
35
 
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.2.4'
6
+ PTOOLS_VERSION = '1.2.5'
7
7
 
8
8
  # :stopdoc:
9
9
 
@@ -292,7 +292,7 @@ class File
292
292
  raise ArgumentError, "Invalid platform string"
293
293
  end
294
294
 
295
- orig = $\ # AKA $OUTPUT_RECORD_SEPARATOR
295
+ orig = $\ # $OUTPUT_RECORD_SEPARATOR
296
296
  $\ = format
297
297
 
298
298
  if old_file == new_file
@@ -418,11 +418,11 @@ class File
418
418
  end
419
419
 
420
420
  def self.jpg?(file)
421
- IO.read(file, 10, encoding: 'binary') == "\377\330\377\340\000\020JFIF".force_encoding(Encoding::BINARY)
421
+ IO.read(file, 10, :encoding => 'binary') == "\377\330\377\340\000\020JFIF".force_encoding(Encoding::BINARY)
422
422
  end
423
423
 
424
424
  def self.png?(file)
425
- IO.read(file, 4, encoding: 'binary') == "\211PNG".force_encoding(Encoding::BINARY)
425
+ IO.read(file, 4, :encoding => 'binary') == "\211PNG".force_encoding(Encoding::BINARY)
426
426
  end
427
427
 
428
428
  def self.gif?(file)
data/ptools.gemspec CHANGED
@@ -3,7 +3,7 @@ require 'rbconfig'
3
3
 
4
4
  Gem::Specification.new do |gem|
5
5
  gem.name = 'ptools'
6
- gem.version = '1.2.4'
6
+ gem.version = '1.2.5'
7
7
  gem.license = 'Artistic 2.0'
8
8
  gem.author = 'Daniel J. Berger'
9
9
  gem.email = 'djberg96@gmail.com'
@@ -12,7 +12,6 @@ Gem::Specification.new do |gem|
12
12
  gem.test_files = Dir['test/test*']
13
13
  gem.files = Dir['**/*'] << '.gemtest'
14
14
 
15
- gem.rubyforge_project = 'shards'
16
15
  gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
17
16
 
18
17
  gem.description = <<-EOF
@@ -21,6 +20,7 @@ Gem::Specification.new do |gem|
21
20
  File.null to return the null device on your platform, and so on.
22
21
  EOF
23
22
 
23
+ gem.add_development_dependency('rake')
24
24
  gem.add_development_dependency('test-unit', '>= 2.5.0')
25
25
 
26
26
  if File::ALT_SEPARATOR
@@ -15,7 +15,7 @@ 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.2.4', File::PTOOLS_VERSION)
18
+ assert_equal('1.2.5', File::PTOOLS_VERSION)
19
19
  end
20
20
 
21
21
  test "IMAGE_EXT constant is set to array of values" do
@@ -10,13 +10,13 @@ require 'ptools'
10
10
  class TC_IsSparse < Test::Unit::TestCase
11
11
  def self.startup
12
12
  Dir.chdir("test") if File.exist?("test")
13
- @@win = RbConfig::CONFIG['host_os'] =~ /windows|mswin|dos|cygwin|mingw/i
13
+ @@win = File::ALT_SEPARATOR
14
14
  @@osx = RbConfig::CONFIG['host_os'] =~ /darwin|osx/i
15
- @@sun = RbConfig::CONFIG['host_os'] =~ /sunos|solaris/i
15
+ system("dd of=test_sparse bs=1k seek=5120 count=0 2>/dev/null") unless @@win
16
16
  end
17
17
 
18
18
  def setup
19
- @sparse_file = @@sun ? '/var/adm/lastlog' : '/var/log/lastlog'
19
+ @sparse_file = 'test_sparse'
20
20
  @non_sparse_file = File.expand_path(File.basename(__FILE__))
21
21
  end
22
22
 
@@ -46,4 +46,8 @@ class TC_IsSparse < Test::Unit::TestCase
46
46
  @sparse_file = nil
47
47
  @non_sparse_file = nil
48
48
  end
49
+
50
+ def self.shutdown
51
+ File.delete('test_sparse') if File.exist?('test_sparse')
52
+ end
49
53
  end
data/test/test_null.rb CHANGED
@@ -1,40 +1,40 @@
1
- #####################################################################
2
- # test_null.rb
3
- #
4
- # Test case for the File.null method. You should run this test via
5
- # the 'rake test_null' task.
6
- #####################################################################
7
- require 'rubygems'
8
- gem 'test-unit'
9
-
10
- require 'test/unit'
11
- require 'ptools'
12
-
13
- class TC_FileNull < Test::Unit::TestCase
14
- def setup
15
- @nulls = ['/dev/null', 'NUL', 'NIL:', 'NL:']
16
- end
17
-
18
- test "null method basic functionality" do
19
- assert_respond_to(File, :null)
20
- assert_nothing_raised{ File.null }
21
- end
22
-
23
- test "null method returns expected results" do
24
- assert_kind_of(String, File.null)
25
- assert(@nulls.include?(File.null))
26
- end
27
-
28
- test "null method does not accept any arguments" do
29
- assert_raises(ArgumentError){ File.null(1) }
30
- end
31
-
32
- test "null_device is an alias for null" do
33
- assert_respond_to(File, :null_device)
34
- assert_alias_method(File, :null_device, :null)
35
- end
36
-
37
- def teardown
38
- @nulls = nil
39
- end
40
- end
1
+ #####################################################################
2
+ # test_null.rb
3
+ #
4
+ # Test case for the File.null method. You should run this test via
5
+ # the 'rake test_null' task.
6
+ #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
10
+ require 'test/unit'
11
+ require 'ptools'
12
+
13
+ class TC_FileNull < Test::Unit::TestCase
14
+ def setup
15
+ @nulls = ['/dev/null', 'NUL', 'NIL:', 'NL:']
16
+ end
17
+
18
+ test "null method basic functionality" do
19
+ assert_respond_to(File, :null)
20
+ assert_nothing_raised{ File.null }
21
+ end
22
+
23
+ test "null method returns expected results" do
24
+ assert_kind_of(String, File.null)
25
+ assert(@nulls.include?(File.null))
26
+ end
27
+
28
+ test "null method does not accept any arguments" do
29
+ assert_raises(ArgumentError){ File.null(1) }
30
+ end
31
+
32
+ test "null_device is an alias for null" do
33
+ assert_respond_to(File, :null_device)
34
+ assert_alias_method(File, :null_device, :null)
35
+ end
36
+
37
+ def teardown
38
+ @nulls = nil
39
+ end
40
+ end
data/test/test_whereis.rb CHANGED
@@ -1,98 +1,98 @@
1
- ######################################################################
2
- # test_whereis.rb
3
- #
4
- # Tests for the File.whereis method.
5
- ######################################################################
6
- require 'rubygems'
7
- require 'test-unit'
8
- require 'ptools'
9
- require 'rbconfig'
10
-
11
- class TC_Ptools_Whereis < Test::Unit::TestCase
12
- def self.startup
13
- @@windows = File::ALT_SEPARATOR
14
- @@ruby = RUBY_PLATFORM == 'java' ? 'jruby' : 'ruby'
15
- end
16
-
17
- def setup
18
- @bin_dir = RbConfig::CONFIG['bindir']
19
- @expected_locs = [File.join(@bin_dir, @@ruby)]
20
-
21
- if @@windows
22
- @expected_locs[0] << '.exe'
23
- @expected_locs[0].tr!("/", "\\")
24
- end
25
-
26
- unless @@windows
27
- @expected_locs << "/usr/local/bin/#{@@ruby}"
28
- @expected_locs << "/opt/sfw/bin/#{@@ruby}"
29
- @expected_locs << "/opt/bin/#{@@ruby}"
30
- @expected_locs << "/usr/bin/#{@@ruby}"
31
- end
32
-
33
- @actual_locs = nil
34
- end
35
-
36
- test "whereis basic functionality" do
37
- assert_respond_to(File, :whereis)
38
- assert_nothing_raised{ File.whereis('ruby') }
39
- assert_kind_of([Array, NilClass], File.whereis('ruby'))
40
- end
41
-
42
- test "whereis accepts an optional second argument" do
43
- assert_nothing_raised{ File.whereis('ruby', '/usr/bin:/usr/local/bin') }
44
- end
45
-
46
- test "whereis returns expected values" do
47
- assert_nothing_raised{ @actual_locs = File.whereis(@@ruby) }
48
- assert_kind_of(Array, @actual_locs)
49
- assert_true((@expected_locs & @actual_locs).size > 0)
50
- end
51
-
52
- test "whereis returns nil if program not found" do
53
- assert_nil(File.whereis('xxxyyy'))
54
- end
55
-
56
- test "whereis returns nil if program cannot be found in provided path" do
57
- assert_nil(File.whereis(@@ruby, '/foo/bar'))
58
- end
59
-
60
- test "whereis returns single element array or nil if absolute path is provided" do
61
- absolute = File.join(@bin_dir, @@ruby)
62
- absolute << '.exe' if @@windows
63
-
64
- assert_equal([absolute], File.whereis(absolute))
65
- assert_nil(File.whereis("/foo/bar/baz/#{@@ruby}"))
66
- end
67
-
68
- test "whereis works with an explicit extension on ms windows" do
69
- omit_unless(@@windows, 'test skipped except on MS Windows')
70
- assert_not_nil(File.whereis(@@ruby + '.exe'))
71
- end
72
-
73
- test "whereis requires at least one argument" do
74
- assert_raise(ArgumentError){ File.whereis }
75
- end
76
-
77
- test "whereis returns unique paths only" do
78
- assert_true(File.whereis(@@ruby) == File.whereis(@@ruby).uniq)
79
- end
80
-
81
- test "whereis accepts a maximum of two arguments" do
82
- assert_raise(ArgumentError){ File.whereis(@@ruby, 'foo', 'bar') }
83
- end
84
-
85
- test "the second argument to whereis cannot be nil or empty" do
86
- assert_raise(ArgumentError){ File.whereis(@@ruby, nil) }
87
- assert_raise(ArgumentError){ File.whereis(@@ruby, '') }
88
- end
89
-
90
- def teardown
91
- @expected_locs = nil
92
- @actual_locs = nil
93
- end
94
-
95
- def self.shutdown
96
- @@windows = nil
97
- end
98
- end
1
+ ######################################################################
2
+ # test_whereis.rb
3
+ #
4
+ # Tests for the File.whereis method.
5
+ ######################################################################
6
+ require 'rubygems'
7
+ require 'test-unit'
8
+ require 'ptools'
9
+ require 'rbconfig'
10
+
11
+ class TC_Ptools_Whereis < Test::Unit::TestCase
12
+ def self.startup
13
+ @@windows = File::ALT_SEPARATOR
14
+ @@ruby = RUBY_PLATFORM == 'java' ? 'jruby' : 'ruby'
15
+ end
16
+
17
+ def setup
18
+ @bin_dir = RbConfig::CONFIG['bindir']
19
+ @expected_locs = [File.join(@bin_dir, @@ruby)]
20
+
21
+ if @@windows
22
+ @expected_locs[0] << '.exe'
23
+ @expected_locs[0].tr!("/", "\\")
24
+ end
25
+
26
+ unless @@windows
27
+ @expected_locs << "/usr/local/bin/#{@@ruby}"
28
+ @expected_locs << "/opt/sfw/bin/#{@@ruby}"
29
+ @expected_locs << "/opt/bin/#{@@ruby}"
30
+ @expected_locs << "/usr/bin/#{@@ruby}"
31
+ end
32
+
33
+ @actual_locs = nil
34
+ end
35
+
36
+ test "whereis basic functionality" do
37
+ assert_respond_to(File, :whereis)
38
+ assert_nothing_raised{ File.whereis('ruby') }
39
+ assert_kind_of([Array, NilClass], File.whereis('ruby'))
40
+ end
41
+
42
+ test "whereis accepts an optional second argument" do
43
+ assert_nothing_raised{ File.whereis('ruby', '/usr/bin:/usr/local/bin') }
44
+ end
45
+
46
+ test "whereis returns expected values" do
47
+ assert_nothing_raised{ @actual_locs = File.whereis(@@ruby) }
48
+ assert_kind_of(Array, @actual_locs)
49
+ assert_true((@expected_locs & @actual_locs).size > 0)
50
+ end
51
+
52
+ test "whereis returns nil if program not found" do
53
+ assert_nil(File.whereis('xxxyyy'))
54
+ end
55
+
56
+ test "whereis returns nil if program cannot be found in provided path" do
57
+ assert_nil(File.whereis(@@ruby, '/foo/bar'))
58
+ end
59
+
60
+ test "whereis returns single element array or nil if absolute path is provided" do
61
+ absolute = File.join(@bin_dir, @@ruby)
62
+ absolute << '.exe' if @@windows
63
+
64
+ assert_equal([absolute], File.whereis(absolute))
65
+ assert_nil(File.whereis("/foo/bar/baz/#{@@ruby}"))
66
+ end
67
+
68
+ test "whereis works with an explicit extension on ms windows" do
69
+ omit_unless(@@windows, 'test skipped except on MS Windows')
70
+ assert_not_nil(File.whereis(@@ruby + '.exe'))
71
+ end
72
+
73
+ test "whereis requires at least one argument" do
74
+ assert_raise(ArgumentError){ File.whereis }
75
+ end
76
+
77
+ test "whereis returns unique paths only" do
78
+ assert_true(File.whereis(@@ruby) == File.whereis(@@ruby).uniq)
79
+ end
80
+
81
+ test "whereis accepts a maximum of two arguments" do
82
+ assert_raise(ArgumentError){ File.whereis(@@ruby, 'foo', 'bar') }
83
+ end
84
+
85
+ test "the second argument to whereis cannot be nil or empty" do
86
+ assert_raise(ArgumentError){ File.whereis(@@ruby, nil) }
87
+ assert_raise(ArgumentError){ File.whereis(@@ruby, '') }
88
+ end
89
+
90
+ def teardown
91
+ @expected_locs = nil
92
+ @actual_locs = nil
93
+ end
94
+
95
+ def self.shutdown
96
+ @@windows = nil
97
+ end
98
+ end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ptools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: universal-mingw32
6
6
  authors:
7
7
  - Daniel J. Berger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-25 00:00:00.000000000 Z
11
+ date: 2014-07-11 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '>='
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: test-unit
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +66,7 @@ extra_rdoc_files:
52
66
  files:
53
67
  - .gemtest
54
68
  - CHANGES
69
+ - Gemfile
55
70
  - MANIFEST
56
71
  - README
57
72
  - Rakefile
@@ -94,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
109
  - !ruby/object:Gem::Version
95
110
  version: '0'
96
111
  requirements: []
97
- rubyforge_project: shards
112
+ rubyforge_project:
98
113
  rubygems_version: 2.2.2
99
114
  signing_key:
100
115
  specification_version: 4