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
xml.instruct! | |
xml.declare! :DOCTYPE, :plist, :PUBLIC, "-//Apple Computer//DTD PLIST 1.0//EN", "http://www.apple.com/DTDs/PropertyList-1.0.dtd" | |
xml.plist("version" => 1.0) do |plist| | |
plist.dict do |dict| | |
Things.find_in_batches do |things| | |
things.each do |thing| | |
dict.key thing.id | |
dict.array do |array| | |
array.string thing.name | |
array.string thing.address |
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 Downcase | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
# execute the request using our Rails app | |
status, headers, body = @app.call(env) | |
if status == 404 and url = downcased_url(env['REQUEST_URI']) |
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
<VirtualHost *:80> | |
ServerName site.tv | |
ServerAlias www.site.tv | |
RewriteEngine On | |
RewriteRule ^/(.*) http://site.co.uk/$1 [L,R=301] | |
ServerSignature On | |
</VirtualHost> |
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 IO | |
alias :old_puts puts | |
def puts(thing) | |
if not thing.to_s.match(/\A\*\* Erubis [\d|\.]+\Z/) | |
return old_puts(thing) | |
end | |
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
require 'net/imap' | |
require 'rubygems' | |
require 'tmail' | |
class Net::IMAP | |
def idle | |
cmd = "IDLE" | |
synchronize do | |
tag = generate_tag | |
put_string(tag + " " + cmd) |
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
(master) pleb:testfail will$ rake spec | |
(in /Users/will/www/testfail) | |
NOTICE: CREATE TABLE will create implicit sequence "fleas_id_seq" for serial column "fleas.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "fleas_pkey" for table "fleas" | |
NOTICE: CREATE TABLE will create implicit sequence "tentacles_id_seq" for serial column "tentacles.id" | |
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tentacles_pkey" for table "tentacles" | |
FWARNING: there is already a transaction in progress | |
F | |
1) Tentacle shizzle should fail because of the paperclip validation |
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
after(:each) do | |
FileUtils.remove_entry_secure(PROJECTS_ROOT) | |
File.unlink @file if File.exists? @file | |
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
after(:each) do | |
FileUtils.remove_entry_secure(PROJECTS_ROOT) if File.exists? PROJECTS_ROOT | |
File.unlink @file if File.exists? @file | |
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
TypeError (can't convert nil into String): | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/template/resolver.rb:60:in `<<' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/template/resolver.rb:60:in `build_path' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/template/resolver.rb:53:in `find_templates' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/template/resolver.rb:19:in `find_all' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/template/resolver.rb:37:in `cached' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/template/resolver.rb:18:in `find_all' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/paths.rb:20:in `find_all' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/paths.rb:19:in `each' | |
/Library/Ruby/Gems/1.8/gems/actionpack-3.0.0.beta4/lib/action_view/paths.rb:19:in `find_all' |
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
Warden::Manager.before_failure do |env, opts| | |
request = env["action_controller.rescue.request"] ||= ActionController::Request.new(env) | |
request.params["controller"] = "static_site_autheticator" | |
env['action_dispatch.request.path_parameters'][:action] = "login" | |
end |