ptools 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,11 @@
1
+ == 1.1.7 - 28-Jul-2009
2
+ * Now compatible with Ruby 1.9.x.
3
+ * Replaced RUBY_PLATFORM with rbconfig check for the sake of other
4
+ implementations, such as JRuby.
5
+ * Updated the tests to be more friendly to JRuby.
6
+ * Added Test::Unit 2.x as a development dependency.
7
+ * Renamed the test files.
8
+
1
9
  == 1.1.6 - 31-Aug-2007
2
10
  * Fixed the File.touch method so that it doesn't whack existing files. Thanks
3
11
  go to Thomas Preymesser for the spot.
data/MANIFEST CHANGED
@@ -4,17 +4,16 @@
4
4
  * Rakefile
5
5
  * ptools.gemspec
6
6
  * lib/ptools.rb
7
- * test/ts_all.rb
8
- * test/tc_constants.rb
9
- * test/tc_head.rb
10
- * test/tc_image.rb
11
- * test/tc_middle.rb
12
- * test/tc_nlconvert.rb
13
- * test/tc_null.rb
14
- * test/tc_tail.rb
15
- * test/tc_touch.rb
16
- * test/tc_wc.rb
17
- * test/tc_which.rb
18
- * test/tc_whereis.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
19
18
  * test/test_file.txt
20
19
  * test/test_file2.txt
data/README CHANGED
@@ -1,9 +1,9 @@
1
1
  == Description
2
- The ptools (power tools) package is an additional set of commands for the
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
- Ruby 1.8.0 or later is recommended but not required.
6
+ Ruby 1.8.0 or later is recommended.
7
7
  On MS Windows you will need win32-file 0.5.4 or later.
8
8
 
9
9
  == Installation
@@ -35,14 +35,15 @@
35
35
  == Known Bugs
36
36
  There is a bug in 1.6.x that can cause $\ characters to accumulate when
37
37
  converting to DOS or MAC format if nl_convert is run multiple times on
38
- the same file. This appears to be fixed in 1.8.x.
38
+ the same file. This appears to be fixed in 1.8.x. You're not still running
39
+ Ruby 1.6.x are you? I would hope not.
39
40
 
40
41
  One or two of The File.nl_convert tests may fail on Windows. You can
41
42
  ignore these.
42
43
 
43
44
  == Acknowledgements
44
45
  The which() method was adopted from the FileWhich code posted by Michael
45
- Granger on http://www.rubygarden.org. The 'whereis' command is a minor
46
+ Granger on http://www.rubygarden.org. The 'whereis' command is a minor
46
47
  modification of that code as well.
47
48
 
48
49
  The nl_convert() method was adopted (somewhat) from the nlcvt program
@@ -58,10 +59,10 @@
58
59
  Add whatever other tools people think might be useful.
59
60
 
60
61
  == License
61
- Ruby's
62
+ Artistic 2.0
62
63
 
63
64
  == Copyright
64
- (C) 2003-2007 Daniel J. Berger
65
+ (C) 2003-2009 Daniel J. Berger
65
66
  All Rights Reserved.
66
67
 
67
68
  == Warranty
data/lib/ptools.rb CHANGED
@@ -1,11 +1,12 @@
1
- require 'win32/file' if RUBY_PLATFORM.match('mswin')
1
+ require 'rbconfig'
2
+ require 'win32/file' if Config::CONFIG['host_os'].match('mswin')
2
3
 
3
4
  class File
4
- PTOOLS_VERSION = '1.1.6'
5
+ PTOOLS_VERSION = '1.1.7'
5
6
 
6
7
  # :stopdoc:
7
8
 
8
- if RUBY_PLATFORM.match('mswin')
9
+ if Config::CONFIG['host_os'].match('mswin')
9
10
  IS_WINDOWS = true
10
11
  begin
11
12
  WIN32EXTS = ENV['PATHEXT'].split(';').map{ |e| e.downcase }
@@ -43,7 +44,7 @@ class File
43
44
  # Based on information from http://en.wikipedia.org/wiki//dev/null
44
45
  #
45
46
  def self.null
46
- case RUBY_PLATFORM
47
+ case Config::CONFIG['host_os']
47
48
  when /mswin/i
48
49
  'NUL'
