Skip to content

Instantly share code, notes, and snippets.

View kevinmccaughey's full-sized avatar

Kevin McCaughey kevinmccaughey

View GitHub Profile
class TeamBuilder
attr_reader :domain, :params
def initialize(domain, params = {})
@domain = domain
@params = params
end
def build
@kevinmccaughey
kevinmccaughey / gist:5085720
Created March 4, 2013 21:12
Error from 'torquebox deploy'
kev@torquebox:~/torquebox_examples/rails_example$ torquebox deploy
Errno::ENOENT: No such file or directory - /jboss/standalone/deployments/rails_example-knob.yml
initialize at org/jruby/RubyFile.java:333
open at org/jruby/RubyIO.java:1179
deploy_yaml at /home/kev/.rvm/gems/jruby-1.7.2@tb_rails_example/gems/torquebox-rake-support-2.1.2/lib/torquebox/deploy_utils.rb:244
deploy at /home/kev/.rvm/gems/jruby-1.7.2@tb_rails_example/gems/torquebox-2.1.2/bin/torquebox:97
__send__ at org/jruby/RubyBasicObject.java:1659
run at /home/kev/.rvm/gems/jruby-1.7.2@tb_rails_example/gems/thor-0.17.0/lib/thor/task.rb:27
invoke_task at /home/kev/.rvm/gems/jruby-1.7.2@tb_rails_example/gems/thor-0.17.0/lib/thor/invocation.rb:120
dispatch at /home/kev/.rvm/gems/jruby-1.7.2@tb_rails_example/gems/thor-0.17.0/lib/thor.rb:344
@kevinmccaughey
kevinmccaughey / spec_watchr.rb
Created June 17, 2012 18:21 — forked from seven1m/spec_watchr.rb
watchr config for Rails + RSpec projects, uses Growl (Mac) or notify-send (Linux)
# put this in spec/watchr
# use with Spork
# run with `watchr spec/watchr`
# images are from Tango icon theme
# http://commons.wikimedia.org/wiki/Tango_icons#Weather
# for added bonus:
# set keyboard shortcuts Ctrl-Alt-S to run "pkill -USR2 -f spork"
# ...and Ctrl-Alt-T to run "pkill -USR2 -f watchr"
@kevinmccaughey
kevinmccaughey / gist:2409551
Created April 17, 2012 22:39 — forked from hopsoft/gist:1122080
Rails Environment Based Behavior
# app/models/user.rb
class User < ActiveRecord::Base
end
# lib/user_logger.rb
module UserLogger
def self.included(mod)
mod.send :after_create, :log_creation
end