Skip to content

Instantly share code, notes, and snippets.

Module.class_eval do
def temporal_const(name, value)
const_set(name, value)
yield
remove_const(name)
end
end
in use ...
%table
%tr
%th.label  
%th.label bigtiger
%th.label l4rk
%th.label tpope
%th.label sandro
%th.label leshill
%tr
%td.label bigtiger
class SessionsController < ApplicationController
include Clearance::App::Controllers::SessionsController
layout :session
end
namespace :thinking_sphinx do
namespace :test do
def usage
"thinking_sphinx:test:prepare"
end
desc "Indexes test environment to allow integration testing"
task :prepare do
ENV['RAILS_ENV'] = 'test'
Rake::Task["thinking_sphinx:index"].invoke
end
module ThinkingSphinx
class SpecHelper
def start_sphinx
system('rake', 'ts:start', 'RAILS_ENV=test')
end
def stop_sphinx
system('rake', 'ts:stop', 'RAILS_ENV=test')
end
As a
I want
So that
In our experience the "So that" was too often ignored or not given the attention it deserved.
Roles are easy to figure out, as is what features people want. The hardest thing to put into words and
arguably the most important is what value this feature provides.
This story format (attributed to Liz Keogh here: http://www.agilemanagement.net/Articles/Weblog/NewUserStoryFormat.html)
class A
def goal
1
end
end
a = A.new
[a, a, a].sum(&:goal) #=> 3
bigt:(git)blair_advanced[master]/$ spec -fs spec/models/article_spec.rb
Missing the Rails 2.3.5 gem. Please `gem install -v=2.3.5 rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.
until (jumpstart_lab + edgecase + friends) >= $6000
us += your_donation > $25 ? your_donation : $25
end
# Email [email protected] or
# Mention @rubygives with a link and donation ammount