win32-dir 0.4.9 → 0.5.0

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: 1456cbfae0e2becc75774dfc3678dc58fca89468
4
- data.tar.gz: 6bbb444fdc4d9731fd6c0e5cd67e4b7a1f3afc8e
3
+ metadata.gz: 24b10fb838eab01de3c979978c409486ac5872a0
4
+ data.tar.gz: c6470c51e09422329b405da037abe29b4f9b5cd3
5
5
  SHA512:
6
- metadata.gz: 88ae27d1fdb7064e74d7b83268f7713a9dfd8131d44a1b4cd3a957f54c761ebf6f438982e465189e6b01b4c88e14c5beba4e55559bb18a0a70db4c123570f7e6
7
- data.tar.gz: 565f653c68141e028986476ea0608e9827f067b6c30deb7c659457f692912d9e1084177aeb26da15512c491d5fe62e5fa44d3ceedd96658ee7eedb7e7d8ba43e
6
+ metadata.gz: f3d329bdb7408ba5d3beffea8cb486c80418875286e00115543cf223245331ba42ac56ec6e4f050f652163ffcab4b1d2b1b0b66d51eed762011f0ce357cc58db
7
+ data.tar.gz: 09bf9aa59a279a681f525a7fac0cf416f9b4fbcca8047f3d95dc89dbacd9033e49423852b37454c4e1dec2db28c962f43d22e21a329f098c40b8517c016908ab
data/CHANGES CHANGED
@@ -1,3 +1,11 @@
1
+ == 0.5.0 - 15-Oct-2014
2
+ * Fixed an encoding error in an error message in the Dir.read_junction method.
3
+ Thanks go to topac for the spot and patch.
4
+ * Replaced File.exists? with File.exist? in the test suite to avoid warnings
5
+ in Ruby 2.1 and later.
6
+ * Do not let the version number fool you, this is not a major release. I
7
+ simply ran out of version numbers.
8
+
1
9
  == 0.4.9 - 2-Jul-2014
2
10
  * Fixed the INVALID_FILE_ATTRIBUTES constant. It's only a 32-bit value.
3
11
  Thanks go to Ethan Brown for the patch.
@@ -8,7 +8,7 @@ class Dir
8
8
  extend Dir::Functions
9
9
 
10
10
  # The version of the win32-dir library.
11
- VERSION = '0.4.9'
11
+ VERSION = '0.5.0'
12
12
 
13
13
  # CSIDL constants
