pathname2 1.7.1-universal-mingw32 → 1.7.2-universal-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/CHANGES +148 -145
- data/MANIFEST +38 -38
- data/README +98 -98
- data/Rakefile +6 -0
- data/lib/pathname2.rb +1140 -1125
- data/pathname2.gemspec +36 -36
- data/test/test_pathname.rb +484 -484
- data/test/test_version.rb +13 -13
- data/test/windows/test_join.rb +52 -0
- metadata +27 -23
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MWEwM2Y2ZGZlY2I0NjhhNzY2ZWNjZjRiMzE2ZTIwNGY2NGZmNmE0MTI2NmJh
|
10
|
-
Y2ZhNmJkZTRjOTIxZmZiYmRhMzcyYTk1YjQ2MzAyZDgyYjJlM2E0MjViMmVh
|
11
|
-
ZGY1MjZmM2NjZTViM2Y4N2IzYzFjZmQzZjQwOTUxNWY4OTVjZGQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YzMwMDNmMmI0YTdlZThhMTAxYWIzN2Y1OGQzM2FkYmQ4NzlmNjYyOTZkMWU0
|
14
|
-
Y2RmNWJjZDUyYTNkM2RlODJiNjVlMjA5ZGM1YTdlZTIwZjdhNjkyZjdkMzUx
|
15
|
-
ZTdlM2UyMzczMDYzYjgwNzJmMzNjOTcwMTE0Y2M0NGUzNmU3MzY=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: bbe8319d8e29a00a0c70582d56ee20c780a12f13
|
4
|
+
data.tar.gz: ddf0f432a41cc14283c8892374ccd098df6b994d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 394cfa240ec8f7061375c16fff4e2bfe62a7b04c264009ccda841c53f5b021691e4960e0326282e2310e12cd4afe45308e4cc4212ba4af2b04694bdd3fb838fa
|
7
|
+
data.tar.gz: dcb6025358e5703130f86180cc638b4399830cffcf3f85f03c63aed880cf106b7050ed093c170b7c0e87299bd11154893b37f7d06c1aecabf1bc373dc782fe46
|
data/CHANGES
CHANGED
@@ -1,145 +1,148 @@
|
|
1
|
-
== 1.7.
|
2
|
-
*
|
3
|
-
|
4
|
-
|
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
|
-
* The
|
82
|
-
|
83
|
-
|
84
|
-
*
|
85
|
-
|
86
|
-
|
87
|
-
*
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
*
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
== 1.4.
|
99
|
-
*
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
* Added
|
105
|
-
|
106
|
-
|
107
|
-
*
|
108
|
-
|
109
|
-
|
110
|
-
*
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
* Added
|
129
|
-
|
130
|
-
|
131
|
-
*
|
132
|
-
|
133
|
-
|
134
|
-
*
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
*
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
* Added
|
143
|
-
|
144
|
-
== 1.
|
145
|
-
*
|
1
|
+
== 1.7.2 - 23-Apr-2014
|
2
|
+
* The join and expand_path methods now return Pathname objects.
|
3
|
+
|
4
|
+
== 1.7.1 - 28-Mar-2014
|
5
|
+
* Updated gemspec for Windows vs Unix.
|
6
|
+
* Updated README and MANIFEST.
|
7
|
+
|
8
|
+
== 1.7.0 - 28-Mar-2014
|
9
|
+
* Windows now uses FFI internally instead of win32-api.
|
10
|
+
* Added a custom pretty_print method for the pp library.
|
11
|
+
* Reorganized the test suite for Windows, and added many
|
12
|
+
more test tasks to the Rakefile.
|
13
|
+
|
14
|
+
== 1.6.5 - 19-Sep-2011
|
15
|
+
* Added the String#to_path instance method. This returns a Pathname
|
16
|
+
object.
|
17
|
+
* The architecture for the Windows gem is now "universal", and some
|
18
|
+
gemspec dependencies were simplified.
|
19
|
+
|
20
|
+
== 1.6.4 - 20-Jan-2011
|
21
|
+
* Explicitly remove the Pathname const if it is already defined in order
|
22
|
+
to avoid a superclass mismatch error. This library assumes that if you
|
23
|
+
require pathname2, you want my version of the Pathname class.
|
24
|
+
* Updated URI handling for Ruby 1.9.x.
|
25
|
+
* Added the Pathname() method, a synonym for Pathname.new.
|
26
|
+
* Some Rakefile and gemspec tweaks.
|
27
|
+
* Some updates to the test suite, including some specifically for Windows 7.
|
28
|
+
|
29
|
+
== 1.6.3 - 2-Oct-2009
|
30
|
+
* Updated Windows platform handling code to include mingw and cygwin.
|
31
|
+
* Added the :gem rake task.
|
32
|
+
* Minor gemspec updates.
|
33
|
+
* Some minor test suite updates.
|
34
|
+
|
35
|
+
== 1.6.2 - 4-Aug-2009
|
36
|
+
* Now compatible with Ruby 1.9.x.
|
37
|
+
* License changed to Artistic 2.0.
|
38
|
+
* Added the Pathname.pwd method as a synonym for Pathname.new(Dir.pwd).
|
39
|
+
* Modified Pathname#dirname so that you can specify a level that indicates
|
40
|
+
how many levels up you want to retrieve. For example, if your path was
|
41
|
+
'/usr/local/bin', then path.dirname(2) would return '/usr'.
|
42
|
+
* Now compatible with Ruby 1.9.x.
|
43
|
+
* Bumped required version of the facade library to 1.0.4.
|
44
|
+
|
45
|
+
== 1.6.1 - 8-Nov-2008
|
46
|
+
* Added the Pathname#[] method, which accepts an index, an index plus a
|
47
|
+
length, or a range, and returns appropriate the path element(s).
|
48
|
+
* Refactoring the platform checking in the test suite to use rbconfig instead
|
49
|
+
of RUBY_PLATFORM.
|
50
|
+
* More inline documentation examples.
|
51
|
+
|
52
|
+
== 1.6.0 - 13-July-2008
|
53
|
+
* The facade for ftools (and ftools itself) has been removed. The ftools
|
54
|
+
library is deprecated in favor of FileUtils.
|
55
|
+
* PathnameError is now Pathname::Error.
|
56
|
+
* Bug fix for Pathname#relative_path_from for MS Windows. Thanks go to an
|
57
|
+
anonymous user for the spot.
|
58
|
+
* Fixed a bug where frozen strings would raise an error on MS Windows.
|
59
|
+
* The code is now -w clean.
|
60
|
+
* Removed the C version as part of the release because it was just too
|
61
|
+
difficult to maintain both versions. The C code remains in CVS, however.
|
62
|
+
* Changed platform checking to use rbconfig instead of RUBY_PLATFORM to avoid
|
63
|
+
potential issues with other Ruby implementation.
|
64
|
+
|
65
|
+
== 1.5.2 - 9-Mar-2007
|
66
|
+
* Bug fix for the Pathname#realpath method where it was not handling recursive
|
67
|
+
symlinks. The C version was also fixed, but it only affected platforms that
|
68
|
+
don't have the realpath() function.
|
69
|
+
* Added a test for recursive symlinks (for Solaris, anyway).
|
70
|
+
* Updated the docs for Pathname#realpath.
|
71
|
+
* Minor speed enhancements for the C version and the elimination of one
|
72
|
+
(potential) segfault.
|
73
|
+
* Added a 'Future Plans' section to the README.
|
74
|
+
* Added a Rakefile. You can now build, clean, and test and install (both the
|
75
|
+
pure Ruby and C versions).
|
76
|
+
|
77
|
+
== 1.5.1 - 28-Aug-2006
|
78
|
+
* Added the Kernel#pn method as a shortcut for Pathname.new.
|
79
|
+
* The Pathname#readlink now properly handles symbolic links. The 'fix'
|
80
|
+
from 1.4.4 did not work.
|
81
|
+
* The C extension uses your system's realpath() function for the
|
82
|
+
Pathname#readlink method if it has one.
|
83
|
+
* Added the '/' alias for '+'. So, p1 / p2 is the same as p1 + p2.
|
84
|
+
* The windows-pr package is now required on MS Windows.
|
85
|
+
|
86
|
+
== 1.5.0 - 17-Apr-2006
|
87
|
+
* Better subclass handling, in that some methods that previously returned
|
88
|
+
hardcoded Pathname.new now return self.class.new.
|
89
|
+
* File URL's are now handled on Unix as well (using the 'uri' package).
|
90
|
+
* Some comment changes/clarifications.
|
91
|
+
* Added the PathnameError class to the pure Ruby version.
|
92
|
+
|
93
|
+
== 1.4.4 - 23-Mar-2006
|
94
|
+
* If the path is a symbolic link the Pathname#realpath method
|
95
|
+
now returns the absolute path of that link, i.e. the result
|
96
|
+
of File.readlink (as a Pathname object).
|
97
|
+
|
98
|
+
== 1.4.3 - 3-Mar-2006
|
99
|
+
* Added the Pathname#realpath method.
|
100
|
+
|
101
|
+
== 1.4.2 - 22-Feb-2006
|
102
|
+
* Fixed the Pathname#relative_path_from method for Windows. This really only
|
103
|
+
affected edge cases that you probably never saw anyway.
|
104
|
+
* Added corresponding tests for Windows.
|
105
|
+
|
106
|
+
== 1.4.1 - 18-Feb-2006
|
107
|
+
* Added the Pathname#parent method.
|
108
|
+
* Added the Pathname#relative_path_from method.
|
109
|
+
* Bug fix for Pathname#pstrip on *nix.
|
110
|
+
* Corresponding test suite additions.
|
111
|
+
|
112
|
+
== 1.4.0 - 19-Dec-2005
|
113
|
+
* Added destructive and non-destructive methods for some methods - pstrip,
|
114
|
+
pstrip!, undecorate, undecorate!, clean and clean!.
|
115
|
+
* Added a C extension version of this package. You can use the C version
|
116
|
+
instead of the pure Ruby version instead. See the README for more details.
|
117
|
+
* Fixed bug in the root method where the result wasn't guaranteed to be a
|
118
|
+
Pathname class.
|
119
|
+
* Fixed bugs in Windows version where the receiver was inadvertantly modified
|
120
|
+
in some cases, and added tests to check for this in the future.
|
121
|
+
* Modified the Dir.glob facade so that it (temporarily) changes to the path
|
122
|
+
directory, globs on that path, then returns to the original directory.
|
123
|
+
* Added the bench_pathname.rb script to let you benchmark all Pathname
|
124
|
+
methods.
|
125
|
+
|
126
|
+
== 1.3.1 - 21-Nov-2005
|
127
|
+
* Added the Pathname#children method.
|
128
|
+
* Added tests for the Pathname#children method.
|
129
|
+
|
130
|
+
== 1.3.0 - 28-Oct-2005
|
131
|
+
* Added the short_path and long_path methods for MS Windows.
|
132
|
+
* Optimization for the '+' method on Unix.
|
133
|
+
* Added some examples under the 'examples' directory.
|
134
|
+
* More tests added and some minor changes to the test suite in general.
|
135
|
+
|
136
|
+
== 1.2.1 - 1-Sep-2005
|
137
|
+
* Bug fix for the ascend and descend methods wrt Windows and UNC paths.
|
138
|
+
* More tests added for ascend and descend methods.
|
139
|
+
|
140
|
+
== 1.2.0 - 29-Aug-2005
|
141
|
+
* Added the 'ascend' and 'descend' methods.
|
142
|
+
* Added corresponding test suite additions.
|
143
|
+
|
144
|
+
== 1.1.0 - 13-Jul-2005
|
145
|
+
* Added the 'find' facade.
|
146
|
+
|
147
|
+
== 1.0.0 - 11-Jun-2005
|
148
|
+
* 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 = "/foo/bar/baz"
|
18
|
-
path2 = "../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 = "C:/foo/bar/baz"
|
28
|
-
path2 = "../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
|