49
50
  when /amiga/i
@@ -76,7 +77,7 @@ class File
76
77
  # Returns nil if not found.
77
78
  #
78
79
  def self.which(program, path=ENV['PATH'])
79
- programs = program.to_a
80
+ programs = [program]
80
81
 
81
82
  # If no file extension is provided on Windows, try the WIN32EXT's in turn
82
83
  if IS_WINDOWS && File.extname(program).empty?
@@ -116,7 +117,7 @@ class File
116
117
  #
117
118
  def self.whereis(program, path=ENV['PATH'])
118
119
  dirs = []
119
- programs = program.to_a
120
+ programs = [program]
120
121
 
121
122
  # If no file extension is provided on Windows, try the WIN32EXT's in turn
122
123
  if IS_WINDOWS && File.extname(program).empty?
@@ -219,24 +220,32 @@ class File
219
220
  $\ = format
220
221
 
221
222
  if filename == newfilename
222
- require "ftools"
223
- require "tempfile"
224
- tf = Tempfile.new("temp")
225
- tf.open
226
- IO.foreach(filename){ |line|
227
- line.chomp!
228
- tf.print line
229
- }
230
- tf.close
223
+ require 'fileutils'
224
+ require 'tempfile'
225
+
226
+ begin
227
+ tf = Tempfile.new('ruby_temp_' + Time.now.to_s)
228
+ tf.open
229
+
230
+ IO.foreach(filename){ |line|
231
+ line.chomp!
232
+ tf.print line
233
+ }
234
+ ensure
235
+ tf.close if tf && !tf.closed?
236
+ end
231
237
  File.delete(filename)
232
- File.copy(tf.path,filename)
238
+ FileUtils.cp(tf.path, filename)
233
239
  else
234
- nf = File.new(newfilename,"w+")
235
- IO.foreach(filename){ |line|
236
- line.chomp!
237
- nf.print line
238
- }
239
- nf.close
240
+ begin
241
+ nf = File.new(newfilename, 'w')
242
+ IO.foreach(filename){ |line|
243
+ line.chomp!
244
+ nf.print line
245
+ }
246
+ ensure
247
+ nf.close if nf && !nf.closed?
248
+ end
240
249
  end
241
250
 
242
251
  $\ = orig
@@ -4,12 +4,18 @@
4
4
  # Test case for the File.binary? method. You should run this test
5
5
  # via the 'rake test_binary' task.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_Binary < Test::Unit::TestCase
14
+ def self.startup
15
+ Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
11
18
  def setup
12
- Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
13
19
  @text_file = 'test_file1.txt'
14
20
  end
15
21
 
@@ -1,28 +1,32 @@
1
1
  #####################################################################
2
- # tc_constants.rb
2
+ # test_constants.rb
3
3
  #
4
4
  # Tests the constants that have been defined for our package. This
5
5
  # test case should be run via the 'rake test_constants' task.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
11
+ require 'rbconfig'
8
12
  require 'ptools'
9
13
 
10
14
  class TC_Constants < Test::Unit::TestCase
11
15
  def test_version
12
- assert_equal('1.1.6', File::PTOOLS_VERSION)
16
+ assert_equal('1.1.7', File::PTOOLS_VERSION)
13
17
  end
14
18
 
15
19
  def test_image_ext
16
20
  assert_equal(%w/.bmp .gif .jpeg .jpg .png/, File::IMAGE_EXT.sort)
17
21
  end
18
22
 
19
- if RUBY_PLATFORM.match('mswin')
20
- def test_windows
21
- assert_not_nil(File::IS_WINDOWS)
22
- end
23
+ def test_windows
24
+ omit_unless(Config::CONFIG['host_os'].match('mswin'), "Skipping on Unix systems")
25
+ assert_not_nil(File::IS_WINDOWS)
26
+ end
23
27
 
24
- def test_win32exts
25
- assert_not_nil(File::WIN32EXTS)
26
- end
28
+ def test_win32exts
29
+ omit_unless(Config::CONFIG['host_os'].match('mswin'), "Skipping on Unix systems")
30
+ assert_not_nil(File::WIN32EXTS)
27
31
  end
28
32
  end
@@ -1,20 +1,24 @@
1
1
  ######################################################################
