This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def ask(question, default=nil, valid = /.*/, multiline=false) | |
output = question | |
output << " [#{default}]" unless default.nil? | |
output << " (Optional)" if valid =~ "" | |
output << ": " | |
puts output | |
matches = false | |
answer = default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Welcome to hell... and the reason | |
// for the ability to embed variables | |
// in strings. Yes, this is effectively the | |
// same as just writing the damn thing out. | |
// And yes, I did generate this code - I'm not | |
// that insane. | |
outputBottleStatement(int numBottles) { | |
if (numBottles == 99) { | |
print("99 bottles of beer on the wall, 99 bottles of beer."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this to a buildr 'buildfile' to receive growl notifications when compilation | |
# completes or fails (including cc compilations) | |
require 'ruby_gntp' | |
# Growl setup | |
Buildr.application.on_completion do |title, message| | |
GNTP.notify({ | |
:app_name => "buildr", | |
:title => title, |