class EY::Thor

Public Class Methods

banner(task, task_help = false, subcommand = false) click to toggle source
banner_base() click to toggle source
handle_no_task_error(task) click to toggle source
# File lib/engineyard/thor.rb, line 181
def self.handle_no_task_error(task)
  raise UndefinedTaskError, "Could not find command #{task.inspect}."
end
subcommand(name, klass) click to toggle source
Calls superclass method Thor::subcommand
# File lib/engineyard/thor.rb, line 185
def self.subcommand(name, klass)
  @@subcommand_class_for ||= {}
  @@subcommand_class_for[name] = klass
  super
end
subcommand_class_for(name) click to toggle source
# File lib/engineyard/thor.rb, line 191
def self.subcommand_class_for(name)
  @@subcommand_class_for ||= {}
  @@subcommand_class_for[name]
end
subcommand_help(cmd) click to toggle source
# File lib/engineyard/thor.rb, line 145
      def self.subcommand_help(cmd)
        desc "#{cmd} help [COMMAND]", "Describe all subcommands or one specific subcommand."
        class_eval <<-RUBY
          def help(*args)
            if args.empty?
              ui.say "usage: #{banner_base} #{cmd} COMMAND"
              ui.say
              subcommands = self.class.printable_tasks.sort_by{|s| s[0] }
              subcommands.reject!{|t| t[0] =~ /#{cmd} help$/}
              ui.print_help(subcommands)
              ui.say self.class.send(:class_options_help, ui)
              ui.say "See #{banner_base} #{cmd} help COMMAND" +
                " for more information on a specific subcommand." if args.empty?
            else
              super
            end
          end
        RUBY
      end

Protected Class Methods

exit_on_failure?() click to toggle source
# File lib/engineyard/thor.rb, line 200
def self.exit_on_failure?
  true
end