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
diff --git a/lib/ey_recipes/cli.rb b/lib/ey_recipes/cli.rb | |
index 3945c64..1816aea 100644 | |
--- a/lib/ey_recipes/cli.rb | |
+++ b/lib/ey_recipes/cli.rb | |
@@ -165,7 +165,7 @@ module EY::Recipes | |
end | |
file = "recipes.#{$$}.#{Time.now.to_i}.tmp.tgz" | |
- tarcmd = "git archive --format=tar HEAD | gzip > #{file}" | |
+ tarcmd = "git archive --format=tar $(git ls-tree HEAD cookbooks | awk '{print $3}') --prefix=cookbooks/ | gzip > #{file}" |
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 'hpricot' | |
require 'open-uri' | |
doc = Hpricot(open('http://stocknames.info')) | |
names = doc / '.list ul li' | |
puts names[rand(names.size)].innerText |
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
Enforcer "thoughtbot", "deadbeef" do | |
project "shoulda", "sseagal", "jcvandamme", "cnorris" | |
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
$ time rake test:parallel | |
(in /Users/jasonmorrison/dev/myapp/trunk) | |
2 processes for 49 tests, ~ 24 tests per process | |
Loaded suite -e | |
Started | |
.................................. (abbreviated) | |
29.32s user 3.31s system 143% cpu 22.669 total |
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
$ rake db:structure:dump | |
$ echo "create database myapp_test2;" | mysql -uroot | |
$ mysql -uroot -Dmyapp_test2 < db/development_structure.sql | |
$ vim config/database.yml # add some ERB to config/database.yml | |
test: | |
adapter: mysql | |
encoding: utf8 | |
database: myapp_test<%= ENV['TEST_ENV_NUMBER'] %> | |
username: root |
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
$ script/plugin install git://github.com/jasonm/parallel_specs.git |
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
$ time rake test:units test:functionals | |
Started | |
.......... (abbreviated... FOR BLOG READING SPEED!!) | |
415 tests, 898 assertions, 0 failures, 0 errors | |
29.14s user 3.74s system 87% cpu 37.614 total |
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 HouseSearch | |
attr_accessor :keyword, :price | |
def initialize(params) | |
params ||= {} | |
params.each do |key, value| | |
self.send("#{key}=", value) | |
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
class HouseSearchesController < ApplicationController | |
def index | |
@house_search = HouseSearch.new(params[:house_search]) | |
@houses = @house_search.results | |
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
class HouseSearchTest < ActiveSupport::TestCase | |
should "produce an error on the :price field when sent #new with an invalid price range" do | |
house_search = HouseSearch.new(:price => 'unknown') | |
assert_kind_of ActiveRecord::Errors, house_search.errors | |
assert_not_nil house_search.errors.on(:price) | |
end | |
end |
NewerOlder