pathname2 1.7.4-universal-mingw32 → 1.8.0-universal-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f1d77d9f89b07849801961e8c608e297b5bc0a50
4
- data.tar.gz: a96b77b05d907d1c660075b932d29ca4fd056d0e
3
+ metadata.gz: f399b0cd3126eefe8038fde33c30a1f0590c8255
4
+ data.tar.gz: 51bfc4a9c8cd99f40567d62552898bc0c4dfe1e7
5
5
  SHA512:
6
- metadata.gz: fc36dd2a52f884695b876bc983a6fa5a5280056c2adc174a26e907c394f33e2a35024198e0f01e4d1aeeaeb8bd626f24c7267faa0047b04c10e1f19d68850023
7
- data.tar.gz: 58d1d2af0db6a192e07e9fbea5c8566dcd0cd17f2d5f2a602e203c08e698af6b152383fe5e5de9228c05f95148b0a80ec20fff0805a9b3d95c84f48896278505
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
- 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.
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 other issues should be reported on the project page at
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
- Artistic 2.0
85
+ Apache 2.0
87
86
 
88
87
  == Copyright
89
- (C) 2003-2015 Daniel J. Berger
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 Config::CONFIG['host_os'].match("mswin")
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
- 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 Config::CONFIG['host_os'].match("mswin")
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
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
@@ -93,7 +93,7 @@ class Pathname < String
93
93
  public
94
94
 
95
95
  # The version of the pathname2 library
96
- VERSION = '1.7.4'
96
+ VERSION = '1.8.0'
97
97
 
98
98
  # The maximum length of a path
99
99
  MAXPATH = 1024 unless defined? MAXPATH # Yes, I willfully violate POSIX
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.7.4'
5
+ spec.version = '1.8.0'
6
6
  spec.author = 'Daniel J. Berger'
7
- spec.license = 'Artistic 2.0'
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'
@@ -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
- def test_file_url_path
73
+ test "url_path returns expected result" do
71
74
  assert_equal('/foo bar/baz', @url_path)
72
75
  end
73
76
 
74
- def test_realpath
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('/dev/stdin').realpath)
78
- assert(Pathname.new('/dev/stdin') != Pathname.new('/dev/stdin').realpath)
79
- if CONFIG['host_os'] =~ /bsd|darwin|mac/i
80
- assert_raises(Errno::ENOENT){ Pathname.new('../blahblah/bogus').realpath }
81
- else
82
- assert_raises(Errno::ENOENT){ Pathname.new('../bogus').realpath }
83
- end
84
- end
85
-
86
- def test_realpath_platform
87
- case CONFIG['host_os']
88
- when /linux/i
89
- path1 = '/dev/stdin'
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
@@ -8,6 +8,6 @@ require 'test-unit'
8
8
 
9
9
  class TC_Pathname_Version < Test::Unit::TestCase
10
10
  test "version is set to expected value" do
11
- assert_equal('1.7.4', Pathname::VERSION)
11
+ assert_equal('1.8.0', Pathname::VERSION)
12
12
  end
13
13
  end
@@ -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 "exists? facade works as expected" do
55
- assert_respond_to(@path, :exists?)
56
- assert_nothing_raised{ @path.exists? }
57
- assert_true(Pathname.new("C:\\").exists?)
58
- assert_false(Pathname.new("X:\\foo\\bar\\baz").exists?)
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.7.4
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: 2015-09-07 00:00:00.000000000 Z
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
- - CHANGES
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
- - Artistic 2.0
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.8
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
- �+�ӿg�Ik��O����Y�u��
2
- �����jMxwy��=�*%(
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���qxY������ဦD�Q���C)wbUJ���<��. ~�>�GF(�D��`ߛ�A�3���,�Xd]e �6��-���H>��f��}��y����P̶�\��Q`%��;�ڤ5�`}�MXlU�A�~Lq�)eL��S(h�,�
2
+ ��$vY[-F㏛���?{9;�U��Ocr��v#��<.�14Qa�G솄S�~��