This file contains 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 Hash(*args, &block) | |
if args.any? | |
args[0] | |
else | |
Hash.from_block &block | |
end | |
end | |
class Hash | |
def self.from_block &block |
This file contains 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
require 'rubygems' rescue nil | |
require 'gosu' | |
require 'chipmunk' | |
class Array | |
# e.g. [1,2,3].each_link yields [1,2], [2,3] | |
def each_link | |
prev = first | |
self[1, size].each do |item| | |
yield prev, item |
This file contains 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
scope 'merb-gen' do | |
# do merb-gen stuff here | |
end | |
scope 'monkey' do | |
# do monkey stuff here | |
end | |
[ew[ |