Skip to content

Instantly share code, notes, and snippets.

View jamescook's full-sized avatar
🏠
Working from home

James Cook jamescook

🏠
Working from home
View GitHub Profile
Started by user anonymous
Checkout:workspace / /home/james/.jenkins/server/jobs/xrono/workspace - hudson.remoting.LocalChannel@5655108e
Using strategy: Default
Checkout:workspace / /home/james/.jenkins/server/jobs/xrono/workspace - hudson.remoting.LocalChannel@5655108e
Fetching changes from the remote Git repository
Fetching upstream changes from git://github.com/isotope11/xrono.git
Commencing build of Revision 538a23af1880cf87c1f1ffa93a5b79ef109ba956 (origin/master)
Checking out Revision 538a23af1880cf87c1f1ffa93a5b79ef109ba956 (origin/master)
No change to record in branch origin/master
[workspace] $ /bin/sh -xe /home/james/.jenkins/server/javatmp/hudson1083326328955889292.sh
# Include in classes that have an Address
# Adds shortcut getter/setter methods for line1, line2, city, state, zip.
module AddressDelegation
extend ActiveSupport::Concern
included do
include InstanceMethods
def assign_attributes_with_delegation attributes, options
setup_address
delegate_address_attributes
@jamescook
jamescook / gist:1035723
Created June 20, 2011 14:36
josh_sucks.diff
diff --git a/.gitignore b/.gitignore
index fb67f16..2a41efe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,8 @@ db/*.sqlite3-journal
tmp
tmp/**/*
+vendor/ruby
+
diff --git a/pages/lib/pages/marketable_routes.rb b/pages/lib/pages/marketable_routes.rb
index 4af9c28..f4c66c0 100644
--- a/pages/lib/pages/marketable_routes.rb
+++ b/pages/lib/pages/marketable_routes.rb
@@ -4,10 +4,12 @@
end
end
-# Add any parts of routes as reserved words.
-if ::Refinery::Page.use_marketable_urls?
time = Time.now
(time.beginning_of_day.to_i..time.end_of_day.to_i).step(1800).each do|time|
puts Time.at(time).strftime("%H:%M %p")
end
diff --git a/lib/garb.rb b/lib/garb.rb
index fed7a16..e00b5b0 100644
--- a/lib/garb.rb
+++ b/lib/garb.rb
@@ -11,6 +11,8 @@ rescue LoadError
end
module Garb
+ autoload :Attributes, 'garb/attributes'
+ autoload :PathAttribute, 'garb/path_attribute'
# named_scope :relative_of, lambda { |id|
# subject = Subject.find(id)
# ids = subject.child_subjects.map(&:id)
# ids << id
# { :conditions => { :subject_id => ids } }
# }
#!/bin/bash
# Usage: dropbox SomeClientFolder
if [ $# = 0 ]; then
echo "Specify a folder."
exit 0
fi
if [ -d ~/Dropbox/$1 ]; then
subfolder=$1
diff --git a/activemodel/lib/active_model/errors.rb b/activemodel/lib/active_model/errors.rb
index e548aa9..61164d9 100644
--- a/activemodel/lib/active_model/errors.rb
+++ b/activemodel/lib/active_model/errors.rb
@@ -277,8 +277,16 @@ module ActiveModel
return message if attribute == :base
attr_name = attribute.to_s.gsub('.', '_').humanize
attr_name = @base.class.human_attribute_name(attribute, :default => attr_name)
+ defaults = []
+ if @base.class.respond_to?(:i18n_scope)
test
test2