Class: Elm::Runnable

Inherits:
Object
  • Object
show all
Includes:
Contracts::Builtin, Contracts::Core
Defined in:
lib/elm/runnable.rb

Overview

Run command

Constant Summary collapse

RunStatus =
Or[RunSuccess, RunError]

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ Runnable

Returns a new instance of Runnable.



42
43
44
45
46
47
48
49
50
51
# File 'lib/elm/runnable.rb', line 42

def initialize(command)
  @command = command

  unless exists?
    raise ExecutableNotFoundError,
          "Please install executable '#{@command}'"
  end

  self
end

Instance Method Details

#run(options) ⇒ Object



54
55
56
# File 'lib/elm/runnable.rb', line 54

def run
  run []
end