1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

The argument of Shell.NameSpace should not be file path.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2006-12-26 12:09:57 +00:00
parent a17e7d92a2
commit 0aa4340d81
2 changed files with 14 additions and 6 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 26 21:02:14 2006 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* test/win32ole/test_folderitem2_invokeverb.rb: The argument
of Shell.NameSpace should not be file path.
Tue Dec 26 06:13:08 2006 Minero Aoki <aamine@loveruby.net>
* ext/bigdecimal/bigdecimal.c: remove useless method

View file

@ -16,14 +16,16 @@ if defined?(WIN32OLE)
#
@fso = WIN32OLE.new('Scripting.FileSystemObject')
@dummy_path = @fso.GetTempName
@dummy_file = @fso.GetTempName
@cfolder = @fso.getFolder(".")
f = @cfolder.CreateTextFile(@dummy_path)
f = @cfolder.CreateTextFile(@dummy_file)
f.close
@dummy_path = @cfolder.path + "\\" + @dummy_path
@dummy_path = @cfolder.path + "\\" + @dummy_file
@shell=WIN32OLE.new('Shell.Application')
@fi2 = @shell.NameSpace(@dummy_path).ParentFolder.ParseName(@shell.NameSpace(@dummy_path).Title)
@nsp = @shell.NameSpace(@cfolder.path)
@fi2 = @nsp.parseName(@dummy_file)
@shortcut = nil
#
@ -44,7 +46,7 @@ if defined?(WIN32OLE)
arlink = []
@cfolder.files.each do |f|
if /\.lnk$/ =~ f.path
linkinfo = @shell.NameSpace(f.path).self.getlink
linkinfo = @nsp.parseName(f.name).getLink
arlink.push f if linkinfo.path == path
end
end
@ -55,8 +57,9 @@ if defined?(WIN32OLE)
links = find_link(@dummy_path)
assert(0, links.size)
# Now create shortcut to @dummy_path
assert(@shortcut)
# Now create shortcut to @dummy_path
arg = WIN32OLE_VARIANT.new(@shortcut)
@fi2.InvokeVerb(arg)