Module: Nd::ShellScripts
- Defined in:
- lib/nd/shell_scripts.rb,
lib/nd/shell_scripts/version.rb
Constant Summary collapse
- VERSION =
"0.1.2"
Instance Method Summary collapse
- #args ⇒ Object
- #args? ⇒ Boolean
- #command_exists?(command) ⇒ Boolean
- #execute_and_record(command) ⇒ Object
Instance Method Details
#args ⇒ Object
9 10 11 |
# File 'lib/nd/shell_scripts.rb', line 9 def args ARGV.join(' ') end |
#args? ⇒ Boolean
13 14 15 |
# File 'lib/nd/shell_scripts.rb', line 13 def args? ARGV.any? end |
#command_exists?(command) ⇒ Boolean
17 18 19 |
# File 'lib/nd/shell_scripts.rb', line 17 def command_exists?(command) `which #{command}`.strip.length > 0 end |
#execute_and_record(command) ⇒ Object
5 6 7 |
# File 'lib/nd/shell_scripts.rb', line 5 def execute_and_record(command) exec "#{command} && rpt rec \"#{command}\"" end |