This file contains 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 'mongoid' | |
require 'rspec' | |
require 'method_lister' | |
Mongoid.configure do |config| | |
name = "association_bug" | |
config.master = Mongo::Connection.new.db(name) | |
end |
This file contains 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 'mongoid' | |
require 'rspec' | |
require 'method_lister' | |
Mongoid.configure do |config| | |
name = "association_bug" | |
config.master = Mongo::Connection.new.db(name) | |
end |
This file contains 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::TaskManager.class_eval do | |
def delete_task(task_name) | |
@tasks.delete(task_name.to_s) | |
end | |
Rake.application.delete_task("db:test:purge") | |
end | |
namespace :db do | |
namespace :test do | |
task :purge do | |
ActiveRecord::Migrator.migrate("db/migrate/", 0) |
This file contains 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 stop_tomcat | |
puts "stopping tomcat" | |
end | |
def start_tomcat | |
puts "starting tomcat" | |
end | |
def restart | |
stop_tomcat |
This file contains 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 'rspec' | |
def split(original) | |
original.split("/").inject([]) do |result, element| | |
result + [(result.last||[]) + [element]] | |
end.reverse.map{ |variation| variation.join("/") } | |
end | |
describe "#category" do |
This file contains 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 'generator' | |
def before_yield(n) | |
puts "stopped at #{n}" | |
n | |
end | |
build_plan = Generator.new do |build_plan| | |
(1..10).each{ |n| build_plan.yield before_yield(n) } | |
end |
This file contains 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
+----+----------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+---------------------+-----------+-----------+-----------+------------+---------------------+---------------------+ | |
| id | priority | attempts | handler |
This file contains 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
+----+----------+----------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------------+---------------------+-----------+-----------+-----------+------------+---------------------+---------------------+ | |
| id | priority | attempts | handler |
This file contains 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 StrftimeOrdinal | |
def self.included(base) | |
base.class_eval do | |
alias_method :old_strftime, :strftime | |
def strftime(format) | |
old_strftime format.gsub("%o", day.ordinalize) | |
end | |
end | |
end | |
end |
This file contains 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
function stage() { heroku $@ --app $(basename `pwd`)-stage ;} | |
function production() { heroku $@ --app $(basename `pwd`)-production ;} |
OlderNewer