class HecksCLI::CommandRunner
Attributes
dry_run[R]
hexagon[R]
name[R]
Public Class Methods
new(hexagon, name, dry_run = false)
click to toggle source
Runs CLI Commands
# File lib/cli/command_runner.rb, line 5 def initialize(hexagon, name, dry_run = false) @hexagon = hexagon @dry_run = dry_run @name = name end
Public Instance Methods
call(command)
click to toggle source
# File lib/cli/command_runner.rb, line 11 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
Private Instance Methods
full_command(command)
click to toggle source
# File lib/cli/command_runner.rb, line 24 def full_command(command) (['hecks'] + command).join(' ') end