pathname2 1.7.2-universal-mingw32 → 1.7.3-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +14 -6
- data/CHANGES +151 -148
- data/MANIFEST +38 -38
- data/README +98 -98
- data/lib/pathname2.rb +1140 -1140
- data/pathname2.gemspec +36 -36
- data/test/test_pathname.rb +484 -484
- data/test/test_version.rb +13 -13
- metadata +23 -25
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzM0YjhkYjYwYjUxYTJhYjFhOWQyYWZiMmIzOGUwMTEzNjNjMDdkMg==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NjEyYWFhM2Q1YzRjYTI4MTA2Nzg5MjhmYTNhMDY4MmQzYzk0ZjI0ZA==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTg4MTBiOTBjMmFjOWYxY2ZjMDkyZmQyOWI0NjUxZmE5NDdlMTJkYTAyYjc0
|
10
|
+
OTdjZGYyMDU1YzY2ZjliNjk3MmYxNDgxMWE2ZGIyNzI2YmE1ZjVkOTQ4YmI5
|
11
|
+
ODczNThhZjQyOGYxNDI3YWU3ZjM1YzQ5NjQ2MDg2OTY0MWUxYjQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ZDMxMGEzNjJhZTk3Y2U2OTdiYzM2NjEzY2FiOGM4YzMxMzU1ZTZhMjllZWI1
|
14
|
+
NmRmZGRiNWI0OTAwNDc2OGU1YjU2YzdjM2Y4YzMwOWU4MWI1MWNmMTYxZDgy
|
15
|
+
MWFhMGQ0ODllYzQ0ZTA1MGM2NDA0NWE4YTZjYjQ5MDAyZGM0MGI=
|
data/CHANGES
CHANGED
@@ -1,148 +1,151 @@
|
|
1
|
-
== 1.7.
|
2
|
-
* The
|
3
|
-
|
4
|
-
== 1.7.
|
5
|
-
*
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
*
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
*
|
25
|
-
|
26
|
-
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
*
|
31
|
-
|
32
|
-
|
33
|
-
*
|
34
|
-
|
35
|
-
|
36
|
-
*
|
37
|
-
|
38
|
-
|
39
|
-
*
|
40
|
-
|
41
|
-
|
42
|
-
*
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
*
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
*
|
54
|
-
|
55
|
-
|
56
|
-
*
|
57
|
-
|
58
|
-
*
|
59
|
-
*
|
60
|
-
|
61
|
-
|
62
|
-
*
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
*
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
*
|
74
|
-
*
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
*
|
82
|
-
|
83
|
-
|
84
|
-
* The
|
85
|
-
|
86
|
-
|
87
|
-
*
|
88
|
-
|
89
|
-
|
90
|
-
*
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
*
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
== 1.4.
|
102
|
-
*
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
* Added
|
108
|
-
|
109
|
-
|
110
|
-
*
|
111
|
-
|
112
|
-
|
113
|
-
*
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
* Added
|
132
|
-
|
133
|
-
|
134
|
-
*
|
135
|
-
|
136
|
-
|
137
|
-
*
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
*
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
* Added
|
146
|
-
|
147
|
-
== 1.
|
148
|
-
*
|
1
|
+
== 1.7.3 - 24-Apr-2014
|
2
|
+
* The basename and dirname methods now return Pathname objects.
|
3
|
+
|
4
|
+
== 1.7.2 - 23-Apr-2014
|
5
|
+
* The join and expand_path methods now return Pathname objects.
|
6
|
+
|
7
|
+
== 1.7.1 - 28-Mar-2014
|
8
|
+
* Updated gemspec for Windows vs Unix.
|
9
|
+
* Updated README and MANIFEST.
|
10
|
+
|
11
|
+
== 1.7.0 - 28-Mar-2014
|
12
|
+
* Windows now uses FFI internally instead of win32-api.
|
13
|
+
* Added a custom pretty_print method for the pp library.
|
14
|
+
* Reorganized the test suite for Windows, and added many
|
15
|
+
more test tasks to the Rakefile.
|
16
|
+
|
17
|
+
== 1.6.5 - 19-Sep-2011
|
18
|
+
* Added the String#to_path instance method. This returns a Pathname
|
19
|
+
object.
|
20
|
+
* The architecture for the Windows gem is now "universal", and some
|
21
|
+
gemspec dependencies were simplified.
|
22
|
+
|
23
|
+
== 1.6.4 - 20-Jan-2011
|
24
|
+
* Explicitly remove the Pathname const if it is already defined in order
|
25
|
+
to avoid a superclass mismatch error. This library assumes that if you
|
26
|
+
require pathname2, you want my version of the Pathname class.
|
27
|
+
* Updated URI handling for Ruby 1.9.x.
|
28
|
+
* Added the Pathname() method, a synonym for Pathname.new.
|
29
|
+
* Some Rakefile and gemspec tweaks.
|
30
|
+
* Some updates to the test suite, including some specifically for Windows 7.
|
31
|
+
|
32
|
+
== 1.6.3 - 2-Oct-2009
|
33
|
+
* Updated Windows platform handling code to include mingw and cygwin.
|
34
|
+
* Added the :gem rake task.
|
35
|
+
* Minor gemspec updates.
|
36
|
+
* Some minor test suite updates.
|
37
|
+
|
38
|
+
== 1.6.2 - 4-Aug-2009
|
39
|
+
* Now compatible with Ruby 1.9.x.
|
40
|
+
* License changed to Artistic 2.0.
|
41
|
+
* Added the Pathname.pwd method as a synonym for Pathname.new(Dir.pwd).
|
42
|
+
* Modified Pathname#dirname so that you can specify a level that indicates
|
43
|
+
how many levels up you want to retrieve. For example, if your path was
|
44
|
+
'/usr/local/bin', then path.dirname(2) would return '/usr'.
|
45
|
+
* Now compatible with Ruby 1.9.x.
|
46
|
+
* Bumped required version of the facade library to 1.0.4.
|
47
|
+
|
48
|
+
== 1.6.1 - 8-Nov-2008
|
49
|
+
* Added the Pathname#[] method, which accepts an index, an index plus a
|
50
|
+
length, or a range, and returns appropriate the path element(s).
|
51
|
+
* Refactoring the platform checking in the test suite to use rbconfig instead
|
52
|
+
of RUBY_PLATFORM.
|
53
|
+
* More inline documentation examples.
|
54
|
+
|
55
|
+
== 1.6.0 - 13-July-2008
|
56
|
+
* The facade for ftools (and ftools itself) has been removed. The ftools
|
57
|
+
library is deprecated in favor of FileUtils.
|
58
|
+
* PathnameError is now Pathname::Error.
|
59
|
+
* Bug fix for Pathname#relative_path_from for MS Windows. Thanks go to an
|
60
|
+
anonymous user for the spot.
|
61
|
+
* Fixed a bug where frozen strings would raise an error on MS Windows.
|
62
|
+
* The code is now -w clean.
|
63
|
+
* Removed the C version as part of the release because it was just too
|
64
|
+
difficult to maintain both versions. The C code remains in CVS, however.
|
65
|
+
* Changed platform checking to use rbconfig instead of RUBY_PLATFORM to avoid
|
66
|
+
potential issues with other Ruby implementation.
|
67
|
+
|
68
|
+
== 1.5.2 - 9-Mar-2007
|
69
|
+
* Bug fix for the Pathname#realpath method where it was not handling recursive
|
70
|
+
symlinks. The C version was also fixed, but it only affected platforms that
|
71
|
+
don't have the realpath() function.
|
72
|
+
* Added a test for recursive symlinks (for Solaris, anyway).
|
73
|
+
* Updated the docs for Pathname#realpath.
|
74
|
+
* Minor speed enhancements for the C version and the elimination of one
|
75
|
+
(potential) segfault.
|
76
|
+
* Added a 'Future Plans' section to the README.
|
77
|
+
* Added a Rakefile. You can now build, clean, and test and install (both the
|
78
|
+
pure Ruby and C versions).
|
79
|
+
|
80
|
+
== 1.5.1 - 28-Aug-2006
|
81
|
+
* Added the Kernel#pn method as a shortcut for Pathname.new.
|
82
|
+
* The Pathname#readlink now properly handles symbolic links. The 'fix'
|
83
|
+
from 1.4.4 did not work.
|
84
|
+
* The C extension uses your system's realpath() function for the
|
85
|
+
Pathname#readlink method if it has one.
|
86
|
+
* Added the '/' alias for '+'. So, p1 / p2 is the same as p1 + p2.
|
87
|
+
* The windows-pr package is now required on MS Windows.
|
88
|
+
|
89
|
+
== 1.5.0 - 17-Apr-2006
|
90
|
+
* Better subclass handling, in that some methods that previously returned
|
91
|
+
hardcoded Pathname.new now return self.class.new.
|
92
|
+
* File URL's are now handled on Unix as well (using the 'uri' package).
|
93
|
+
* Some comment changes/clarifications.
|
94
|
+
* Added the PathnameError class to the pure Ruby version.
|
95
|
+
|
96
|
+
== 1.4.4 - 23-Mar-2006
|
97
|
+
* If the path is a symbolic link the Pathname#realpath method
|
98
|
+
now returns the absolute path of that link, i.e. the result
|
99
|
+
of File.readlink (as a Pathname object).
|
100
|
+
|
101
|
+
== 1.4.3 - 3-Mar-2006
|
102
|
+
* Added the Pathname#realpath method.
|
103
|
+
|
104
|
+
== 1.4.2 - 22-Feb-2006
|
105
|
+
* Fixed the Pathname#relative_path_from method for Windows. This really only
|
106
|
+
affected edge cases that you probably never saw anyway.
|
107
|
+
* Added corresponding tests for Windows.
|
108
|
+
|
109
|
+
== 1.4.1 - 18-Feb-2006
|
110
|
+
* Added the Pathname#parent method.
|
111
|
+
* Added the Pathname#relative_path_from method.
|
112
|
+
* Bug fix for Pathname#pstrip on *nix.
|
113
|
+
* Corresponding test suite additions.
|
114
|
+
|
115
|
+
== 1.4.0 - 19-Dec-2005
|
116
|
+
* Added destructive and non-destructive methods for some methods - pstrip,
|
117
|
+
pstrip!, undecorate, undecorate!, clean and clean!.
|
118
|
+
* Added a C extension version of this package. You can use the C version
|
119
|
+
instead of the pure Ruby version instead. See the README for more details.
|
120
|
+
* Fixed bug in the root method where the result wasn't guaranteed to be a
|
121
|
+
Pathname class.
|
122
|
+
* Fixed bugs in Windows version where the receiver was inadvertantly modified
|
123
|
+
in some cases, and added tests to check for this in the future.
|
124
|
+
* Modified the Dir.glob facade so that it (temporarily) changes to the path
|
125
|
+
directory, globs on that path, then returns to the original directory.
|
126
|
+
* Added the bench_pathname.rb script to let you benchmark all Pathname
|
127
|
+
methods.
|
128
|
+
|
129
|
+
== 1.3.1 - 21-Nov-2005
|
130
|
+
* Added the Pathname#children method.
|
131
|
+
* Added tests for the Pathname#children method.
|
132
|
+
|
133
|
+
== 1.3.0 - 28-Oct-2005
|
134
|
+
* Added the short_path and long_path methods for MS Windows.
|
135
|
+
* Optimization for the '+' method on Unix.
|
136
|
+
* Added some examples under the 'examples' directory.
|
137
|
+
* More tests added and some minor changes to the test suite in general.
|
138
|
+
|
139
|
+
== 1.2.1 - 1-Sep-2005
|
140
|
+
* Bug fix for the ascend and descend methods wrt Windows and UNC paths.
|
141
|
+
* More tests added for ascend and descend methods.
|
142
|
+
|
143
|
+
== 1.2.0 - 29-Aug-2005
|
144
|
+
* Added the 'ascend' and 'descend' methods.
|
145
|
+
* Added corresponding test suite additions.
|
146
|
+
|
147
|
+
== 1.1.0 - 13-Jul-2005
|
148
|
+
* Added the 'find' facade.
|
149
|
+
|
150
|
+
== 1.0.0 - 11-Jun-2005
|
151
|
+
* Initial release
|
data/MANIFEST
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
* CHANGES
|
2
|
-
* MANIFEST
|
3
|
-
* Rakefile
|
4
|
-
* README
|
5
|
-
* pathname2.gempsec
|
6
|
-
* benchmarks/bench_all.rb
|
7
|
-
* benchmarks/bench_plus.rb
|
8
|
-
* examples/example_pathname.rb
|
9
|
-
* lib/pathname2.rb
|
10
|
-
* test/test_pathname.rb
|
11
|
-
* test/test_version.rb
|
12
|
-
* test/windows/test_append.rb
|
13
|
-
* test/windows/test_aref.rb
|
14
|
-
* test/windows/test_ascend.rb
|
15
|
-
* test/windows/test_children.rb
|
16
|
-
* test/windows/test_clean.rb
|
17
|
-
* test/windows/test_clean_bang.rb
|
18
|
-
* test/windows/test_constructor.rb
|
19
|
-
* test/windows/test_descend.rb
|
20
|
-
* test/windows/test_drive_number.rb
|
21
|
-
* test/windows/test_each.rb
|
22
|
-
* test/windows/test_facade.rb
|
23
|
-
* test/windows/test_is_absolute.rb
|
24
|
-
* test/windows/test_is_relative.rb
|
25
|
-
* test/windows/test_is_root.rb
|
26
|
-
* test/windows/test_is_unc.rb
|
27
|
-
* test/windows/test_long_path.rb
|
28
|
-
* test/windows/test_misc.rb
|
29
|
-
* test/windows/test_parent.rb
|
30
|
-
* test/windows/test_pstrip.rb
|
31
|
-
* test/windows/test_pstrip_bang.rb
|
32
|
-
* test/windows/test_realpath.rb
|
33
|
-
* test/windows/test_relative_path_from.rb
|
34
|
-
* test/windows/test_root.rb
|
35
|
-
* test/windows/test_short_path.rb
|
36
|
-
* test/windows/test_to_a.rb
|
37
|
-
* test/windows/test_undecorate.rb
|
38
|
-
* test/windows/test_undecorate_bang.rb
|
1
|
+
* CHANGES
|
2
|
+
* MANIFEST
|
3
|
+
* Rakefile
|
4
|
+
* README
|
5
|
+
* pathname2.gempsec
|
6
|
+
* benchmarks/bench_all.rb
|
7
|
+
* benchmarks/bench_plus.rb
|
8
|
+
* examples/example_pathname.rb
|
9
|
+
* lib/pathname2.rb
|
10
|
+
* test/test_pathname.rb
|
11
|
+
* test/test_version.rb
|
12
|
+
* test/windows/test_append.rb
|
13
|
+
* test/windows/test_aref.rb
|
14
|
+
* test/windows/test_ascend.rb
|
15
|
+
* test/windows/test_children.rb
|
16
|
+
* test/windows/test_clean.rb
|
17
|
+
* test/windows/test_clean_bang.rb
|
18
|
+
* test/windows/test_constructor.rb
|
19
|
+
* test/windows/test_descend.rb
|
20
|
+
* test/windows/test_drive_number.rb
|
21
|
+
* test/windows/test_each.rb
|
22
|
+
* test/windows/test_facade.rb
|
23
|
+
* test/windows/test_is_absolute.rb
|
24
|
+
* test/windows/test_is_relative.rb
|
25
|
+
* test/windows/test_is_root.rb
|
26
|
+
* test/windows/test_is_unc.rb
|
27
|
+
* test/windows/test_long_path.rb
|
28
|
+
* test/windows/test_misc.rb
|
29
|
+
* test/windows/test_parent.rb
|
30
|
+
* test/windows/test_pstrip.rb
|
31
|
+
* test/windows/test_pstrip_bang.rb
|
32
|
+
* test/windows/test_realpath.rb
|
33
|
+
* test/windows/test_relative_path_from.rb
|
34
|
+
* test/windows/test_root.rb
|
35
|
+
* test/windows/test_short_path.rb
|
36
|
+
* test/windows/test_to_a.rb
|
37
|
+
* test/windows/test_undecorate.rb
|
38
|
+
* test/windows/test_undecorate_bang.rb
|
data/README
CHANGED
@@ -1,98 +1,98 @@
|
|
1
|
-
== Description
|
2
|
-
A drop-in replacement for the current Pathname class.
|
3
|
-
|
4
|
-
== Prerequisites
|
5
|
-
* facade
|
6
|
-
* ffi (Windows only)
|
7
|
-
* test-unit (testing only)
|
8
|
-
|
9
|
-
== Installation
|
10
|
-
|
11
|
-
gem install pathname2
|
12
|
-
|
13
|
-
== Synopsis
|
14
|
-
require 'pathname2'
|
15
|
-
|
16
|
-
# Unix
|
17
|
-
path1 = Pathname.new("/foo/bar/baz")
|
18
|
-
path2 = Pathname.new("../zap")
|
19
|
-
|
20
|
-
path1 + path2 # "/foo/bar/zap"
|
21
|
-
path1 / path2 # "/foo/bar/zap" (same as +)
|
22
|
-
path1.exists? # Does this path exist?
|
23
|
-
path1.dirname # "/foo/bar"
|
24
|
-
path1.to_a # ['foo','bar','baz']
|
25
|
-
|
26
|
-
# Windows
|
27
|
-
path1 = Pathname.new("C:/foo/bar/baz")
|
28
|
-
path2 = Pathname.new("../zap")
|
29
|
-
|
30
|
-
path1 + path2 # "C:\\foo\\bar\\zap"
|
31
|
-
path1.root # "C:\\"
|
32
|
-
path1.to_a # ['C:','foo','bar','baz']
|
33
|
-
|
34
|
-
== Windows Notes
|
35
|
-
All forward slashes are converted to backslashes for Pathname objects.
|
36
|
-
|
37
|
-
== Differences between Unix and Windows
|
38
|
-
If your pathname consists solely of ".", or "..", the return
|
39
|
-
value for Pathname#clean will be different. On Win32, "\\" is returned,
|
40
|
-
while on Unix "." is returned. I consider this an extreme edge case and
|
41
|
-
will not worry myself with it.
|
42
|
-
|
43
|
-
== Differences between Pathname in the standard library and this version
|
44
|
-
* It is a subclass of String (and thus, mixes in Enumerable).
|
45
|
-
* It has sensical to_a and root instance methods.
|
46
|
-
* It works on Windows and Unix. The current implementation does not work
|
47
|
-
with Windows path names very well, and not at all when it comes to UNC
|
48
|
-
paths.
|
49
|
-
* The Pathname#cleanpath method works differently - it always returns
|
50
|
-
a canonical pathname. In addition, there is no special consideration
|
51
|
-
for symlinks (yet), though I'm not sure it warrants it.
|
52
|
-
* The Pathname#+ method auto cleans.
|
53
|
-
* It uses a facade for all File and Dir methods, as well as most FileUtils
|
54
|
-
methods.
|
55
|
-
* Pathname#clean works slightly differently. In the stdlib version,
|
56
|
-
Pathname#clean("../a") returns "../a". In this version, it returns "a".
|
57
|
-
This affects other methods, such as Pathname#relative_path_from.
|
58
|
-
* Accepts file urls and converts them to paths automatically, e.g.
|
59
|
-
file:///foo%20bar/baz becomes '/foo/bar/baz'.
|
60
|
-
* Adds a Kernel level +pn+ method as a shortcut.
|
61
|
-
* Allows you to add paths together with the '/' operator.
|
62
|
-
|
63
|
-
== Method Priority
|
64
|
-
Because there is some overlap in method names between File, Dir, and
|
65
|
-
FileUtils, the priority is as follows:
|
66
|
-
|
67
|
-
* File
|
68
|
-
* Dir
|
69
|
-
* FileUtils
|
70
|
-
|
71
|
-
In other words, whichever of these defines a given method first is the
|
72
|
-
method that is used by the pathname2 library.
|
73
|
-
|
74
|
-
== Known Issues
|
75
|
-
In Ruby 1.8.3 and 1.8.4 you will see a failure in the test suite regarding
|
76
|
-
'fu_world_writable?' from FileUtils. You can ignore this. That method is
|
77
|
-
supposed to be private. See ruby-core:7383.
|
78
|
-
|
79
|
-
Any other issues should be reported on the project page at
|
80
|
-
https://github.com/djberg96/pathname2
|
81
|
-
|
82
|
-
== Future Plans
|
83
|
-
Suggestions welcome.
|
84
|
-
|
85
|
-
== License
|
86
|
-
Artistic 2.0
|
87
|
-
|
88
|
-
== Copyright
|
89
|
-
(C) 2003-2014 Daniel J. Berger
|
90
|
-
All rights reserved.
|
91
|
-
|
92
|
-
== Warranty
|
93
|
-
This library is provided "as is" and without any express or
|
94
|
-
implied warranties, including, without limitation, the implied
|
95
|
-
warranties of merchantability and fitness for a particular purpose.
|
96
|
-
|
97
|
-
== Author
|
98
|
-
Daniel J. Berger
|
1
|
+
== Description
|
2
|
+
A drop-in replacement for the current Pathname class.
|
3
|
+
|
4
|
+
== Prerequisites
|
5
|
+
* facade
|
6
|
+
* ffi (Windows only)
|
7
|
+
* test-unit (testing only)
|
8
|
+
|
9
|
+
== Installation
|
10
|
+
|
11
|
+
gem install pathname2
|
12
|
+
|
13
|
+
== Synopsis
|
14
|
+
require 'pathname2'
|
15
|
+
|
16
|
+
# Unix
|
17
|
+
path1 = Pathname.new("/foo/bar/baz")
|
18
|
+
path2 = Pathname.new("../zap")
|
19
|
+
|
20
|
+
path1 + path2 # "/foo/bar/zap"
|
21
|
+
path1 / path2 # "/foo/bar/zap" (same as +)
|
22
|
+
path1.exists? # Does this path exist?
|
23
|
+
path1.dirname # "/foo/bar"
|
24
|
+
path1.to_a # ['foo','bar','baz']
|
25
|
+
|
26
|
+
# Windows
|
27
|
+
path1 = Pathname.new("C:/foo/bar/baz")
|
28
|
+
path2 = Pathname.new("../zap")
|
29
|
+
|
30
|
+
path1 + path2 # "C:\\foo\\bar\\zap"
|
31
|
+
path1.root # "C:\\"
|
32
|
+
path1.to_a # ['C:','foo','bar','baz']
|
33
|
+
|
34
|
+
== Windows Notes
|
35
|
+
All forward slashes are converted to backslashes for Pathname objects.
|
36
|
+
|
37
|
+
== Differences between Unix and Windows
|
38
|
+
If your pathname consists solely of ".", or "..", the return
|
39
|
+
value for Pathname#clean will be different. On Win32, "\\" is returned,
|
40
|
+
while on Unix "." is returned. I consider this an extreme edge case and
|
41
|
+
will not worry myself with it.
|
42
|
+
|
43
|
+
== Differences between Pathname in the standard library and this version
|
44
|
+
* It is a subclass of String (and thus, mixes in Enumerable).
|
45
|
+
* It has sensical to_a and root instance methods.
|
46
|
+
* It works on Windows and Unix. The current implementation does not work
|
47
|
+
with Windows path names very well, and not at all when it comes to UNC
|
48
|
+
paths.
|
49
|
+
* The Pathname#cleanpath method works differently - it always returns
|
50
|
+
a canonical pathname. In addition, there is no special consideration
|
51
|
+
for symlinks (yet), though I'm not sure it warrants it.
|
52
|
+
* The Pathname#+ method auto cleans.
|
53
|
+
* It uses a facade for all File and Dir methods, as well as most FileUtils
|
54
|
+
methods.
|
55
|
+
* Pathname#clean works slightly differently. In the stdlib version,
|
56
|
+
Pathname#clean("../a") returns "../a". In this version, it returns "a".
|
57
|
+
This affects other methods, such as Pathname#relative_path_from.
|
58
|
+
* Accepts file urls and converts them to paths automatically, e.g.
|
59
|
+
file:///foo%20bar/baz becomes '/foo/bar/baz'.
|
60
|
+
* Adds a Kernel level +pn+ method as a shortcut.
|
61
|
+
* Allows you to add paths together with the '/' operator.
|
62
|
+
|
63
|
+
== Method Priority
|
64
|
+
Because there is some overlap in method names between File, Dir, and
|
65
|
+
FileUtils, the priority is as follows:
|
66
|
+
|
67
|
+
* File
|
68
|
+
* Dir
|
69
|
+
* FileUtils
|
70
|
+
|
71
|
+
In other words, whichever of these defines a given method first is the
|
72
|
+
method that is used by the pathname2 library.
|
73
|
+
|
74
|
+
== Known Issues
|
75
|
+
In Ruby 1.8.3 and 1.8.4 you will see a failure in the test suite regarding
|
76
|
+
'fu_world_writable?' from FileUtils. You can ignore this. That method is
|
77
|
+
supposed to be private. See ruby-core:7383.
|
78
|
+
|
79
|
+
Any other issues should be reported on the project page at
|
80
|
+
https://github.com/djberg96/pathname2
|
81
|
+
|
82
|
+
== Future Plans
|
83
|
+
Suggestions welcome.
|
84
|
+
|
85
|
+
== License
|
86
|
+
Artistic 2.0
|
87
|
+
|
88
|
+
== Copyright
|
89
|
+
(C) 2003-2014 Daniel J. Berger
|
90
|
+
All rights reserved.
|
91
|
+
|
92
|
+
== Warranty
|
93
|
+
This library is provided "as is" and without any express or
|
94
|
+
implied warranties, including, without limitation, the implied
|
95
|
+
warranties of merchantability and fitness for a particular purpose.
|
96
|
+
|
97
|
+
== Author
|
98
|
+
Daniel J. Berger
|