Exception: Rake::ToolkitProgram::UnknownName
- Inherits:
-
StandardError
- Object
- StandardError
- Rake::ToolkitProgram::UnknownName
- Includes:
- ProgramExitFromError
- Defined in:
- lib/rake/toolkit_program/errors.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ UnknownName
constructor
A new instance of UnknownName.
- #print_error_message ⇒ Object
Methods included from ProgramExitFromError
#exit_code, #exit_program!, included
Constructor Details
#initialize(name) ⇒ UnknownName
Returns a new instance of UnknownName.
26 27 28 29 |
# File 'lib/rake/toolkit_program/errors.rb', line 26 def initialize(name) super("The command '#{name}' is not known") @name = name.to_s.dup.freeze end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
31 32 33 |
# File 'lib/rake/toolkit_program/errors.rb', line 31 def name @name end |
Instance Method Details
#print_error_message ⇒ Object
33 34 35 36 37 |
# File 'lib/rake/toolkit_program/errors.rb', line 33 def s = ToolkitProgram.help_styling $stderr.puts "#{s.error_marker '[ERROR]'} #{s.code name} is not a recognized command name." $stderr.puts "Use #{s.code "#{ToolkitProgram.script_name} help"} for a list of available commands." end |