win32-symlink 0.1.2 → 0.1.3
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
- data/ext/win32/win32-symlink.cpp +5 -1
- data/lib/win32/symlink/version.rb +1 -1
- data/lib/win32/symlink/win32_symlink.so +0 -0
- data/test/test_win32_symlink.rb +20 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 760f88f87cc420c1e2470fe822e2357ca9990848
|
4
|
+
data.tar.gz: 6fe503def472e253fc22136ce6ae0b2931a7f6ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a22a91076896a771067f9dd4a99d90d507f9dec39037f3654aae8a8990283f6004e29db74f1fec805c6a0e754912032f1ddf072e8c9e2e28dc96fa2ea269b48
|
7
|
+
data.tar.gz: e7e9fbb7ae2f999e6b9646b1266e9fb20dc6930518995ce61acd68edae78937d8a952e7b2dfcec6bf2b2528dfc29e33010a44a4cc5a52eb683647748cfaf39a3
|
data/ext/win32/win32-symlink.cpp
CHANGED
@@ -199,6 +199,7 @@ win32_readlink(const char* file)
|
|
199
199
|
return target;
|
200
200
|
}
|
201
201
|
|
202
|
+
// Win32::Symlink::readlink(file)
|
202
203
|
static VALUE
|
203
204
|
rb_readlink(VALUE mod, VALUE file)
|
204
205
|
{
|
@@ -208,6 +209,7 @@ rb_readlink(VALUE mod, VALUE file)
|
|
208
209
|
return win32_readlink(RSTRING_PTR(file));
|
209
210
|
}
|
210
211
|
|
212
|
+
// Win32::Symlink::symlink?(file)
|
211
213
|
static VALUE
|
212
214
|
rb_symlink_p(VALUE mod, VALUE file)
|
213
215
|
{
|
@@ -237,6 +239,8 @@ is_directory(wchar_t* path)
|
|
237
239
|
return false;
|
238
240
|
}
|
239
241
|
|
242
|
+
|
243
|
+
// Win32::Symlink::symlink(file, symlink)
|
240
244
|
static VALUE
|
241
245
|
rb_symlink(VALUE mod, VALUE target, VALUE symlink)
|
242
246
|
{
|
@@ -256,7 +260,7 @@ rb_symlink(VALUE mod, VALUE target, VALUE symlink)
|
|
256
260
|
wtarget = filecp_to_wstr(RSTRING_PTR(target), NULL);
|
257
261
|
wsymlink = filecp_to_wstr(RSTRING_PTR(symlink), NULL);
|
258
262
|
|
259
|
-
if( is_directory(
|
263
|
+
if( is_directory(wtarget) )
|
260
264
|
{
|
261
265
|
flags |= SYMBOLIC_LINK_FLAG_DIRECTORY;
|
262
266
|
}
|
Binary file
|
data/test/test_win32_symlink.rb
CHANGED
@@ -4,6 +4,8 @@ $LOAD_PATH.unshift File.join(File.dirname(File.dirname(__FILE__)), 'ext')
|
|
4
4
|
|
5
5
|
require 'test/unit'
|
6
6
|
require 'win32/symlink'
|
7
|
+
require 'fileutils'
|
8
|
+
|
7
9
|
include Win32
|
8
10
|
|
9
11
|
class Errno::E4390 < SystemCallError
|
@@ -52,8 +54,25 @@ class TC_Win32Symlink < Test::Unit::TestCase
|
|
52
54
|
end
|
53
55
|
end
|
54
56
|
|
57
|
+
def test_makelink_directory
|
58
|
+
Dir.chdir(ENV["TMP"]) do
|
59
|
+
Dir.mkdir('symlink-test-directory-target')
|
60
|
+
IO::write('symlink-test-directory-target/simple-file', 'some content')
|
61
|
+
|
62
|
+
Symlink.symlink('symlink-test-directory-target', 'symlink-test-directory-symlink')
|
63
|
+
|
64
|
+
assert(Symlink.symlink?('symlink-test-directory-symlink'))
|
65
|
+
|
66
|
+
assert(File.readable?('symlink-test-directory-symlink/simple-file'))
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
55
70
|
def teardown
|
56
|
-
|
71
|
+
tdir = File.join(ENV['TMP'], 'symlink-test*').gsub("\\", '/')
|
72
|
+
|
73
|
+
Dir.glob(tdir).each do |f|
|
74
|
+
FileUtils::rm_rf f
|
75
|
+
end
|
57
76
|
end
|
58
77
|
|
59
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win32-symlink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Kropivnitsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|