Class: EpubForge::Action::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/epubforge/action/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRunner

Returns a new instance of Runner.



8
9
10
# File 'lib/epubforge/action/runner.rb', line 8

def initialize
  reset
end

Instance Attribute Details

#actions_lookupObject

Returns the value of attribute actions_lookup.



6
7
8
# File 'lib/epubforge/action/runner.rb', line 6

def actions_lookup
  @actions_lookup
end

Instance Method Details

#exec(*args) ⇒ Object

order: project_dir(optional), keyword, args If a project_dir is not given, the current working directory is prepended to the arguments list. In some cases – well, really only ‘init’, this will be in error. Because the argument given does not exist yet, it will not recognize the first argument as pointing to a project.



26
27
28
29
30
31
32
33
34
# File 'lib/epubforge/action/runner.rb', line 26

def exec( *args )
  # remove project from arguments
  @args = args
  # first argument is the action's keyword
  # print help message if no keywords given
  parse_args
  
  run
end

#resetObject



12
13
14
15
# File 'lib/epubforge/action/runner.rb', line 12

def reset
  @args = []
  @run_description = RunDescription.new
end

#runObject



17
18
19
20
# File 'lib/epubforge/action/runner.rb', line 17

def run
  @run_description.run
  @run_description
end