Module: Battlestation

Defined in:
lib/battlestation.rb,
lib/battlestation/ui.rb,
lib/battlestation/cli.rb,
lib/battlestation/plan.rb,
lib/battlestation/task.rb,
lib/battlestation/version.rb,
lib/battlestation/operations.rb,
lib/battlestation/operations/runner.rb,
lib/battlestation/operations/process_check.rb,
lib/battlestation/operations/executable_check.rb,
lib/battlestation/operations/file_exists_check.rb

Defined Under Namespace

Modules: Operations Classes: CLI, Plan, Task, UI

Constant Summary collapse

VERSION =
"0.0.3"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.uiObject

UI output



34
35
36
# File 'lib/battlestation.rb', line 34

def ui
  @ui ||= UI.new
end

Class Method Details

.load(filename) ⇒ Object

Load the Battlestation or Battlestation.rb file



15
16
17
18
19
20
21
22
23
24
# File 'lib/battlestation.rb', line 15

def load(filename)
  plan = eval(File.read(filename))
  return plan
rescue SyntaxError, NameError
  Battlestation.ui.error("Your Battlestation has syntax errors.")
  return nil
rescue
  Battlestation.ui.error("Some error occured, but we're not sure what happened.")
  return nil
end

.plan(opts = {}, &block) ⇒ Object

Plan a new battlestation

See README for details



29
30
31
# File 'lib/battlestation.rb', line 29

def plan(opts = {}, &block)
  return Plan.new opts, &block
end