I hereby claim:
- I am noelrappin on github.
- I am noelrap (https://keybase.io/noelrap) on keybase.
- I have a public key whose fingerprint is 84D8 DF21 E2A5 56CD 18B6 880B B7C9 5761 2D75 E81F
To claim this, I am signing this object:
import { | |
moduleFor, | |
test | |
} from 'ember-qunit'; | |
import Ember from 'ember'; | |
import startApp from '../../../../helpers/start-app'; | |
var App; | |
var store; |
# using machinist and Authlogic to crat | |
def login!(options = {}) | |
user = User.make(options) | |
set_session_for(user) | |
user | |
end | |
def set_session_for(user) | |
UserSession.create(user) |
def assert_methods(actual, methods = {}) | |
methods.each do |method, value| | |
assert_equal(value, actual.send(method), | |
"For method #{method} expected <#{value}>, got <#{actual.send(method)}>") | |
end | |
end | |
## usage: | |
assert_methods(@user, :name => "Fred", :email => "fred@fred.com", :comment_count => 12) |
I hereby claim:
To claim this, I am signing this object:
class Sequence | |
class << self | |
def sequences | |
Enumerator.new do |y| | |
sequence = Sequence.new | |
while sequence | |
sequence = sequence.next | |
break unless sequence |
require 'rubygems' | |
require 'rspec' | |
require 'sequence' | |
describe Sequence do | |
describe "validation" do | |
it "should be able to sum its items" do | |
sequence = Sequence.new(1, 2, 3, 4) |
cap staging deploy:cold rvm:ruby-1.9.2-p180@new_futuro | |
* executing `staging' | |
triggering start callbacks for `deploy:cold' | |
* executing `multistage:ensure' | |
* executing `deploy:cold' | |
* executing `deploy:update' | |
** transaction: start | |
* executing `deploy:update_code' | |
updating the cached checkout on all servers | |
executing locally: "git ls-remote git@github.com:obtiva/New-Futuro.git master" |
set :stages, %w(staging production) | |
set :default_stage, 'staging' | |
require 'capistrano/ext/multistage' rescue 'YOU NEED TO INSTALL THE capistrano-ext GEM' | |
require "bundler/capistrano" | |
set :application, "new_futuro" | |
set :repository, "git@github.com:obtiva/New-Futuro.git" | |
default_run_options[:pty] = true | |
set :scm, "git" |
# based on an idea by Gavin Mulligan | |
# http://gavin-mulligan.tumblr.com/post/3825225016/simple-rails-3-enumerations | |
# this version differs because | |
# * it returns StringInquirers rather than symbols, | |
# because I'll take any excuse to use StringInquirers | |
# * It uses meta program methods directly rather than class_eval | |
# * It auto-loads itself into ActiveRecord::Base | |
# * It supports a default option that uses default_value_for to set a default | |
# |
# from the erb2haml gem by David Leung | |
# copied to a gist for easier integration into our Rails 2 training | |
require 'find' | |
RED_FG ="\033[31m" | |
GREEN_FG = "\033[32m" | |
END_TEXT_STYLE = "\033[0m" | |
# Helper method to inject ASCII escape sequences for colorized output |