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
Message from = dmacro( | |
"returns the message chain for the argument given", | |
[code] | |
code deepCopy) |
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
JavaGround java:sql:ResultSet do( | |
mimic!(Mixins Enumerable) | |
each = dmacro( | |
[code] | |
while(self next, code evaluateOn(call ground, Rekoird Row mimic(self))) | |
self, | |
[argName, code] | |
lexical = call LexicalBlock createFrom(call list(argName, code), call ground) |
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
user stub!(:name) andReturn("Guybrush Threepwood") | |
user mock!(:occupation) andReturn("Fearsome Pirate") anyNumberOfTimes |
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
user = User mimic | |
user should receive(firstName: "Guybrush", authenticate!("Guybrush", "lechucksucks") andReturn(true)) | |
user authenticate!(user name, "lechucksucks") should be true |
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
user = mock! name andReturn("Guybrush", "Elaine", "LeChuck") | |
user name should == "Guybrush" | |
user name should == "Elaine" | |
user name should == "LeChuck" |
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
user should receive(username, name, firstName) andReturn("guybrush") | |
; is equivalent to | |
user should receive(username: "guybrush", name: "guybrush", firstName: "guybrush") | |
user should receive(reload, save) anyNumberOfTimes | |
; is equivalent to | |
user should receive(reload anyNumberOfTimes, save anyNumberOfTimes) | |
; is equivalent to | |
user should receive reload anyNumberOfTimes | |
user should receive save anyNumberOfTimes |
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
# Give the stack a name, and describe its members. | |
stack = Awsymandias::EC2::ApplicationStack.new("test") do |s| | |
s.role "db", :instance_type => "m1.large", ... | |
s.role "app", :instance_type => "c1.xlarge", ... | |
end | |
# Check if we're running by pulling stack description from SDB; if not, launch asynchronously. | |
stack.launch unless stack.running? | |
until stack.running? | |
sleep(5) |
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
class BlankHelper | |
include ActionView::Helpers::UrlHelper | |
include ActionView::Helpers::TagHelper | |
include ActionView::Helpers::TextHelper | |
include ActionView::Helpers::FormTagHelper | |
include ActionView::Helpers::CaptureHelper | |
include ActionView::Helpers::AssetTagHelper | |
attr_accessor_with_default :output_buffer, "" |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
UPS_URL = "http://wwwapps.ups.com/WebTracking/processRequest?AgreeToTermsAndConditions=yes&loc=en_US&tracknum=" | |
if ARGV.empty? | |
puts "Usage: ups_tracker tracking_number" and exit | |
end |
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
#!/usr/bin/env ruby | |
if ARGV.empty? | |
puts "Usage: gemmate <name-of-gem>" | |
else | |
src = `gem which #{ARGV[0]}`.split.last | |
lib_dir = src.slice 0, src.rindex("lib") | |
`mate -a '#{lib_dir}'` | |
end |