14
14
  csidl = Hash[
@@ -358,7 +358,7 @@ class Dir
358
358
  jname = (rdb[:PathBuffer].to_ptr + rdb[:SubstituteNameOffset]).read_string(rdb[:SubstituteNameLength])
359
359
  jname = jname.bytes.to_a.pack('C*')
360
360
  jname = jname.force_encoding("UTF-16LE")
361
- raise "Junction name came back as #{jname}" unless jname[0..3] == "\\??\\".encode("UTF-16LE")
361
+ raise "Invalid junction name: #{jname.encode('UTF-8')}" unless jname[0..3] == "\\??\\".encode("UTF-16LE")
362
362
  begin
363
363
  File.expand_path(jname[4..-1].encode(Encoding.default_external))
364
364
  rescue Encoding::UndefinedConversionError
@@ -26,7 +26,7 @@ class TC_Win32_Dir < Test::Unit::TestCase
26
26
  end
27
27
 
28
28
  test "version number is set to expected value" do
29
- assert_equal('0.4.9', Dir::VERSION)
29
+ assert_equal('0.5.0', Dir::VERSION)
30
30
  end
31
31
 
32
32
  test 'glob handles backslashes' do
@@ -90,21 +90,21 @@ class TC_Win32_Dir < Test::Unit::TestCase
90
90
 
91
91
  test "create_junction works as expected with ascii characters" do
92
92
  assert_nothing_raised{ Dir.create_junction(@ascii_to, @@from) }
93
- assert_true(File.exists?(@ascii_to))
93
+ assert_true(File.exist?(@ascii_to))
94
94
  File.open(@test_file, 'w'){ |fh| fh.puts "Hello World" }
95
95
  assert_equal(Dir.entries(@@from), Dir.entries(@ascii_to))
96
96
  end
97
97
 
98
98
  test "create_junction works as expected with unicode characters" do
99
99
  assert_nothing_raised{ Dir.create_junction(@unicode_to, @@from) }
100
- assert_true(File.exists?(@unicode_to))
100
+ assert_true(File.exist?(@unicode_to))
101
101
  File.open(@test_file, 'w'){ |fh| fh.puts "Hello World" }
102
102
  assert_equal(Dir.entries(@@from), Dir.entries(@unicode_to))
103
103
  end
104
104
 
105
105
  test "create_junction works as expected with pathname objects" do
106
106
  assert_nothing_raised{ Dir.create_junction(Pathname.new(@ascii_to), Pathname.new(@@from)) }
107
- assert_true(File.exists?(@ascii_to))
107
+ assert_true(File.exist?(@ascii_to))
108
108
  File.open(@test_file, 'w'){ |fh| fh.puts "Hello World" }
109
109
  assert_equal(Dir.entries(@@from), Dir.entries(@ascii_to))
110
110
  end
@@ -116,25 +116,25 @@ class TC_Win32_Dir < Test::Unit::TestCase
116
116
 
117
117
  test "read_junction works as expected with ascii characters" do
118
118
  assert_nothing_raised{ Dir.create_junction(@ascii_to, @@from) }
119
- assert_true(File.exists?(@ascii_to))
119
+ assert_true(File.exist?(@ascii_to))
120
120
  assert_equal(Dir.read_junction(@ascii_to), @@from)
121
121
  end
122
122
 
123
123
  test "read_junction works as expected with unicode characters" do
124
124
  assert_nothing_raised{ Dir.create_junction(@unicode_to, @@from) }
125
- assert_true(File.exists?(@unicode_to))
125
+ assert_true(File.exist?(@unicode_to))
126
126
  assert_equal(Dir.read_junction(@unicode_to), @@from)
127
127
  end
128
128
 
129
129
  test "read_junction with unicode characters is joinable" do
130
130
  assert_nothing_raised{ Dir.create_junction(@unicode_to, @@from) }
131
- assert_true(File.exists?(@unicode_to))
131
+ assert_true(File.exist?(@unicode_to))
132
132
  assert_nothing_raised{ File.join(Dir.read_junction(@unicode_to), 'foo') }
133
133
  end
134
134
 
135
135
  test "read_junction works as expected with pathname objects" do
136
136
  assert_nothing_raised{ Dir.create_junction(Pathname.new(@ascii_to), Pathname.new(@@from)) }
137
- assert_true(File.exists?(@ascii_to))
137
+ assert_true(File.exist?(@ascii_to))
138
138
  assert_equal(Dir.read_junction(@ascii_to), @@from)
139
139
  end
140
140
 
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'win32-dir'
5
- spec.version = '0.4.9'
5
+ spec.version = '0.5.0'
6
6
  spec.authors = ['Daniel J. Berger', 'Park Heesob']
7
7
  spec.license = 'Artistic 2.0'
8
8
  spec.email = 'djberg96@gmail.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win32-dir
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
@@ -9,48 +9,48 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-02 00:00:00.000000000 Z
12
+ date: 2014-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.0.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 1.0.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rake
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - '>='
32
+ - - ">="
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0'
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - '>='
39
+ - - ">="
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: test-unit
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - '>='
46
+ - - ">="
47
47
  - !ruby/object:Gem::Version
48
48
  version: 2.4.0
49
49
  type: :development
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - '>='
53
+ - - ">="
54
54
  - !ruby/object:Gem::Version
55
55
  version: 2.4.0
56
56
  description: |2
@@ -88,17 +88,17 @@ require_paths:
88
88
  - lib
89
89
  required_ruby_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
- - - '>='
91
+ - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: 1.9.2
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - '>='
96
+ - - ">="
97
97
  - !ruby/object:Gem::Version
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project:
101
- rubygems_version: 2.2.2
101
+ rubygems_version: 2.4.2
102
102
  signing_key:
103
103
  specification_version: 4
104
104
  summary: Extra constants and methods for the Dir class on Windows.