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
| strictly_for_fun? | |
| make_happy | |
| make_depressed | |
| willing_to_give_up_manhood? | |
| make_depressed | |
| willing_to_give_up_manhood? |
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
| require 'rubygems' | |
| require 'transitions' | |
| # show me the caller name | |
| module Wombatize | |
| def method_name | |
| caller[0][/`([^']*)'/, 1] | |
| end | |
| 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
| make_depressed | |
| Willing to giveup manhood? | |
| make_depressed | |
| Willing to giveup manhood? |
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
| gem "mongoid", "~> 2.0.0.rc.6" | |
| gem "bson_ext", "~> 1.2" | |
| group :test, :development do | |
| gem "rspec-rails", "~> 2.4" | |
| gem "jslint_on_rails" | |
| end | |
| group(:test) do |
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
| require 'spec_helper' | |
| describe "Application" do | |
| # TODO: implement | |
| pending "should earn loads of money" | |
| 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
| require 'spec_helper' | |
| describe Cat do | |
| describe "validations" do | |
| it "should be valid" do | |
| cat = Cat.new(:name => "panther", :url => "http://great.panther.com/pan.jpg") | |
| cat.should be_valid | |
| 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
| class Cat | |
| include Mongoid::Document | |
| include ActiveModel::Validations | |
| # fields | |
| field :name | |
| field :url, :type => String | |
| # validations |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Gib moneyz!</title> | |
| <%= csrf_meta_tag %> | |
| <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> | |
| <%= stylesheet_link_tag "reset.css", "960.css", "application.css" %> | |
| <%= javascript_include_tag "jquery-1.5.1.min", "application" %> | |
| </head> | |
| <body> |
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
| require 'spec_helper' | |
| describe CatsController do | |
| describe "#index" do | |
| it "should display cats" do | |
| get :index | |
| response.status.should eql(200) | |
| end | |
| 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
| require "benchmark" | |
| module Functional | |
| def memo | |
| cache = {} | |
| lambda do |*args| | |
| unless cache.has_key?(args) | |
| cache[args] = self[*args] | |
| end |