i
[chise/ruby.git] / chise / util.rb
1 # Copyright (C) 2002-2004 Kouichirou Eto, All rights reserved.
2
3 module CHISE
4   def unix_to_win(unix_path)
5     win = unix_path.gsub(/</, "(")
6     win = win.gsub(/>/, ")")
7     win = win.gsub(/\*/, "+")
8     win = win.gsub(/\?/, "!")
9     win
10   end
11
12   def win_to_unix(win_path)
13     unix = win_path.gsub(/\)/, ">")
14     unix = unix.gsub(/\(/, "<")
15     unix = unix.gsub(/\!/, "?")
16     unix = unix.gsub(/\+/, "*")
17     unix
18   end
19   module_function :unix_to_win, :win_to_unix
20 end