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
# ... bottom of your development.rb | |
if File.exists?(File.join(RAILS_ROOT,'tmp', 'debug.txt')) | |
require 'ruby-debug' | |
Debugger.wait_connection = true | |
Debugger.start_remote | |
File.delete(File.join(RAILS_ROOT,'tmp', 'debug.txt')) | |
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
/´¯/) | |
,/¯ / | |
/ /´¯/'¯¯'/´¯¯¯`·¸ | |
/ / / / /¨¯\ | |
('( ´ ´ ¯~/' ') | |
\ ' / | |
'' \ _ ·´ | |
\ ( | |
\ \ |
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 'fileutils' | |
require 'open-uri' | |
## | |
# multiruby_setup is a script to help you manage multiruby. | |
# | |
# usage: multiruby_setup [-h|cmd|spec...] | |
# | |
# cmds: | |
# |
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 ValidatesTimeliness | |
module ActiveRecord | |
# Rails 2.1 removed the ability to retrieve the raw value of a time or datetime | |
# attribute. The raw value is necessary to properly validate a string time or | |
# datetime value instead of the internal Rails type casting which is very limited | |
# and does not allow custom formats. These methods restore that ability while | |
# respecting the automatic timezone handling. | |
# | |
# The automatic timezone handling sets the assigned attribute value to the current |
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 'action_mailer' | |
## | |
# Adds sending email through an ActiveRecord table as a delivery method for | |
# ActionMailer. | |
# | |
class ActionMailer::ARMailer < ActionMailer::Base | |
def self.inherited(sub) |
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 'action_mailer' | |
## | |
# Adds sending email through an ActiveRecord table as a delivery method for | |
# ActionMailer. | |
# | |
class ActionMailer::ARMailer < ActionMailer::Base | |
def self.inherited(sub) |
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
# Any tasks you need class caching turned off for, just include this task as a dependency | |
# | |
# task :do_sumthin_tricky => [:disable_class_cache] do | |
# sumthin_tricky | |
# end | |
# | |
# Stick this file in your lib/tasks dir. You could also put the guts of it in your Rakefile to apply it to all rake tasks for your app. | |
task :disable_class_cache do | |
module Rails |
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
# to the tune of Old McDonald | |
I made a site, it looked quite good | |
IE IE oh! | |
And on this site there was a bug | |
IE IE oh! | |
With a box hack here | |
And a margin hack there | |
Here a hack, there a hack | |
Everywhere a hack-hack |
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
Then /^I should see "([^\"]*)" value updated to "([^\"]*)"$/ do |dom_id, value| | |
current_value_of(dom_id).should == value | |
end | |
Then /^I should see "([^\"]*)" text updated to "([^\"]*)"$/ do |dom_id, value| | |
current_text_of(dom_id).should == value | |
end | |
def current_value_of(dom_id) | |
dom_id = "##{dom_id}" unless dom_id.starts_with?('#') |
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
# Defines a method on modules and classes to output the modules it has been extended with. | |
# This works because extending class really just includes the module into the classes metaclass. | |
class Module | |
def extended_modules | |
# this exposes the metaclass and for any code inside, self is scoped to the metaclass | |
class << self | |
self.included_modules | |
end | |
end |
OlderNewer