pathname2 1.6.2 → 1.6.3
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.
- data/CHANGES +6 -0
- data/Rakefile +41 -0
- data/lib/pathname2.rb +5 -5
- data/pathname2.gemspec +37 -0
- data/test/test_pathname.rb +1 -1
- data/test/test_pathname_windows.rb +3 -3
- metadata +7 -5
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.6.3 - 2-Oct-2009
|
2
|
+
* Updated Windows platform handling code to include mingw and cygwin.
|
3
|
+
* Added the :gem rake task.
|
4
|
+
* Minor gemspec updates.
|
5
|
+
* Some minor test suite updates.
|
6
|
+
|
1
7
|
== 1.6.2 - 4-Aug-2009
|
2
8
|
* Now compatible with Ruby 1.9.x.
|
3
9
|
* License changed to Artistic 2.0.
|
data/Rakefile
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rake/clean'
|
3
|
+
require 'rake/testtask'
|
4
|
+
|
5
|
+
desc 'Install pathname2 library (non-gem)'
|
6
|
+
task :install do
|
7
|
+
cp 'lib/pathname2.rb', Config::CONFIG['sitelibdir']
|
8
|
+
end
|
9
|
+
|
10
|
+
desc 'Build the pathname2 gem'
|
11
|
+
task :gem do
|
12
|
+
spec = eval(IO.read('pathname2.gemspec'))
|
13
|
+
Gem::Builder.new(spec).build
|
14
|
+
end
|
15
|
+
|
16
|
+
desc "Install the pathname2 libarary as a gem"
|
17
|
+
task :install_gem => [:gem] do
|
18
|
+
file = Dir["*.gem"].first
|
19
|
+
sh "gem install #{file}"
|
20
|
+
end
|
21
|
+
|
22
|
+
desc 'Run the test suite for the pure Ruby version'
|
23
|
+
Rake::TestTask.new('test') do |t|
|
24
|
+
t.warning = true
|
25
|
+
t.verbose = true
|
26
|
+
|
27
|
+
if Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
|
28
|
+
t.test_files = FileList['test/test_pathname_windows.rb']
|
29
|
+
else
|
30
|
+
t.test_files = FileList['test/test_pathname.rb']
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Run the Pathname benchmark suite'
|
35
|
+
task :benchmark do
|
36
|
+
sh 'ruby -Ilib benchmarks/bench_pathname.rb'
|
37
|
+
end
|
38
|
+
|
39
|
+
desc 'Run the benchmark suite for Pathname#+ vs File.join'
|
40
|
+
task :benchmark_plus do
|
41
|
+
sh 'ruby -Ilib benchmarks/bench_plus.rb'
|
data/lib/pathname2.rb
CHANGED
@@ -41,7 +41,7 @@ require 'facade'
|
|
41
41
|
require 'fileutils'
|
42
42
|
require 'rbconfig'
|
43
43
|
|
44
|
-
if Config::CONFIG['host_os']
|
44
|
+
if Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
|
45
45
|
require 'windows/path'
|
46
46
|
require 'windows/file'
|
47
47
|
require 'windows/error'
|
@@ -70,7 +70,7 @@ class Pathname < String
|
|
70
70
|
|
71
71
|
alias :_plus_ :+ # Used to prevent infinite loops in some cases
|
72
72
|
|
73
|
-
if Config::CONFIG['host_os']
|
73
|
+
if Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
|
74
74
|
include Windows::Path
|
75
75
|
include Windows::File
|
76
76
|
include Windows::Error
|
@@ -79,8 +79,8 @@ class Pathname < String
|
|
79
79
|
|
80
80
|
public
|
81
81
|
|
82
|
-
# The version of
|
83
|
-
VERSION = '1.6.
|
82
|
+
# The version of the pathname2 library
|
83
|
+
VERSION = '1.6.3'
|
84
84
|
|
85
85
|
# The maximum length of a path
|
86
86
|
MAXPATH = 1024 unless defined? MAXPATH # Yes, I willfully violate POSIX
|
@@ -121,7 +121,7 @@ class Pathname < String
|
|
121
121
|
end
|
122
122
|
|
123
123
|
@sep = File::ALT_SEPARATOR || File::SEPARATOR
|
124
|
-
@win = Config::CONFIG['host_os']
|
124
|
+
@win = Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
|
125
125
|
|
126
126
|
# Handle File URL's. The separate methods for Windows are necessary
|
127
127
|
# because Ruby's URI class does not (currently) parse absolute file URL's
|
data/pathname2.gemspec
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
Gem::Specification.new do |gem|
|
4
|
+
gem.name = 'pathname2'
|
5
|
+
gem.version = '1.6.3'
|
6
|
+
gem.author = 'Daniel J. Berger'
|
7
|
+
gem.license = 'Artistic 2.0'
|
8
|
+
gem.email = 'djberg96@gmail.com'
|
9
|
+
gem.homepage = 'http://www.rubyforge.org/projects/shards'
|
10
|
+
gem.summary = 'An alternate implementation of the Pathname class'
|
11
|
+
gem.has_rdoc = true
|
12
|
+
gem.files = Dir['**/*'].reject{ |f| f.include?('CVS') }
|
13
|
+
|
14
|
+
gem.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
15
|
+
gem.rubyforge_project = 'shards'
|
16
|
+
|
17
|
+
gem.add_dependency('facade', '>= 1.0.4')
|
18
|
+
gem.add_development_dependency('test-unit', '>= 2.0.3')
|
19
|
+
|
20
|
+
if Config::CONFIG['host_os'] =~ /mswin|win32|dos|cygwin|mingw/i
|
21
|
+
gem.test_file = 'test/test_pathname_windows.rb'
|
22
|
+
gem.add_dependency('windows-pr', '>= 0.8.6')
|
23
|
+
gem.platform = Gem::Platform::CURRENT
|
24
|
+
else
|
25
|
+
gem.test_file = 'test/test_pathname.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
gem.description = <<-EOF
|
29
|
+
The pathname2 library provides an implementation of the Pathname
|
30
|
+
class different from the one that ships as part of the Ruby standard
|
31
|
+
library. It is a subclass of String, though several methods have been
|
32
|
+
overridden to better fit a path context. In addition, it supports file
|
33
|
+
URL's as paths, provides additional methods for Windows paths, and
|
34
|
+
handles UNC paths on Windows properly. See the README file for more
|
35
|
+
details.
|
36
|
+
EOF
|
37
|
+
end
|
data/test/test_pathname.rb
CHANGED
@@ -60,7 +60,7 @@ class TC_Pathname_MSWin < Test::Unit::TestCase
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def test_version
|
63
|
-
assert_equal('1.6.
|
63
|
+
assert_equal('1.6.3', Pathname::VERSION)
|
64
64
|
end
|
65
65
|
|
66
66
|
# Convenience method for test_plus
|
@@ -594,9 +594,9 @@ class TC_Pathname_MSWin < Test::Unit::TestCase
|
|
594
594
|
|
595
595
|
assert_equal(
|
596
596
|
[
|
597
|
+
Dir.pwd + "/benchmarks",
|
597
598
|
Dir.pwd + "/CHANGES",
|
598
599
|
Dir.pwd + "/examples",
|
599
|
-
Dir.pwd + "/ext",
|
600
600
|
Dir.pwd + "/lib",
|
601
601
|
Dir.pwd + "/MANIFEST",
|
602
602
|
Dir.pwd + "/pathname2.gemspec",
|
@@ -616,7 +616,7 @@ class TC_Pathname_MSWin < Test::Unit::TestCase
|
|
616
616
|
|
617
617
|
assert_equal(
|
618
618
|
[
|
619
|
-
"
|
619
|
+
"benchmarks", "CHANGES", "examples", "lib", "MANIFEST",
|
620
620
|
"pathname2.gemspec", "Rakefile", "README", "test"
|
621
621
|
],
|
622
622
|
children
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pathname2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-10-02 00:00:00 -06:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -45,13 +45,15 @@ extra_rdoc_files:
|
|
45
45
|
files:
|
46
46
|
- benchmarks/bench_pathname.rb
|
47
47
|
- benchmarks/bench_plus.rb
|
48
|
+
- CHANGES
|
48
49
|
- examples/example_pathname.rb
|
49
50
|
- lib/pathname2.rb
|
51
|
+
- MANIFEST
|
52
|
+
- pathname2.gemspec
|
53
|
+
- Rakefile
|
54
|
+
- README
|
50
55
|
- test/test_pathname.rb
|
51
56
|
- test/test_pathname_windows.rb
|
52
|
-
- README
|
53
|
-
- CHANGES
|
54
|
-
- MANIFEST
|
55
57
|
has_rdoc: true
|
56
58
|
homepage: http://www.rubyforge.org/projects/shards
|
57
59
|
licenses:
|