Class: Disloku::OsCommands

Inherits:
Object
  • Object
show all
Defined in:
lib/disloku/OsCommands.rb

Constant Summary collapse

@@os =
(RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/ ? :win : :unix)
@@commands =
{
	:openDir => {
		:win => "explorer \"$1\"",
		:unix => "xdg-open \"$1\"",
	}
}

Class Method Summary collapse

Class Method Details

.convertPath(path) ⇒ Object



22
23
24
# File 'lib/disloku/OsCommands.rb', line 22

def convertPath(path)
	return @@os == :win ? path.gsub(File::SEPARATOR, File::ALT_SEPARATOR) : path
end

.get(cmdKey, *args) ⇒ Object



18
19
20
# File 'lib/disloku/OsCommands.rb', line 18

def get(cmdKey, *args)
	return SysCmd.new(@@commands[cmdKey][@@os], *args)
end