Method: Helper.open_directory

Defined in:
lib/helper.rb

.open_directory(path, confirm_message = nil) ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/helper.rb', line 65

def open_directory(path, confirm_message = nil)
  if confirm_message
    return unless Narou::Input.confirm(confirm_message, false, false)
  end
  case determine_os
  when :windows
    system(%!explorer "file:///#{path.encode(Encoding::Windows_31J)}"!)
  when :cygwin
    system(%!cygstart "#{path}"!)
  when :mac
    system(%!open "#{path}"!)
  else
    open_browser_linux(path, "フォルダが開けませんでした")
  end
end