Exception: Rake::ToolkitProgram::UnknownName

Inherits:
StandardError
  • Object
show all
Includes:
ProgramExitFromError
Defined in:
lib/rake/toolkit_program/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (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



33
34
35
36
37
# File 'lib/rake/toolkit_program/errors.rb', line 33

def print_error_message
  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