Class: Forklift::UI

Inherits:
Thor
  • Object
show all
Defined in:
lib/forklift/ui.rb

Defined Under Namespace

Classes: Remote

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args) ⇒ Object

If a task is not found on Thor::Runner, method missing is invoked and Thor::Runner is then responsable for finding the task in all classes.



15
16
17
18
19
20
# File 'lib/forklift/ui.rb', line 15

def method_missing(meth, *args)
  meth = meth.to_s
  klass, task = Thor::Util.find_class_and_task_by_namespace(meth)
  args.unshift(task) if task
  klass.start(args, :shell => self.shell)
end

Class Method Details



22
23
24
# File 'lib/forklift/ui.rb', line 22

def self.banner(task, all = false, subcommand = false)
  "forklift " + task.formatted_usage(self, all, subcommand)
end

Instance Method Details

#startObject



27
28
29
# File 'lib/forklift/ui.rb', line 27

def start
  Forklift::Master.new.start.join
end