Changeset 94 for branches/rakefile-work/utils.rb
- Timestamp:
- 07/24/08 19:47:42 (4 months ago)
- Files:
-
- 1 modified
-
branches/rakefile-work/utils.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/rakefile-work/utils.rb
r87 r94 292 292 293 293 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 294 314 ### Search for the program specified by the given <tt>progname</tt> in the 295 315 ### user's <tt>PATH</tt>, and return the full path to it, or <tt>nil</tt> if
