Changeset 577

Show
Ignore:
Timestamp:
07/01/08 16:17:50 (2 months ago)
Author:
bbleything
Message:
  • make the tests for @argument_type more explicit in the argument validator in SimpleCommand?
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • linen/trunk/lib/linen/simple_command.rb

    r564 r577  
    2020class Linen::Plugin::SimpleCommand 
    2121    include Linen::Plugin::CommandInfrastructure 
    22  
     22     
    2323    attr_reader :name 
    2424 
     
    6565        if @argument_type == :one_of 
    6666            return validate_one_of_arguments( args.first ) 
    67         else # @argument_type == :required 
     67        elsif @argument_type == :required 
    6868            return validate_required_arguments( args ) 
     69        else 
     70            # this is a Can't Happen(tm) so I'm comfortable with the crappy 
     71            # exception string.  :P 
     72            raise "Something has happened!" 
    6973        end 
    70  
    71         # this is a Can't Happen(tm) so I'm comfortable with the crappy 
    72         # exception string.  :P 
    73         raise "Something has happened!" 
    7474    end 
    7575