Skip to content

Instantly share code, notes, and snippets.

require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'
# extracted from marty andrew's presentation on ruby static code analysis
# http://www.slideshare.net/martin_j_andrews/code-quality-analysis
require 'flog'
require 'flay'
require 'roodi'
require 'roodi_task'
require 'metric_fu'
desc "Analyze for code complexity"
@ozeias
ozeias / gist:218014
Created October 25, 2009 11:35 — forked from dhh/gist:45076
# 1) Point *.example.com in your DNS setup to your server.
#
# 2) Setup an Apache vhost to catch the star pointer:
#
# <VirtualHost *:80>
# ServerName example.com
# ServerAlias *.example.com
# </VirtualHost>
#
# 3) Set the current account from the subdomain
/*!
* jQuery ie6ize: Emulate IE-6 rendering - 11/13/2009
* http://mankzblog.wordpress.com/2009/11/13/ie6-frame-to-battle-chrome-frame/
*
* Created by Mats Bryntse
*
* Plugin-ified by "Cowboy" Ben Alman
* http://benalman.com/
*
* Bookmarklet version:
Feature: exit statuses
In order to specify expected exit statuses
As a developer using Cucumber
I want to use the "the exit status should be" step
Scenario: exit status of 0
When I run "ruby -h"
Then the exit status should be 0
# you'd obviously have more settings somewhere
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
namespace :deploy do
desc "Deploy the MFer"
task :default do
update
restart
cleanup
RAILS_ROOT ||= ENV["RAILS_ROOT"]
namespace :bundle do
task :all => [ :js, :gist_js, :css ]
task :js do
require 'lib/js_minimizer'
paths = []
paths += Dir[RAILS_ROOT + '/public/javascripts/jquery.*.js'].sort
paths += Dir[RAILS_ROOT + '/public/javascripts/github.*.js'].sort
# http://unicorn.bogomips.org/SIGNALS.html
rails_env = ENV['RAILS_ENV'] || 'production'
rails_root = ENV['RAILS_ROOT'] || "/data/github/current"
God.watch do |w|
w.name = "unicorn"
w.interval = 30.seconds # default
# unicorn needs to be run from the rails root
# http://unicorn.bogomips.org/SIGNALS.html
namespace :unicorn do
task :start, :roles => :app do
sudo "god start unicorn"
end
task :stop, :roles => :app do
sudo "god stop unicorn"
end
ActionView::Base.field_error_proc = Proc.new { |html_tag, instance| %[<span class="fieldWithError">#{html_tag}</span>] }