Show
Ignore:
Timestamp:
07/24/08 19:47:42 (4 months ago)
Author:
deveiant
Message:

Updated build system

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/rakefile-work/utils.rb

    r87 r94  
    292292 
    293293 
     294    ### Display a description of a potentially-dangerous task, and prompt 
     295    ### for confirmation. If the user answers with anything that begins 
     296    ### with 'y', yield to the block, else raise with an error. 
     297    def ask_for_confirmation( description ) 
     298        puts description 
     299 
     300        answer = prompt_with_default( "Continue?", 'n' ) do |input| 
     301            input =~ /^[yn]/i 
     302        end 
     303 
     304        case answer 
     305        when /^y/i 
     306            yield 
     307        else 
     308            error "Aborted." 
     309            fail 
     310        end 
     311    end 
     312 
     313 
    294314    ### Search for the program specified by the given <tt>progname</tt> in the 
    295315    ### user's <tt>PATH</tt>, and return the full path to it, or <tt>nil</tt> if