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
# == Schema Information | |
# | |
# Table name: users | |
# | |
# id :integer not null, primary key | |
# active :boolean | |
# created_at :datetime | |
# updated_at :datetime | |
# |
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 Codebreaker | |
class Marker | |
EXACT_MATCH_INDICATOR = 'b' | |
COLOR_MATCH_INDICATOR = 'w' | |
def self.mark(secret, guess) | |
marker = self.new(secret) | |
marker.guess(guess) | |
marker.mark |
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
Feature: Marking a guess | |
In order to get more information about the secret code | |
As a code breaker | |
I would like to see marks for my guess | |
Mark Legend: | |
m (match) | |
indicates a matching color in the wrong position | |
p (positional match) | |
indicates a matching color in the correct position |
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 sources --add http://rubygems.org | |
Error fetching http://rubygems.org: | |
bad response Not Found 404 (http://docs.rubygems.org/specs.4.8.gz) |
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
def email | |
@emails = [] | |
ContactImport.transaction do | |
emailed_association_requests.to_send.each do |ear| | |
ear.create_association_with(user.business) | |
end | |
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
[carlhuda@Carlhudas-iMac bundler (env_bundle_refactor)]$ spec -c spec/bundler/directory_spec.rb -e 'Faking gems with directories with a simple directory structure stubbing out a gem with a directory -- 1 can bundle --cached' | |
F | |
1) | |
NoMethodError in 'Faking gems with directories with a simple directory structure stubbing out a gem with a directory -- 1 can bundle --cached' | |
undefined method `filename' for #<Bundler::Environment:0x1017309e0> | |
/Users/carlhuda/Developer/Source/bundler/lib/bundler/dsl.rb:135:in `_find_directory_source' | |
/Users/carlhuda/Developer/Source/bundler/lib/bundler/dsl.rb:117:in `_handle_vendored_option' | |
/Users/carlhuda/Developer/Source/bundler/lib/bundler/dsl.rb:104:in `gem' | |
/Users/carlhuda/Developer/Source/bundler/tmp/bundled_app/Gemfile:3:in `evaluate' |
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 Admin::BaseController do | |
describe 'before_filter' do | |
it 'should respond to :require_admin' do | |
controller.should respond_to(:require_admin) | |
end | |
end | |
describe 'not redirecting when user is an admin' 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
#!/usr/bin/env ruby | |
result = "" | |
STDIN.read.each do |line| | |
line.sub!(/(\s+)$/, "\n") | |
result << line | |
end | |
result.sub!(/(\n+)$/m, "\n") |
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 Kernel | |
def collate(*methods) | |
methods.inject({}) {|h,m| h[m] = send(m); h } | |
end | |
end | |
p [4, 3, 1, 5, 2].collate :max, :min | |
# => {:min=>1, :max=>5} |
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 search cucumber | |
*** LOCAL GEMS *** | |
cucumber (0.6.1, 0.5.3, 0.4.4, 0.4.3, 0.4.2, 0.3.104, 0.3.101, 0.3.100) | |
cucumber-rails (0.2.2) | |
$ sudo gem install cucumber | |
ERROR: could not find gem cucumber locally or in a repository |