Add open_file() to work around url vs file handling issues on cygwin
git-svn-id: file:///home/svn/framework3/trunk@7390 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
parent
1dad276f58
commit
5d129bdb53
|
@ -92,11 +92,21 @@ def self.cygwin_to_win32(path)
|
|||
dir.join("\\")
|
||||
end
|
||||
|
||||
def self.open_file(url='')
|
||||
case RUBY_PLATFORM
|
||||
when /cygwin/
|
||||
path = cygwin_to_win32(url)
|
||||
system(["cmd", "cmd"], "/c", "explorer", path)
|
||||
else
|
||||
self.open_browser(url)
|
||||
end
|
||||
end
|
||||
|
||||
def self.open_browser(url='http://metasploit.com/')
|
||||
case RUBY_PLATFORM
|
||||
when /cygwin/
|
||||
if(url[0,1] == "/")
|
||||
url = cygwin_to_win32(url)
|
||||
self.open_file(url)
|
||||
end
|
||||
system(["cmd", "cmd"], "/c", "start", url)
|
||||
when /mswin32/
|
||||
|
|
Loading…
Reference in New Issue