Class: CommandRunner
- Inherits:
-
Object
- Object
- CommandRunner
- Defined in:
- lib/command_runner.rb
Instance Method Summary collapse
- #call(command) ⇒ Object
-
#initialize(hexagon, name, dry_run = false) ⇒ CommandRunner
constructor
A new instance of CommandRunner.
Constructor Details
#initialize(hexagon, name, dry_run = false) ⇒ CommandRunner
3 4 5 6 7 |
# File 'lib/command_runner.rb', line 3 def initialize(hexagon, name, dry_run = false) @hexagon = hexagon @dry_run = dry_run @name = name end |
Instance Method Details
#call(command) ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/command_runner.rb', line 9 def call(command) output = full_command(command) unless File.directory?('tmp') FileUtils.mkdir('tmp') end File.open('tmp/hecks', 'a') { |file| file.write(output + "\n") } return if dry_run end |