pathname2 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +6 -0
- data/lib/pathname2.rb +9 -2
- data/pathname2.gemspec +7 -5
- data/test/test_pathname.rb +8 -1
- data/test/test_pathname_windows.rb +1 -1
- metadata +11 -17
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 1.6.5 - 19-Sep-2011
|
2
|
+
* Added the String#to_path instance method. This returns a Pathname
|
3
|
+
object.
|
4
|
+
* The architecture for the Windows gem is now "universal", and some
|
5
|
+
gemspec dependencies were simplified.
|
6
|
+
|
1
7
|
== 1.6.4 - 20-Jan-2011
|
2
8
|
* Explicitly remove the Pathname const if it is already defined in order
|
3
9
|
to avoid a superclass mismatch error. This library assumes that if you
|
data/lib/pathname2.rb
CHANGED
@@ -78,7 +78,7 @@ class Pathname < String
|
|
78
78
|
public
|
79
79
|
|
80
80
|
# The version of the pathname2 library
|
81
|
-
VERSION = '1.6.
|
81
|
+
VERSION = '1.6.5'
|
82
82
|
|
83
83
|
# The maximum length of a path
|
84
84
|
MAXPATH = 1024 unless defined? MAXPATH # Yes, I willfully violate POSIX
|
@@ -107,7 +107,7 @@ class Pathname < String
|
|
107
107
|
#
|
108
108
|
# Examples:
|
109
109
|
#
|
110
|
-
# Pathname.new("/foo/bar/baz"
|
110
|
+
# Pathname.new("/foo/bar/baz")
|
111
111
|
# Pathname.new("foo")
|
112
112
|
# Pathname.new("file:///foo/bar/baz")
|
113
113
|
# Pathname.new("C:\\Documents and Settings\\snoopy")
|
@@ -1122,3 +1122,10 @@ module Kernel
|
|
1122
1122
|
Pathname.new(path)
|
1123
1123
|
end
|
1124
1124
|
end
|
1125
|
+
|
1126
|
+
class String
|
1127
|
+
# Convert a string directly into a Pathname object.
|
1128
|
+
def to_path
|
1129
|
+
Pathname.new(self)
|
1130
|
+
end
|
1131
|
+
end
|
data/pathname2.gemspec
CHANGED
@@ -2,25 +2,27 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'pathname2'
|
5
|
-
spec.version = '1.6.
|
5
|
+
spec.version = '1.6.5'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
9
9
|
spec.homepage = 'http://www.rubyforge.org/projects/shards'
|
10
10
|
spec.summary = 'An alternate implementation of the Pathname class'
|
11
|
-
spec.has_rdoc = true
|
12
11
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
12
|
|
14
13
|
spec.extra_rdoc_files = ['README', 'CHANGES', 'MANIFEST']
|
15
14
|
spec.rubyforge_project = 'shards'
|
16
15
|
|
17
|
-
spec.add_dependency('facade'
|
18
|
-
spec.add_development_dependency('test-unit'
|
16
|
+
spec.add_dependency('facade')
|
17
|
+
spec.add_development_dependency('test-unit')
|
19
18
|
|
20
19
|
if File::ALT_SEPARATOR
|
21
20
|
spec.test_file = 'test/test_pathname_windows.rb'
|
22
|
-
spec.add_dependency('windows-pr'
|
21
|
+
spec.add_dependency('windows-pr')
|
23
22
|
spec.platform = Gem::Platform::CURRENT
|
23
|
+
spec.platform.cpu = 'universal'
|
24
|
+
spec.platform.version = nil
|
25
|
+
spec.original_platform = spec.platform # See rubygems issue #147
|
24
26
|
else
|
25
27
|
spec.test_file = 'test/test_pathname.rb'
|
26
28
|
end
|
data/test/test_pathname.rb
CHANGED
@@ -72,7 +72,7 @@ class TC_Pathname < Test::Unit::TestCase
|
|
72
72
|
end
|
73
73
|
|
74
74
|
def test_version
|
75
|
-
assert_equal('1.6.
|
75
|
+
assert_equal('1.6.5', Pathname::VERSION)
|
76
76
|
end
|
77
77
|
|
78
78
|
def test_file_url_path
|
@@ -459,6 +459,13 @@ class TC_Pathname < Test::Unit::TestCase
|
|
459
459
|
assert_equal(@@pwd, Pathname.pwd)
|
460
460
|
end
|
461
461
|
|
462
|
+
test "String#to_path instance method is implemented" do
|
463
|
+
string = "/usr/local/bin"
|
464
|
+
assert_respond_to(string, :to_path)
|
465
|
+
assert_nothing_raised{ string.to_path }
|
466
|
+
assert_kind_of(Pathname, string.to_path)
|
467
|
+
end
|
468
|
+
|
462
469
|
def teardown
|
463
470
|
@abs_path = nil
|
464
471
|
@rel_path = nil
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pathname2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 5
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 1.6.
|
9
|
+
- 5
|
10
|
+
version: 1.6.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Daniel J. Berger
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-09-19 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: facade
|
@@ -26,12 +25,10 @@ dependencies:
|
|
26
25
|
requirements:
|
27
26
|
- - ">="
|
28
27
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
28
|
+
hash: 3
|
30
29
|
segments:
|
31
|
-
- 1
|
32
30
|
- 0
|
33
|
-
|
34
|
-
version: 1.0.4
|
31
|
+
version: "0"
|
35
32
|
type: :runtime
|
36
33
|
version_requirements: *id001
|
37
34
|
- !ruby/object:Gem::Dependency
|
@@ -42,12 +39,10 @@ dependencies:
|
|
42
39
|
requirements:
|
43
40
|
- - ">="
|
44
41
|
- !ruby/object:Gem::Version
|
45
|
-
hash:
|
42
|
+
hash: 3
|
46
43
|
segments:
|
47
|
-
-
|
48
|
-
|
49
|
-
- 2
|
50
|
-
version: 2.1.2
|
44
|
+
- 0
|
45
|
+
version: "0"
|
51
46
|
type: :development
|
52
47
|
version_requirements: *id002
|
53
48
|
description: " The pathname2 library provides an implementation of the Pathname\n class different from the one that ships as part of the Ruby standard\n library. It is a subclass of String, though several methods have been\n overridden to better fit a path context. In addition, it supports file\n URL's as paths, provides additional methods for Windows paths, and\n handles UNC paths on Windows properly. See the README file for more\n details.\n"
|
@@ -72,7 +67,6 @@ files:
|
|
72
67
|
- README
|
73
68
|
- test/test_pathname.rb
|
74
69
|
- test/test_pathname_windows.rb
|
75
|
-
has_rdoc: true
|
76
70
|
homepage: http://www.rubyforge.org/projects/shards
|
77
71
|
licenses:
|
78
72
|
- Artistic 2.0
|
@@ -102,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
96
|
requirements: []
|
103
97
|
|
104
98
|
rubyforge_project: shards
|
105
|
-
rubygems_version: 1.
|
99
|
+
rubygems_version: 1.8.10
|
106
100
|
signing_key:
|
107
101
|
specification_version: 3
|
108
102
|
summary: An alternate implementation of the Pathname class
|