class Hodor::Cli::Runner

Public Class Methods

handle_no_command_error(command, bv) click to toggle source
# File lib/hodor/cli.rb, line 104
def self.handle_no_command_error(command, bv)
  raise CommandNotFound.new("No Such Command: #{command.inspect}")
end

Public Instance Methods

help(meth = nil) click to toggle source
Calls superclass method
# File lib/hodor/cli.rb, line 23
def help(meth = nil)
  if meth && !self.respond_to?(meth)
    super
  else
    overview = %Q[Hodor is an object-oriented scripting toolkit and Ruby-based API that automates and simplifies the way you
    specify, deploy, test, inspect and administer your hadoop cluster and Oozie workflows. Hodor commands follow
    the convention of:

       $ hodor [namespace]:[command] [arguments] [options]

    To get more information about the namespaces and commands available in Hodor, run:

       $ hodor -T

    WARNING! Hodor must be run via 'bundle exec'. For example:

       $ bundle exec hodor -T

    Note: examples shown in help pages don't show the 'bundle exec' prefix because they assume you have the following alias in place:

       $ alias hodor='bundle exec hodor'
    ].unindent(10)
    say overview
  end
end
list(search = "") click to toggle source
Calls superclass method
# File lib/hodor/cli.rb, line 51
def list(search = "")
  overview = %Q[
  Hodor's Namespaces & Commands
  ======================================================================================================
  Hodor divides its command set into the namespaces shown below (e.g. 'oozie', 'hdfs', 'master' etc.) Each
  namespace contains a set of commands that support the overall purpose of its parent namespace. For example, the
  hdfs namespace includes commands to list, put and get files to/from a remote HDFS volume. The following table shows
  all the namespaces Hodor supports, along with a short description of the commands that fall within each namespace.

  ].unindent(8)

  say overview
  super

  more_help = %Q[Getting More Help:
  ------------------
  Each Hodor namespace offers full help, including an overview of the namespace itself, references to "topic
  pages" that explain core concepts implemented by the namespace and detailed help for each command that falls
  within the namespace. To access help for a Hodor namespace, run hodor passing <namespace> as the sole
  argument. For example, to see help for Hodor's Oozie namespace, run:

    $ hodor oozie
    $ hodor help oozie   # alternate, works the same

  Furthermore, to see detailed help for the oozie:display_job command, run:

    $ hodor help oozie:display_job
    $ hodor oozie:help display_job    # alternate, works the same

  Lastly, to see the topic page that explains the "corresponding paths" concept, that is central to the
  Hdfs namespace, run:

    $ hodor hdfs:topic corresponding_paths

  And to obtain a list of all topics available within the oozie namespace, for example, run:

    $ hodor oozie:topics
  ].unindent(8)
  say more_help
end
method_missing(meth, *args) click to toggle source
Calls superclass method
# File lib/hodor/cli.rb, line 93
def method_missing(meth, *args)
  if args[0].eql?('nocorrect')
    fail %Q[You are using a shell alias with an improper trailing space. For example:
               alias dj='bundle exec hodor oozie:display_job' (works)
               alias dj='bundle exec hodor oozie:display_job ' (fails)]
  end
  super meth, *args
rescue
  raise
end
thorfiles(*args) click to toggle source
# File lib/hodor/cli.rb, line 109
def thorfiles(*args)
  Dir[File.join(File.dirname(__FILE__), '..', 'tasks/**/*.thor')]
end