class IRB::Command::Base
Attributes
Public Class Methods
Source
# File lib/irb/command/base.rb, line 19 def category(category = nil) @category = category if category @category || "No category" end
Source
# File lib/irb/command/base.rb, line 24 def description(description = nil) @description = description if description @description || "No description provided." end
Source
# File lib/irb/command/base.rb, line 41 def doc_dialog_content(name, width) lines = [] lines << Color.colorize(name, [:BOLD, :BLUE]) + Color.colorize(" (command)", [:CYAN]) lines << "" lines.concat(wrap_lines(description, width)) if help_message lines << "" lines.concat(wrap_lines(help_message, width)) end lines end
Returns formatted lines for display in the doc dialog popup.
Source
# File lib/irb/command/base.rb, line 34 def execute(irb_context, arg) new(irb_context).execute(arg) rescue CommandArgumentError => e puts e.message end
Source
# File lib/irb/command/base.rb, line 29 def help_message(help_message = nil) @help_message = help_message if help_message @help_message end
Source
# File lib/irb/command/base.rb, line 82 def initialize(irb_context) @irb_context = irb_context end