warden/lib/warden/repl/repl_v2.rb
# Returns a prettified description [String] of all commands defined in the
# Warden protocol gem.
#
# Parameters:
# - command_list_width [Integer]:
#       Non-negative integer that can be used format the width to be
#       printed between a command name and its description. The default
#       value of zero formats the width to be two whitespaces more than the
#       longest command name defined among all commands.
Returns a prettified description [String] of all commands defined in the
Warden protocol gem.

command_list_width [Integer]:
Non-negative integer that can be used format the width to be
printed between a command name and its description. The default
value of zero formats the width to be two whitespaces more than the
longest command name defined among all commands.
Returns a prettified description [ String ] of all commands defined in the Warden protocol gem . command_list_width [ Integer ] : Non - negative integer that can be used format the width to be printed between a command name and its description . The default value of zero formats the width to be two whitespaces more than the longest command name defined among all commands .
def describe_commands(command_list_width = 0)
      command_list_width ||= 0
      if !(command_list_width.is_a?(Integer) && command_list_width >= 0)
        raise ArgumentError, "command_list_width should be a non-negative Integer."
      end
      text = "\n"
      unless command_list_width > 0
        command_descriptions.each do |command, description|
          command_list_width = command.size if command.size > command_list_width
        end
        command_list_width += 2
      end
      command_descriptions.each_pair do |command, description|
        if command == "run"
          description = self.class.run_command_description
        end
        text << "\t%-#{command_list_width}s%s\n" % [command, description]
      end
      text << "\t%-#{command_list_width}s%s\n" % ["help", "Show help."]
      text << "\nUse --help with each command for more information.\n"
      text
    end
def describe_commands ( command_list_width = 0 ) command_list_width ||= 0 if ! ( command_list_width . is_a? ( Integer ) && command_list_width >= 0 ) raise ArgumentError , "command_list_width should be a non-negative Integer." end text = "\n" unless command_list_width > 0 command_descriptions . each do | command , description | command_list_width = command . size if command . size > command_list_width end command_list_width += 2 end command_descriptions . each_pair do | command , description | if command == "run" description = self . class . run_command_description end text << "\t%-#{command_list_width}s%s\n" % [ command , description ] end text << "\t%-#{command_list_width}s%s\n" % [ "help" , "Show help." ] text << "\nUse --help with each command for more information.\n" text end
Returns a prettified description [String] of all commands defined in the
Warden protocol gem.
Returns a prettified description [ String ] of all commands defined in the Warden protocol gem .
# TODO: Need to eliminate special case for run command.
command_list_width
<not_specific>