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
class Group | |
module Error | |
class Standard < StandardError; end | |
class AlreadyAMember < Standard | |
def message | |
"You are already a member of this group." | |
end | |
end |
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
#!/usr/bin/env ruby | |
def match_message(regexp) | |
m = Module.new | |
(class << m; self; end).instance_eval do | |
define_method(:===) do |error| | |
regexp === error.message | |
end | |
end | |
m |
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
var fs = require('fs'); | |
fs.mkdir('./hello',0777,makeDirectory); | |
function makeDirectory(err){ | |
if (err) throw err; | |
fs.writeFile('./hello/world.txt', 'Hello!', writeFile); | |
} | |
function writeFile(err){ |
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
source 'http://rubygems.org' | |
gem 'rails', '3.0.4' | |
group :test do | |
gem 'database_cleaner' | |
gem 'rspec-rails' | |
gem 'rspec-rails-matchers' | |
gem 'sham' | |
gem 'spork', '=0.9.0.rc7' |
NewerOlder