2
- # tc_head.rb
2
+ # test_head.rb
3
3
  #
4
4
  # Test case for the File.head method. This test should be run via
5
5
  # the 'rake test_head' task.
6
6
  ######################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_FileHead < Test::Unit::TestCase
11
- def setup
12
- Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
14
+ def self.startup
15
+ Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
18
+ def setup
13
19
  @test_file = 'test_file1.txt'
14
-
15
20
  @expected_head1 = ["line1\n","line2\n","line3\n","line4\n","line5\n"]
16
21
  @expected_head1.push("line6\n","line7\n","line8\n","line9\n","line10\n")
17
-
18
22
  @expected_head2 = ["line1\n","line2\n","line3\n","line4\n","line5\n"]
19
23
  end
20
24
 
@@ -1,15 +1,21 @@
1
1
  #####################################################################
2
- # tc_image.rb
2
+ # test_image.rb
3
3
  #
4
4
  # Test case for the File.image? method. You should run this test
5
5
  # via the 'rake test_image' task.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_Ptools_Image < Test::Unit::TestCase
11
- def setup
12
- Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
14
+ def self.startup
15
+ Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
18
+ def setup
13
19
  @text_file = 'test_file1.txt'
14
20
  end
15
21
 
@@ -1,15 +1,21 @@
1
1
  #####################################################################
2
- # tc_middle.rb
2
+ # test_middle.rb
3
3
  #
4
4
  # Test case for the File.middle method. You should run this test
5
5
  # via the 'rake test_middle' task.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_FileMiddle < Test::Unit::TestCase
11
- def setup
14
+ def self.startup
12
15
  Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
18
+ def setup
13
19
  @test_file = 'test_file1.txt'
14
20
 
15
21
  @expected_middle1 = ["line10\n", "line11\n", "line12\n", "line13\n", "line14\n"]
@@ -1,15 +1,21 @@
1
1
  #####################################################################
2
- # tc_nlconvert.rb
2
+ # test_nlconvert.rb
3
3
  #
4
4
  # Test case for the File.nl_convert method. You should run this
5
5
  # test via the 'rake test_nlconvert' task.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_FileNLConvert < Test::Unit::TestCase
11
- def setup
14
+ def self.startup
12
15
  Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
18
+ def setup
13
19
  @test_file1 = 'test_file1.txt'
14
20
  @test_file2 = 'test_file2.txt'
15
21
  @dos_file = 'dos_test_file.txt'
@@ -35,7 +41,7 @@ class TC_FileNLConvert < Test::Unit::TestCase
35
41
  end
36
42
 
37
43
  def test_nl_convert_to_mac
38
- if RUBY_PLATFORM.match("mswin")
44
+ if Config::CONFIG['host_os'].match("mswin")
39
45
  msg = "** test may fail on MS Windows **"
40
46
  else
41
47
  msg = "** mac file should be the same size (or larger), but isn't **"
@@ -1,5 +1,5 @@
1
1
  #####################################################################
2
- # tc_null.rb
2
+ # test_null.rb
3
3
  #
4
4
  # Test case for the File.null method. You should run this test via
5
5
  # the 'rake test_null' task.
@@ -1,15 +1,21 @@
1
1
  #####################################################################
2
- # tc_tail.rb
2
+ # test_tail.rb
3
3
  #
4
4
  # Test case for the File.tail method. This test should be run via
5
5
  # the 'rake test_tail' task.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_FileTail < Test::Unit::TestCase
11
- def setup
14
+ def self.startup
12
15
  Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
18
+ def setup
13
19
  @test_file = 'test_file1.txt'
14
20
 
15
21
  @expected_tail1 = ["line16\n","line17\n","line18\n","line19\n"]
@@ -4,12 +4,18 @@
4
4
  # Test case for the File.touch method. This test should be run
5
5
  # via the 'rake test_touch task'.
6
6
  #####################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
 
10
13
  class TC_FileTouch < Test::Unit::TestCase
11
- def setup
12
- Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
14
+ def self.startup
15
+ Dir.chdir('test') unless File.basename(Dir.pwd) == 'test'
16
+ end
17
+
18
+ def setup
13
19
  @test_file = 'delete.this'
14
20
  @xfile = 'test_file1.txt'
15
21
  end
@@ -1,5 +1,5 @@
1
1
  #####################################################################
