Skip to content

Instantly share code, notes, and snippets.

From f6b4095185f4aff912b3bda59033ed2d259da735 Mon Sep 17 00:00:00 2001
From: John Duff <duff.john@gmail.com>
Date: Thu, 18 Jun 2009 22:24:00 -0400
Subject: [PATCH] make pass through error code configurable
---
railties/lib/rails/rack/metal.rb | 8 ++++-
.../metal/multiplemetals/app/metal/metal_a.rb | 4 +-
.../metal/multiplemetals/app/metal/metal_b.rb | 4 +-
railties/test/metal_test.rb | 30 ++++++++++++++++++++
class Object
# Useage:
# @user.name.or("blank")
# if @user's name is nil or "", returns "blank", otherwise returns the name
def or(value)
(respond_to?(:empty?) ? empty? : !self) ? value : self
end
end
@jduff
jduff / gist:58791
Created February 5, 2009 16:18 — forked from rails/gist:58761
var DateHelper = {
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time
// Ruby strftime: %b %d, %Y %H:%M:%S GMT
time_ago_in_words_with_parsing: function(from) {
var date = new Date;
date.setTime(Date.parse(from));
return this.time_ago_in_words(date);
},
time_ago_in_words: function(from) {
module ApplicationHelper
# Example Useage:
# <%navigation do |nav|%>
# <%if logged_in? %>
# <%=nav.item :logout%>
# <%=nav.item :posts, :link=>user_posts_url(current_user),
# :selected_if=>Proc.new {|controller| controller.controller_name.to_sym == :posts}%>
# <%else%>
# <%=nav.item :signup%> #uses the signup_url helper
run "rm public/index.html"
git :init
plugin "rspec", :git => "git://github.com/dchelimsky/rspec.git", :submodule => true
plugin "rspec-rails", :git => "git://github.com/dchelimsky/rspec-rails.git", :submodule => true
plugin "exception-notifier", :git => "git://github.com/rails/exception_notification.git", :submodule => true
plugin "restful-authentication", :git => "git://github.com/technoweenie/restful-authentication.git", :submodule => true
plugin "semantic-form-builder", :git => "git://github.com/rubypond/semantic_form_builder.git", :submodule => true
plugin "paperclipped", :git => "git://github.com/kbingman/paperclipped.git", :submodule => tru