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|they) should see the email delivered from "([^"]*?)"$/ do |text| | |
#current_email.should be_delivered_from(text) | |
should_be_delivered_from(text) | |
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
# Rackup file for serving up a static site from a "public" directory | |
# | |
# Useful for chucking a static site on Heroku | |
class IndexRewriter | |
def initialize(app) @app = app end | |
def call(env) | |
env["PATH_INFO"].gsub! /\/$/, '/index.html' | |
@app.call(env) | |
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
delete_all [prefix=mephisto_production/bin_logs, @name=airbladesoftware]... | |
size: 2 | |
delete mephisto_production/bin_logs/mysql-bin.000001: true | |
size: 1 | |
...done |
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 'nokogiri' | |
ugly = Nokogiri::HTML ARGF | |
tidy = Nokogiri::XSLT File.open('tidy.xsl') | |
nice = tidy.transform(ugly).to_html | |
puts nice |
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 ApplicationController < ActionController::Base | |
include Intercession | |
before_filter :load_skin | |
before_filter :require_user | |
before_filter :require_matching_skin | |
before_filter :require_admin | |
def load_skin | |
session.skin = Skin.for_request(request) |
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
# Put this file in your config/initializers directory and behold a tastier auto_link! | |
module ActionView | |
module Helpers | |
module TextHelper | |
# Use auto_link and friends from Rails 3. They do the right thing (tm). | |
remove_const(:AUTO_LINK_RE) if defined?(AUTO_LINK_RE) | |
AUTO_LINK_RE = %r{ | |
( https?:// | www\. ) |
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
# PaperTrail's version class (existing code omitted for clarity). | |
class Version < ActiveRecord::Base | |
before_update :before_update_hook | |
after_update :after_update_hook | |
def before_update_hook | |
end | |
def after_update_hook | |
end |
NewerOlder