2
- # tc_wc.rb
2
+ # test_wc.rb
3
3
  #
4
4
  # Test case for the File.wc method. This test should be run via
5
5
  # the 'rake test_wc' task.
@@ -8,8 +8,11 @@ require 'test/unit'
8
8
  require 'ptools'
9
9
 
10
10
  class TC_FileWC < Test::Unit::TestCase
11
- def setup
12
- Dir.chdir('test') if File.exists?('test')
11
+ def self.startup
12
+ Dir.chdir('test') if File.exists?('test')
13
+ end
14
+
15
+ def setup
13
16
  @test_file = 'test_file1.txt'
14
17
  end
15
18
 
@@ -1,9 +1,12 @@
1
1
  ######################################################################
2
- # tc_whereis.rb
2
+ # test_whereis.rb
3
3
  #
4
4
  # Test case for the File.whereis method. This test should be run
5
5
  # via the 'rake test_whereis' task.
6
6
  ######################################################################
7
+ require 'rubygems'
8
+ gem 'test-unit'
9
+
7
10
  require 'test/unit'
8
11
  require 'ptools'
9
12
  require 'rbconfig'
@@ -12,7 +15,8 @@ include Config
12
15
  class TC_FileWhereis < Test::Unit::TestCase
13
16
  def setup
14
17
  @expected_locs = [CONFIG['bindir']]
15
- if RUBY_PLATFORM.match('mswin')
18
+
19
+ if Config::CONFIG['host_os'].match('mswin')
16
20
  @expected_locs = ["c:\\ruby\\bin\\ruby.exe"]
17
21
  else
18
22
  @expected_locs << '/usr/local/bin/ruby'
@@ -1,12 +1,15 @@
1
1
  #####################################################################
2
- # tc_which.rb
2
+ # test_which.rb
3
3
  #
4
4
  # Test case for the File.which method. You should run this test
5
5
  # via the 'rake test_which' rake task.
6
6
  #
7
- # NOTE: I make the assumption that Ruby is in your PATH for these
8
- # tests.
7
+ # NOTE: I make the assumption that Ruby (or JRuby) is in your
8
+ # PATH for these tests.
9
9
  #####################################################################
10
+ require 'rubygems'
11
+ gem 'test-unit'
12
+
10
13
  require 'test/unit'
11
14
  require 'rbconfig'
12
15
  require 'ptools'
@@ -14,9 +17,10 @@ include Config
14
17
 
15
18
  class TC_FileWhich < Test::Unit::TestCase
16
19
  def setup
20
+ @ruby = RUBY_PLATFORM.match('java') ? 'jruby' : 'ruby'
17
21
  @exe = File.join(CONFIG["bindir"], CONFIG["ruby_install_name"])
18
22
 
19
- if RUBY_PLATFORM.match('mswin')
23
+ if Config::CONFIG['host_os'].match('mswin')
20
24
  @exe.tr!('/','\\')
21
25
  @exe << ".exe"
22
26
  end
@@ -24,23 +28,24 @@ class TC_FileWhich < Test::Unit::TestCase
24
28
 
25
29
  def test_which_basic
26
30
  assert_respond_to(File, :which)
27
- assert_nothing_raised{ File.which("ruby") }
28
- assert_nothing_raised{ File.which("ruby", "/usr/bin:/usr/local/bin") }
31
+ assert_nothing_raised{ File.which(@ruby) }
32
+ assert_nothing_raised{ File.which(@ruby, "/usr/bin:/usr/local/bin") }
29
33
  end
30
34
 
31
35
  def test_which_expected_return_values
32
- assert_kind_of(String, File.which("ruby"))
33
- assert_equal(@exe, File.which("ruby"))
34
- assert_equal(nil, File.which("ruby", "/bogus/path"))
36
+ assert_kind_of(String, File.which(@ruby))
37
+ assert_equal(@exe, File.which(@ruby))
38
+ assert_equal(nil, File.which(@ruby, "/bogus/path"))
35
39
  assert_equal(nil, File.which("blahblah"))
36
40
  end
37
41
 
38
42
  def test_which_expected_errors
39
43
  assert_raises(ArgumentError){ File.which }
