pathname2 1.7.4-universal-mingw32 → 1.8.0-universal-mingw32
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +7 -0
- data/README +5 -6
- data/Rakefile +1 -1
- data/benchmarks/bench_pathname.rb +99 -99
- data/lib/pathname2.rb +1 -1
- data/pathname2.gemspec +2 -2
- data/test/test_pathname.rb +30 -28
- data/test/test_version.rb +1 -1
- data/test/windows/test_facade.rb +5 -5
- metadata +14 -8
- metadata.gz.sig +2 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f399b0cd3126eefe8038fde33c30a1f0590c8255
|
4
|
+
data.tar.gz: 51bfc4a9c8cd99f40567d62552898bc0c4dfe1e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 938c7c6641fc9d054198cc7f998662f3fb1648ff91c87c8fb6938f38993f6a5ceeea9290a93a9052c5c46bdb320ae83a67da91927dd9e0ab7b867beb445ea51a
|
7
|
+
data.tar.gz: ef3e452b3efd088de6155ce793b55c7e6c8b75cf1dfaec9927702b8e8ed63e354c1081cae7977768c138d668ed7d44ec3eef036bfed924eaafe055c7160ea07b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
== 1.8.0 - 19-Jun-2016
|
2
|
+
* Changed license to Apache 2.0.
|
3
|
+
* Some cleanup and updates to the Rakefile and benchmarks.
|
4
|
+
* Refactored some realpath tests so they're not touching system files like
|
5
|
+
/dev/stdin any more. Thanks go to Michael R. Crusoe for pointing out the
|
6
|
+
potential pitfalls of doing that.
|
7
|
+
|
1
8
|
== 1.7.4 - 7-Sep-2015
|
2
9
|
* This gem is now signed.
|
3
10
|
* Rakefile now assumes Rubygems 2.x for some tasks.
|
data/README
CHANGED
@@ -72,21 +72,20 @@
|
|
72
72
|
method that is used by the pathname2 library.
|
73
73
|
|
74
74
|
== Known Issues
|
75
|
-
|
76
|
-
|
77
|
-
supposed to be private. See ruby-core:7383.
|
75
|
+
On MS Windows, some methods may not work on pathnames greater than 260
|
76
|
+
characters because of internal function limitations.
|
78
77
|
|
79
|
-
Any
|
78
|
+
Any issues you find should be reported on the project page at
|
80
79
|
https://github.com/djberg96/pathname2
|
81
80
|
|
82
81
|
== Future Plans
|
83
82
|
Suggestions welcome.
|
84
83
|
|
85
84
|
== License
|
86
|
-
|
85
|
+
Apache 2.0
|
87
86
|
|
88
87
|
== Copyright
|
89
|
-
(C) 2003-
|
88
|
+
(C) 2003-2016 Daniel J. Berger
|
90
89
|
All rights reserved.
|
91
90
|
|
92
91
|
== Warranty
|
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ namespace :gem do
|
|
10
10
|
require 'rubygems/package'
|
11
11
|
spec = eval(IO.read('pathname2.gemspec'))
|
12
12
|
spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
|
13
|
-
Gem::Package.build(spec)
|
13
|
+
Gem::Package.build(spec, true)
|
14
14
|
end
|
15
15
|
|
16
16
|
desc "Install the pathname2 gem"
|
@@ -12,7 +12,7 @@ require 'benchmark'
|
|
12
12
|
require 'pathname2'
|
13
13
|
require 'rbconfig'
|
14
14
|
|
15
|
-
if
|
15
|
+
if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/i
|
16
16
|
path1 = Pathname.new("C:\\Program Files\\Windows NT")
|
17
17
|
path2 = Pathname.new("Accessories")
|
18
18
|
path3 = Pathname.new("C:\\Program Files\\..\\.\\Windows NT")
|
@@ -26,102 +26,102 @@ end
|
|
26
26
|
MAX = 10000
|
27
27
|
|
28
28
|
Benchmark.bm(25) do |bench|
|
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
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
29
|
+
bench.report("Pathname.new(path)"){
|
30
|
+
MAX.times{ Pathname.new("/usr/local/bin") }
|
31
|
+
}
|
32
|
+
|
33
|
+
bench.report("Pathname#+(Pathname)"){
|
34
|
+
MAX.times{ path1 + path2 }
|
35
|
+
}
|
36
|
+
|
37
|
+
bench.report("Pathname#+(String)"){
|
38
|
+
MAX.times{ path1 + path2 }
|
39
|
+
}
|
40
|
+
|
41
|
+
bench.report("Pathname#children"){
|
42
|
+
MAX.times{ path1.children }
|
43
|
+
}
|
44
|
+
|
45
|
+
bench.report("Pathname#pstrip"){
|
46
|
+
MAX.times{ path1.pstrip }
|
47
|
+
}
|
48
|
+
|
49
|
+
bench.report("Pathname#pstrip!"){
|
50
|
+
MAX.times{ path1.pstrip! }
|
51
|
+
}
|
52
|
+
|
53
|
+
bench.report("Pathname#to_a"){
|
54
|
+
MAX.times{ path1.to_a }
|
55
|
+
}
|
56
|
+
|
57
|
+
bench.report("Pathname#descend"){
|
58
|
+
MAX.times{ path1.descend{} }
|
59
|
+
}
|
60
|
+
|
61
|
+
bench.report("Pathname#ascend"){
|
62
|
+
MAX.times{ path1.ascend{} }
|
63
|
+
}
|
64
|
+
|
65
|
+
bench.report("Pathname#root"){
|
66
|
+
MAX.times{ path1.root }
|
67
|
+
}
|
68
|
+
|
69
|
+
bench.report("Pathname#root?"){
|
70
|
+
MAX.times{ path1.root? }
|
71
|
+
}
|
72
|
+
|
73
|
+
bench.report("Pathname#<=>"){
|
74
|
+
MAX.times{ path1 <=> path2 }
|
75
|
+
}
|
76
|
+
|
77
|
+
bench.report("Pathname#absolute?"){
|
78
|
+
MAX.times{ path1.absolute? }
|
79
|
+
}
|
80
|
+
|
81
|
+
bench.report("Pathname#relative?"){
|
82
|
+
MAX.times{ path1.relative? }
|
83
|
+
}
|
84
|
+
|
85
|
+
bench.report("Pathname#clean"){
|
86
|
+
MAX.times{ path3.clean }
|
87
|
+
}
|
88
|
+
|
89
|
+
bench.report("Pathname#clean!"){
|
90
|
+
MAX.times{ path3.clean! }
|
91
|
+
}
|
92
|
+
|
93
|
+
# Platform specific tests
|
94
|
+
if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/i
|
95
|
+
bench.report("Pathname.new(file_url)"){
|
96
|
+
MAX.times{ Pathname.new("file:///C:/usr/local/bin") }
|
97
|
+
}
|
98
|
+
|
99
|
+
bench.report("Pathname#drive_number"){
|
100
|
+
MAX.times{ path1.drive_number }
|
101
|
+
}
|
102
|
+
|
103
|
+
bench.report("Pathname#unc?"){
|
104
|
+
MAX.times{ path1.unc? }
|
105
|
+
}
|
106
|
+
|
107
|
+
bench.report("Pathname#undecorate"){
|
108
|
+
MAX.times{ path1.undecorate }
|
109
|
+
}
|
110
|
+
|
111
|
+
bench.report("Pathname#undecorate!"){
|
112
|
+
MAX.times{ path1.undecorate! }
|
113
|
+
}
|
114
|
+
|
115
|
+
bench.report("Pathname#short_path"){
|
116
|
+
MAX.times{ path1.short_path }
|
117
|
+
}
|
118
|
+
|
119
|
+
bench.report("Pathname#long_path"){
|
120
|
+
MAX.times{ path1.long_path }
|
121
|
+
}
|
122
|
+
else
|
123
|
+
bench.report("Pathname#realpath"){
|
124
|
+
MAX.times{ path4.realpath }
|
125
|
+
}
|
126
|
+
end
|
127
127
|
end
|
data/lib/pathname2.rb
CHANGED
data/pathname2.gemspec
CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'pathname2'
|
5
|
-
spec.version = '1.
|
5
|
+
spec.version = '1.8.0'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
|
-
spec.license = '
|
7
|
+
spec.license = 'Apache 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
9
9
|
spec.homepage = 'https://github.com/djberg96/pathname2'
|
10
10
|
spec.summary = 'An alternate implementation of the Pathname class'
|
data/test/test_pathname.rb
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
# should be run via the test rake task.
|
6
6
|
##############################################################################
|
7
7
|
require 'pathname2'
|
8
|
+
require 'fileutils'
|
8
9
|
require 'rbconfig'
|
9
10
|
require 'test-unit'
|
10
11
|
include RbConfig
|
@@ -30,6 +31,10 @@ class TC_Pathname < Test::Unit::TestCase
|
|
30
31
|
@rel_array = []
|
31
32
|
|
32
33
|
@mypath = MyPathname.new('/usr/bin')
|
34
|
+
|
35
|
+
@test_file = 'realpath_test.txt'
|
36
|
+
@link_file = 'realpath_symlink.txt'
|
37
|
+
@link_file2 = 'realpath_symlink2.txt'
|
33
38
|
end
|
34
39
|
|
35
40
|
# Convenience method to verify that the receiver was not modified
|
@@ -62,41 +67,30 @@ class TC_Pathname < Test::Unit::TestCase
|
|
62
67
|
|
63
68
|
# Convenience method for test_relative_path_from_expected_errors
|
64
69
|
def assert_relpath_err(to, from)
|
65
|
-
assert_raise(ArgumentError) {
|
66
|
-
Pathname.new(to).relative_path_from(from)
|
67
|
-
}
|
70
|
+
assert_raise(ArgumentError) { Pathname.new(to).relative_path_from(from) }
|
68
71
|
end
|
69
72
|
|
70
|
-
|
73
|
+
test "url_path returns expected result" do
|
71
74
|
assert_equal('/foo bar/baz', @url_path)
|
72
75
|
end
|
73
76
|
|
74
|
-
|
77
|
+
test "realpath basic functionality" do
|
78
|
+
FileUtils.touch(@test_file) && File.symlink(@test_file, @link_file)
|
75
79
|
assert_respond_to(@abs_path, :realpath)
|
76
80
|
assert_equal(@@pwd, Pathname.new('.').realpath)
|
77
|
-
assert_kind_of(Pathname, Pathname.new(
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
end
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
assert_true(['/dev/pts/0', '/dev/proc/self/fd/0'].include?(Pathname.new(path1).realpath))
|
91
|
-
when /sunos|solaris/i
|
92
|
-
path1 = '/dev/null'
|
93
|
-
path2 = '/dev/stdin'
|
94
|
-
path3 = '/dev/fd0' # Multiple symlinks
|
95
|
-
|
96
|
-
assert_equal('/devices/pseudo/mm@0:null', Pathname.new(path1).realpath)
|
97
|
-
assert_equal('/dev/fd/0', Pathname.new(path2).realpath)
|
98
|
-
assert_equal('/devices/pci@1f,0/isa@7/dma@0,0/floppy@0,3f0:c', Pathname.new(path3).realpath)
|
99
|
-
end
|
81
|
+
assert_kind_of(Pathname, Pathname.new(@link_file).realpath)
|
82
|
+
end
|
83
|
+
|
84
|
+
test "realpath returns expected result for simple symlink" do
|
85
|
+
FileUtils.touch(@test_file) && File.symlink(@test_file, @link_file)
|
86
|
+
assert_true(Pathname.new(@link_file) != Pathname.new(@link_file).realpath)
|
87
|
+
assert_raises(Errno::ENOENT){ Pathname.new('../bogus').realpath }
|
88
|
+
end
|
89
|
+
|
90
|
+
test "realpath returns expected result for nested symlink" do
|
91
|
+
FileUtils.touch(@test_file) && File.symlink(@test_file, @link_file) && File.symlink(@link_file, @link_file2)
|
92
|
+
assert_true(Pathname.new(@link_file) != Pathname.new(@link_file2).realpath)
|
93
|
+
assert_equal(Pathname.new(@link_file).realpath, Pathname.new(@link_file2).realpath)
|
100
94
|
end
|
101
95
|
|
102
96
|
# These tests taken directly from Tanaka's pathname.rb. The one failure
|
@@ -476,6 +470,14 @@ class TC_Pathname < Test::Unit::TestCase
|
|
476
470
|
@mypath = nil
|
477
471
|
@abs_array.clear
|
478
472
|
@rel_array.clear
|
473
|
+
|
474
|
+
File.delete(@link_file2) if File.exist?(@link_file2)
|
475
|
+
File.delete(@link_file) if File.exist?(@link_file)
|
476
|
+
File.delete(@test_file) if File.exist?(@test_file)
|
477
|
+
|
478
|
+
@link_file2 = nil
|
479
|
+
@link_file = nil
|
480
|
+
@test_file = nil
|
479
481
|
end
|
480
482
|
|
481
483
|
def self.shutdown
|
data/test/test_version.rb
CHANGED
data/test/windows/test_facade.rb
CHANGED
@@ -51,11 +51,11 @@ class TC_Pathname_Facade < Test::Unit::TestCase
|
|
51
51
|
assert_respond_to(@path, :sysopen)
|
52
52
|
end
|
53
53
|
|
54
|
-
test "
|
55
|
-
assert_respond_to(@path, :
|
56
|
-
assert_nothing_raised{ @path.
|
57
|
-
assert_true(Pathname.new("C:\\").
|
58
|
-
assert_false(Pathname.new("X:\\foo\\bar\\baz").
|
54
|
+
test "exist? facade works as expected" do
|
55
|
+
assert_respond_to(@path, :exist?)
|
56
|
+
assert_nothing_raised{ @path.exist? }
|
57
|
+
assert_true(Pathname.new("C:\\").exist?)
|
58
|
+
assert_false(Pathname.new("X:\\foo\\bar\\baz").exist?)
|
59
59
|
end
|
60
60
|
|
61
61
|
def teardown
|
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.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: universal-mingw32
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
EJYzxdPOrx2n6NYR3Hk+vHP0U7UBSveI6+qx+ndQYaeyCn+GRX2PKS9h66YF/Q1V
|
31
31
|
tGSHgAmcLlkdGgan182qsE/4kKM=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2016-06-19 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: facade
|
@@ -104,18 +104,24 @@ extra_rdoc_files:
|
|
104
104
|
- CHANGES
|
105
105
|
- MANIFEST
|
106
106
|
files:
|
107
|
-
-
|
108
|
-
- MANIFEST
|
109
|
-
- README
|
110
|
-
- Rakefile
|
107
|
+
- benchmarks
|
111
108
|
- benchmarks/bench_pathname.rb
|
112
109
|
- benchmarks/bench_plus.rb
|
110
|
+
- certs
|
113
111
|
- certs/djberg96_pub.pem
|
112
|
+
- CHANGES
|
113
|
+
- examples
|
114
114
|
- examples/example_pathname.rb
|
115
|
+
- lib
|
115
116
|
- lib/pathname2.rb
|
117
|
+
- MANIFEST
|
116
118
|
- pathname2.gemspec
|
119
|
+
- Rakefile
|
120
|
+
- README
|
121
|
+
- test
|
117
122
|
- test/test_pathname.rb
|
118
123
|
- test/test_version.rb
|
124
|
+
- test/windows
|
119
125
|
- test/windows/test_append.rb
|
120
126
|
- test/windows/test_aref.rb
|
121
127
|
- test/windows/test_ascend.rb
|
@@ -146,7 +152,7 @@ files:
|
|
146
152
|
- test/windows/test_undecorate_bang.rb
|
147
153
|
homepage: https://github.com/djberg96/pathname2
|
148
154
|
licenses:
|
149
|
-
-
|
155
|
+
- Apache 2.0
|
150
156
|
metadata: {}
|
151
157
|
post_install_message:
|
152
158
|
rdoc_options: []
|
@@ -164,7 +170,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
170
|
version: '0'
|
165
171
|
requirements: []
|
166
172
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.4
|
173
|
+
rubygems_version: 2.6.4
|
168
174
|
signing_key:
|
169
175
|
specification_version: 4
|
170
176
|
summary: An alternate implementation of the Pathname class
|
metadata.gz.sig
CHANGED
@@ -1,3 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
R��0#W��Q��o�H��`(���Hꢽq�C�CU%��`S�yL�,9 퇞�w��ڟZ'}�zF�s��Zi�|�s�TP�����J{�T#�� e���{�A������a�0#�Z-�6��%WʙOSϵ�ހ8o1�;Юf����@O*1�)��O�"���C'����;ϕ�`F�
|
1
|
+
x����OQ�K��U�c~�v����VN]���������������Y>P��E���qx�Y������ဦD�Q���C)wbUJ���<��.~�>�GF(�D��`ߛ�A�3���,�Xd]e �6��-���H>��f��}��y����P̶�\��Q`%��;�ڤ5�`}�MXlU�A�~Lq�)eL��S(h�,�
|
2
|
+
��$v�Y[-F㏛���?{9;�U��Ocr��v#��<.�14Qa�G솄S�~��
|