pathname2 1.4.3 → 1.4.4
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 +5 -0
- data/lib/pathname2.rb +6 -2
- data/test/tc_pathname.rb +1 -1
- data/test/tc_pathname_win.rb +2 -2
- metadata +2 -2
data/CHANGES
CHANGED
data/lib/pathname2.rb
CHANGED
@@ -77,7 +77,7 @@ class Pathname < String
|
|
77
77
|
Win32API.new('shlwapi', 'PathRemoveBackslash', 'P', 'P')
|
78
78
|
end
|
79
79
|
|
80
|
-
VERSION = '1.4.
|
80
|
+
VERSION = '1.4.4'
|
81
81
|
MAX_PATH = 260
|
82
82
|
|
83
83
|
# Creates and returns a new Pathname object.
|
@@ -117,7 +117,11 @@ class Pathname < String
|
|
117
117
|
def realpath
|
118
118
|
pwd = Pathname.new(Dir.pwd)
|
119
119
|
File.stat(self) # Check to ensure that the path exists
|
120
|
-
|
120
|
+
if File.symlink?(self)
|
121
|
+
Pathname.new(File.readlink(self))
|
122
|
+
else
|
123
|
+
pwd + self
|
124
|
+
end
|
121
125
|
end
|
122
126
|
|
123
127
|
# Returns the children of the directory, files and subdirectories, as an
|
data/test/tc_pathname.rb
CHANGED
data/test/tc_pathname_win.rb
CHANGED
@@ -50,7 +50,7 @@ class TC_Pathname_MSWin < Test::Unit::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_version
|
53
|
-
assert_equal("1.4.
|
53
|
+
assert_equal("1.4.4", Pathname::VERSION)
|
54
54
|
end
|
55
55
|
|
56
56
|
# Convenience method for test_plus
|
@@ -82,7 +82,7 @@ class TC_Pathname_MSWin < Test::Unit::TestCase
|
|
82
82
|
end
|
83
83
|
|
84
84
|
def test_realpath
|
85
|
-
assert_respond_to(@
|
85
|
+
assert_respond_to(@fpath, :realpath)
|
86
86
|
assert_equal(@cur_path, Pathname.new('.').realpath)
|
87
87
|
assert_raises(Errno::ENOENT){ Pathname.new('../bogus').realpath }
|
88
88
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
|
|
3
3
|
specification_version: 1
|
4
4
|
name: pathname2
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 1.4.
|
7
|
-
date: 2006-03-
|
6
|
+
version: 1.4.4
|
7
|
+
date: 2006-03-23 00:00:00 -07:00
|
8
8
|
summary: An alternate implementation of the Pathname class
|
9
9
|
require_paths:
|
10
10
|
- lib
|