40
- assert_raises(ArgumentError){ File.which("ruby", "foo", "bar") }
44
+ assert_raises(ArgumentError){ File.which(@ruby, "foo", "bar") }
41
45
  end
42
46
 
43
47
  def teardown
44
- @exe = nil
48
+ @exe = nil
49
+ @ruby = nil
45
50
  end
46
51
  end
metadata CHANGED
@@ -1,67 +1,96 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.9.4
3
- specification_version: 1
4
2
  name: ptools
5
3
  version: !ruby/object:Gem::Version
6
- version: 1.1.6
7
- date: 2007-08-31 00:00:00 -06:00
8
- summary: Extra methods for the File class
9
- require_paths:
10
- - lib
11
- email: djberg96@gmail.com
12
- homepage: http://www.rubyforge.org/projects/shards
13
- rubyforge_project:
14
- description:
15
- autorequire:
16
- default_executable:
17
- bindir: bin
18
- has_rdoc: true
19
- required_ruby_version: !ruby/object:Gem::Version::Requirement
20
- requirements:
21
- - - ">"
22
- - !ruby/object:Gem::Version
23
- version: 0.0.0
24
- version:
4
+ version: 1.1.7
25
5
  platform: ruby
26
- signing_key:
27
- cert_chain:
28
- post_install_message:
29
6
  authors:
30
7
  - Daniel J. Berger
31
- files:
32
- - lib/ptools.rb
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-07-28 00:00:00 -06:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: test-unit
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 2.0.3
24
+ version:
25
+ description: " The ptools (power tools) library provides several handy methods to\n Ruby's core File class, such as File.which for finding executables,\n File.null to return the null device on your platform, and so on.\n"
26
+ email: djberg96@gmail.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README
33
33
  - CHANGES
34
34
  - MANIFEST
35
- - README
36
- - Rakefile
37
- - test/tc_binary.rb
38
- - test/tc_constants.rb
39
- - test/tc_head.rb
40
- - test/tc_image.rb
41
- - test/tc_middle.rb
42
- - test/tc_nlconvert.rb
43
- - test/tc_null.rb
44
- - test/tc_tail.rb
45
- - test/tc_touch.rb
46
- - test/tc_wc.rb
47
- - test/tc_whereis.rb
48
- - test/tc_which.rb
35
+ files:
36
+ - lib/ptools.rb
37
+ - test/test_binary.rb
38
+ - test/test_constants.rb
49
39
  - test/test_file1.txt
50
40
  - test/test_file2.txt
51
- - test/ts_all.rb
52
- test_files:
53
- - test/ts_all.rb
54
- rdoc_options: []
55
-
56
- extra_rdoc_files:
41
+ - test/test_head.rb
42
+ - test/test_image.rb
43
+ - test/test_middle.rb
44
+ - test/test_nlconvert.rb
45
+ - test/test_null.rb
46
+ - test/test_tail.rb
47
+ - test/test_touch.rb
48
+ - test/test_wc.rb
49
+ - test/test_whereis.rb
50
+ - test/test_which.rb
57
51
  - README
58
52
  - CHANGES
59
53
  - MANIFEST
60
- executables: []
61
-
62
- extensions: []
54
+ has_rdoc: true
55
+ homepage: http://www.rubyforge.org/projects/shards
56
+ licenses:
57
+ - Artistic 2.0
58
+ post_install_message:
59
+ rdoc_options: []
63
60
 
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: "0"
68
+ version:
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ requirements:
71
+ - - ">="
72
+ - !ruby/object:Gem::Version
73
+ version: "0"
74
+ version:
64
75
  requirements: []
65
76
 
