Exception: Rake::ToolkitProgram::WrongArgumentCount

Inherits:
InvalidCommandLine show all
Includes:
ProgramExitFromError
Defined in:
lib/rake/toolkit_program/errors.rb

Instance Method Summary collapse

Methods included from ProgramExitFromError

#exit_code, #exit_program!, included, #print_error_message

Methods inherited from InvalidCommandLine

#print_error_message

Constructor Details

#initialize(cardinality_test, actual_count) ⇒ WrongArgumentCount

Returns a new instance of WrongArgumentCount.



65
66
67
68
69
70
71
72
73
74
# File 'lib/rake/toolkit_program/errors.rb', line 65

def initialize(cardinality_test, actual_count)
  super(case cardinality_test
  when Integer
    "expected #{cardinality_test} arguments, got #{actual_count}"
  when Range
    "expected #{cardinality_test.to_inclusive} (inclusive) arguments, got #{actual_count}"
  else
    "#{actual_count} arguments given"
  end)
end