Changeset 570

Show
Ignore:
Timestamp:
06/30/08 13:11:44 (2 months ago)
Author:
bbleything
Message:
  • add command infrastructure spec
  • change command infrastructure to return true/false from predicates for easier testing
  • fix small bug in command infrastructure that was obscured by attr_readers in implementing classes
Files:

Legend:

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

    r564 r570  
    4444        arg_list = @arguments.map {|a| "<#{a.to_s}>"}.join( ' ' ) 
    4545 
    46         output << "Usage: #{@plugin.short_name} #{name} #{arg_list}" 
     46        output << "Usage: #{@plugin.short_name} #{@name} #{arg_list}" 
    4747 
    4848        return output.join( "\n" ) 
     
    8383 
    8484    def requires_confirmation? 
    85         @require_confirmation 
     85        return true if @require_confirmation 
     86        return false 
    8687    end 
    8788     
    8889    def can_inspect? 
    89         @inspect_proc 
     90        return true if @inspect_proc 
     91        return false 
    9092    end 
    9193end