66
- dependencies: []
67
-
77
+ rubyforge_project: shards
78
+ rubygems_version: 1.3.5
79
+ signing_key:
80
+ specification_version: 3
81
+ summary: Extra methods for the File class
82
+ test_files:
83
+ - test/test_binary.rb
84
+ - test/test_constants.rb
85
+ - test/test_file1.txt
86
+ - test/test_file2.txt
87
+ - test/test_head.rb
88
+ - test/test_image.rb
89
+ - test/test_middle.rb
90
+ - test/test_nlconvert.rb
91
+ - test/test_null.rb
92
+ - test/test_tail.rb
93
+ - test/test_touch.rb
94
+ - test/test_wc.rb
95
+ - test/test_whereis.rb
96
+ - test/test_which.rb
data/Rakefile DELETED
@@ -1,101 +0,0 @@
1
- require 'rake'
2
- require 'rake/testtask'
3
- require 'rbconfig'
4
- include Config
5
-
6
- desc 'Install the ptools package (non-gem)'
7
- task :install do
8
- sitelibdir = CONFIG["sitelibdir"]
9
- file = "lib/ptools.rb"
10
- FileUtils.cp(file, sitelibdir, :verbose => true)
11
- end
12
-
13
- task :install_gem do
14
- ruby 'ptools.gemspec'
15
- file = Dir["*.gem"].first
16
- sh "gem install #{file}"
17
- end
18
-
19
- Rake::TestTask.new do |t|
20
- t.libs << 'test'
21
- t.verbose = true
22
- t.warning = true
23
- t.test_files = FileList['test/ts_all.rb']
24
- end
25
-
26
- Rake::TestTask.new('test_binary') do |t|
27
- t.libs << 'test'
28
- t.verbose = true
29
- t.warning = true
30
- t.test_files = FileList['test/tc_binary.rb']
31
- end
32
-
33
- Rake::TestTask.new('test_constants') do |t|
34
- t.libs << 'test'
35
- t.verbose = true
36
- t.warning = true
37
- t.test_files = FileList['test/tc_constants.rb']
38
- end
39
-
40
- Rake::TestTask.new('test_head') do |t|
41
- t.libs << 'test'
42
- t.verbose = true
43
- t.warning = true
44
- t.test_files = FileList['test/tc_head.rb']
45
- end
46
-
47
- Rake::TestTask.new('test_middle') do |t|
48
- t.libs << 'test'
49
- t.verbose = true
50
- t.warning = true
51
- t.test_files = FileList['test/tc_middle.rb']
52
- end
53
-
54
- Rake::TestTask.new('test_nlconvert') do |t|
55
- t.libs << 'test'
56
- t.verbose = true
57
- t.warning = true
58
- t.test_files = FileList['test/tc_nlconvert.rb']
59
- end
60
-
61
- Rake::TestTask.new('test_null') do |t|
62
- t.libs << 'test'
63
- t.verbose = true
64
- t.warning = true
65
- t.test_files = FileList['test/tc_null.rb']
66
- end
67
-
68
- Rake::TestTask.new('test_tail') do |t|
69
- t.libs << 'test'
70
- t.verbose = true
71
- t.warning = true
72
- t.test_files = FileList['test/tc_tail.rb']
73
- end
74
-
75
- Rake::TestTask.new('test_touch') do |t|
76
- t.libs << 'test'
77
- t.verbose = true
78
- t.warning = true
79
- t.test_files = FileList['test/tc_touch.rb']
80
- end
81
-
82
- Rake::TestTask.new('test_wc') do |t|
83
- t.libs << 'test'
84
- t.verbose = true
85
- t.warning = true
86
- t.test_files = FileList['test/tc_wc.rb']
87
- end
88
-
89
- Rake::TestTask.new('test_whereis') do |t|
90
- t.libs << 'test'
91
- t.verbose = true
92
- t.warning = true
93
- t.test_files = FileList['test/tc_whereis.rb']
94
- end
95
-
96
- Rake::TestTask.new('test_which') do |t|
97
- t.libs << 'test'
98
- t.verbose = true
99
- t.warning = true
100
- t.test_files = FileList['test/tc_which.rb']
101
- end
data/test/ts_all.rb DELETED
@@ -1,20 +0,0 @@
1
- ########################################
2
- # ts_all.rb
3
- #
4
- # All tests for the ptools package.
5
- ########################################
6
- $LOAD_PATH.unshift(Dir.pwd)
7
- $LOAD_PATH.unshift(Dir.pwd + "/test")
8
-
9
- require 'tc_binary'
10
- require 'tc_constants'
11
- require 'tc_head'
12
- require 'tc_image'
13
- require 'tc_middle'
14
- require 'tc_nlconvert'
15
- require 'tc_null'
16
- require 'tc_tail'
17
- require 'tc_touch'
18
- require 'tc_wc'
19
- require 'tc_which'
20
- require 'tc_whereis'