Top Level Namespace
Defined Under Namespace
Classes: ShellCommand, ShellCommandFailure
Instance Method Summary
collapse
Instance Method Details
#do_command(command) ⇒ Object
4
5
6
|
# File 'lib/shell_commands.rb', line 4
def do_command(command)
ShellCommand.do_command(command)
end
|
#regex_result(regex) ⇒ Object
13
14
15
16
|
# File 'lib/shell_commands.rb', line 13
def regex_result(regex)
return regex.match(ShellCommand.last_result["result"]) if regex.class == "Regexp"
return Regexp.new(regex).match(ShellCommand.last_result["result"])
end
|
#result_matches(regex) ⇒ Object
8
9
10
11
|
# File 'lib/shell_commands.rb', line 8
def result_matches(regex)
return !regex.match(ShellCommand.last_result["result"]).nil? if regex.class == "Regexp"
return !Regexp.new(regex).match(ShellCommand.last_result["result"]).nil?
end
|