This file contains hidden or 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/ruby | |
# rewrite_history.rb | |
# Jonathan D. Stott <[email protected]> | |
require 'fileutils' | |
adapters = %w{ | |
mysql_adapter.rb | |
postgres_adapter.rb | |
sqlite3_adapter.rb | |
oracle_adapter.rb |
This file contains hidden or 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 | |
ADAPTER=$1 | |
if [ ! -d dm-more ]; then | |
echo "Cloning solnic's adapter" | |
git clone git://github.com/solnic/dm-more.git | |
cd dm-more | |
git fetch | |
git checkout -b adapters_import origin/adapters_import | |
cd .. |
This file contains hidden or 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 File.expand_path(File.join(File.dirname(__FILE__), '../test_helper')) | |
class MyProjectSpecifcUnitTest < MiniTest::Unit::TestCase | |
def setup | |
repository(:default) do |repository| | |
transaction = DataMapper::Transaction.new(repository) | |
transaction.begin | |
repository.adapter.push_transaction(transaction) | |
end |
This file contains hidden or 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 Payment | |
include DataMapper::Resource | |
property :id, Serial | |
belongs_to :payee, 'User' | |
belongs_to :payer, 'User' | |
end | |
class User |
This file contains hidden or 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
/Users/nathan/Documents/myobie/clients/Bull_Head/mongo testing/vendor/cache/gems/activesupport-3.0.0.beta3/lib/active_support/hash_with_indifferent_ac | |
cess.rb:131:in `convert_value': undefined method `with_indifferent_access' for {}:Hash (NoMethodError) | |
from /Users/nathan/Documents/myobie/clients/Bull_Head/mongo testing/vendor/cache/gems/activesupport-3.0.0.beta3/lib/active_support/hash_with_i | |
ndifferent_access.rb:51:in `update' | |
from /Users/nathan/Documents/myobie/clients/Bull_Head/mongo testing/vendor/cache/gems/activesupport-3.0.0.beta3/lib/active_support/hash_with_i | |
ndifferent_access.rb:51:in `each_pair' | |
from /Users/nathan/Documents/myobie/clients/Bull_Head/mongo testing/vendor/cache/gems/activesupport-3.0.0.beta3/lib/active_support/hash_with_i | |
ndifferent_access.rb:51:in `update' | |
from /Users/nathan/Documents/myobie/clients/Bull_Head/mongo testing/vendor/cache/gems/activesupport-3.0.0.beta3/lib/active_support/hash_with_i | |
ndifferent_access.rb:14:in `initialize' |
This file contains hidden or 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 -Ku | |
# encoding: utf-8 | |
require 'fileutils' | |
require 'pathname' | |
require 'addressable/uri' | |
require 'ruby-github' # TODO: replace ruby-github with something better maintained |
This file contains hidden or 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 ApplicationController < ActionController::Base | |
before_filter :compound_date_values | |
protected | |
def compound_date_values(h=params,prefix=[]) | |
to_fix = {} | |
h.each do |k, v| | |
if v.is_a? Hash |
This file contains hidden or 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/ruby | |
# Copyright (c) 2010 Jonathan Stott, unless otherwise noted | |
# | |
# Permission is hereby granted, free of charge, to any person ob- | |
# taining a copy of this software and associated documentation | |
# files (the "Software"), to deal in the Software without restric- | |
# tion, including without limitation the rights to use, copy, modi- | |
# fy, merge, publish, distribute, sublicense, and/or sell copies of | |
# the Software, and to permit persons to whom the Software is fur- | |
# nished to do so, subject to the following conditions: |
This file contains hidden or 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 'openid' | |
require 'openid/consumer' | |
require "openid/store/filesystem" | |
require 'openid/extensions/sreg' | |
class LoginController < ApplicationController | |
def create | |
response = openid_consumer.begin(params[:openid_url]) | |
sregreq = ::OpenID::SReg::Request.new | |
sregreq.request_fields(["email"], true) |
This file contains hidden or 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
# Sample configuration file for Unicorn (not Rack) | |
worker_processes 1 | |
# listen on the sinatra port | |
listen 4567 | |
# feel free to point this anywhere accessible on the filesystem | |
pid PIDFILE = "#{ENV['XDG_CACHE_HOME']}/unicorn.pid" | |
stdout_path "#{ENV['XDG_CACHE_HOME']}/unicorn.log" |