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
You have joined the channel | |
Pseudomonkey: I ONLY DRINK THE BLOOD OF MY ENEMIES | |
AdamSeabrook: I am so rich I pay my peons to drink for me | |
Disconnected |
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
field :name | |
accessible | |
validates :presence do | |
message "please provide a name" | |
end | |
end | |
field :email | |
accessible | |
validates :format 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
# I have a class that delegates functionality to a couple of objects that it | |
# constructs. I want to test this in isolation. I want to make sure that the | |
# objects are constructed with the right arguments. I also want to make sure | |
# that the results from the objects are handled correctly. | |
# | |
# I'm finding it hard to structure the code and test in a way that isn't | |
# cumbersome. What's below works, but it feels like a lot of stubbing and setup | |
# for something the should be simpler. | |
# |
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 password_required? | |
!persisted? || password.present? || password_confirmation.present? | |
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
Failure/Error: Unable to find matching line from backtrace | |
SQLite3::SQLException: cannot start a transaction within a transaction: begin transaction | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:97:in `close' | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:97:in `ensure in prepare' | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:97:in `prepare' | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:134:in `execute' | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/gems/sqlite3-1.3.5/lib/sqlite3/database.rb:484:in `transaction' | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/bundler/gems/rails-ee6e3c128b72/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:304:in `block in begin_db_transaction' | |
# /Users/jaredfraser/.rvm/gems/ruby-1.9.3-p0-falcon/bundler/gems/rails-ee6 |
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
RSpec.configure do |config| | |
counter = -1 | |
config.after(:each) do | |
counter += 1 | |
if counter > 9 | |
GC.enable | |
GC.start | |
GC.disable | |
counter = 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
var Inspect = { | |
TYPE_FUNCTION: 'function', | |
// Returns an array of (the names of) all methods | |
methods: function(obj) { | |
var testObj = obj || self; | |
var methods = []; | |
for (prop in testObj) { | |
if (typeof testObj[prop] == Inspect.TYPE_FUNCTION && typeof Inspect[prop] != Inspect.TYPE_FUNCTION) { | |
methods.push(prop); | |
} |
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
class DeferredGarbageCollection | |
DEFERRED_GC_THRESHOLD = (ENV['DEFER_GC'] || 10.0).to_f | |
@@last_gc_run = Time.now | |
def self.start | |
GC.disable if DEFERRED_GC_THRESHOLD > 0 | |
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
From 2fb8432982b7e8ffc4c05f912f47cd9ca7261427 Mon Sep 17 00:00:00 2001 | |
From: Xavier Shay <xavier@rhnh.net> | |
Date: Sun, 1 May 2011 10:25:18 +1000 | |
Subject: [PATCH] Disable some edge cases in requiring to speed it up. | |
--- | |
load.c | 1 + | |
1 files changed, 1 insertions(+), 0 deletions(-) | |
diff --git a/load.c b/load.c |
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 Resque | |
class Task | |
attr_accessor :parent, :args | |
attr_accessor :queue, :failed_at, :payload, :exception, :error, :backtrace, :worker | |
def initialize(options={}) | |
options['parent'] = options.delete('class') | |
options.each do |opt, val| | |
self.send("#{opt}=", val) | |
end |