This file contains 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
Merb::BootLoader.before_app_loads do | |
# This will get executed after dependencies have been loaded but before your app's classes have loaded. | |
Date.add_format(:tranzaction_date, '%m/%d/%y') | |
class ::DataMapper::Validate::ValidationErrors | |
def each | |
errors.map.each do |k, v| | |
next if v.blank? | |
yield(k, v) | |
end |
This file contains 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
#!/usr/bin/env ruby | |
# | |
# A one file test to show ... | |
require 'rubygems' | |
require 'dm-core' | |
require 'dm-validations' | |
# setup the logger | |
DataMapper::Logger.new(STDOUT, :debug) | |
This file contains 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
# setup new rubygem environment for merb 1.0.x | |
gem install extlib rspec rake memcache-client mongrel ruby-debug hpricot --no-rdoc --no-ri | |
gem install webrat --version=0.3.1 --no-rdoc --no-ri | |
gem install json_pure --version=1.1.6 --no-rdoc --no-ri |
This file contains 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
mysql: | |
mysql-config: /usr/local/mysql/bin/mysql_config | |
nokogiri: | |
xml2-include: /opt/local/include/libxml2 | |
xml2-lib: /opt/local/lib | |
xslt-dir: /opt/local | |
iconv-dir: /opt/local |
This file contains 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 'rubygems' | |
require 'dm-core' | |
DataMapper::Logger.new($stdout, :debug) | |
DataMapper.setup(:default, 'sqlite3:memory:') | |
class Quote | |
include DataMapper::Resource | |
property :id, Serial | |
has 0..n, :billings, :through => Resource |
This file contains 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
development: | |
adapter: master_slave | |
master: | |
adapter: mysql | |
database: master | |
host: master_server | |
slave: | |
adapter: mysql | |
database: slave | |
host: localhost |
This file contains 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
#---------------------------------------------------------------------------- | |
# Git Setup | |
#---------------------------------------------------------------------------- | |
file '.gitignore', <<-FILE | |
.DS_Store | |
log/*.log | |
tmp/**/* | |
config/database.yml | |
db/*.sqlite3 | |
public/uploads/* |
This file contains 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 ShardingMiddleware | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
env['warden'].authenticate! | |
repo_name = env['warden'].account.repository_name | |
result = nil |
This file contains 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 ".bundle/environment" | |
Bundler.setup | |
require "action_controller/railtie" | |
class FooController < ActionController::Base | |
def bar | |
self.response_body = "HELLO" | |
end | |
end |
This file contains 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
#!/bin/bash | |
FROM=$1 | |
TO=$2 | |
echo "Spliting '$TO' from '$FROM'" | |
git clone --no-hardlinks $FROM $TO | |
cd $TO | |
git filter-branch --subdirectory-filter $TO HEAD -- --all | |
git reset --hard | |
git gc --aggressive | |
git prune |
OlderNewer