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 A | |
def goal | |
1 | |
end | |
end | |
a = A.new | |
[a, a, a].sum(&:goal) #=> 3 |
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
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) |
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
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 | |
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
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 |
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 SessionsController < ApplicationController | |
include Clearance::App::Controllers::SessionsController | |
layout :session | |
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
%table | |
%tr | |
%th.label | |
%th.label bigtiger | |
%th.label l4rk | |
%th.label tpope | |
%th.label sandro | |
%th.label leshill | |
%tr | |
%td.label bigtiger |
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
Module.class_eval do | |
def temporal_const(name, value) | |
const_set(name, value) | |
yield | |
remove_const(name) | |
end | |
end | |
in use ... |
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
# Reparse a URL to get a hash of route params. | |
>> url ="/New-Homes/Search/Georgia/Atlanta/townhome-5000000-maximum-price-100000-minimum-price-5d6qe+5d6tw+5d6sv" | |
=> "/New-Homes/Search/Georgia/Atlanta/townhome-5000000-maximum-price-100000-minimum-price-5d6qe+5d6tw+5d6sv" | |
>> ActionController::Routing::Routes.recognize_path(url) | |
=> {:state=>"Georgia", :action=>"index", :refinement=>"townhome-5000000-maximum-price-100000-minimum-price-5d6qe+5d6tw+5d6sv", :city=>"Atlanta", :controller=>"communities", :channel=>"Search"} | |
# Note: The New-Homes segment is a prefix in our routes and not returned in the params. |
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
bigt:~/git_hashrocket/namecheap$ !spec | |
spec -c spec/*_spec.rb | |
..........*. | |
Pending: | |
NamecheapAPI Wrapper#is_domain_available? should return true if connections succeeds and domain is available (Need API Access To Namecheap.com) | |
Called from ./spec/namecheap_spec.rb:28 | |
Finished in 6.14485 seconds | |
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
Project T | |
sqlite3 | |
real 2m30.829s | |
user 1m58.699s | |
sys 0m25.293s | |
1 failure due to database specific sql | |
mysql |