Skip to content

Instantly share code, notes, and snippets.

View Gemfile
group :test, :development do
gem 'fabrication', '~> 2.9.3'
gem 'faker'
gem 'rspec-rails', '~> 3.0.0.beta1'
gem 'turnip'
gem 'capybara'
gem 'spring-commands-rspec'
gem 'timecop'
View keybase.md

Keybase proof

I hereby claim:

  • I am paul on github.
  • I am psadauskas (https://keybase.io/psadauskas) on keybase.
  • I have a public key whose fingerprint is 239C 6E2C 5405 95E3 0729 2777 D5B4 5A46 954A 36D8

To claim this, I am signing this object:

View ssbe_adapter.rb
require 'rubygems'
require 'resourceful'
require 'json'
gem 'dm-core', '>=0.9.3'
module DataMapper
module Adapters
class SsbeAdapter < AbstractAdapter
def initialize(name, uri_or_options)
View irb
% /usr/local/bin/rbx test.rb
A syntax error has occured:
/usr/local/lib/rubinius/gems/1.8/gems/extlib-0.9.4/lib/extlib/lazy_array.rb:24: syntax error, unexpected ',', expecting '='
near line /usr/local/lib/rubinius/gems/1.8/gems/extlib-0.9.4/lib/extlib/lazy_array.rb:24, column 28
Code:
@array.total=(*args, &block)
^
Backtrace:
View evaltest.rb
class Foo
class_eval <<-EOS, __FILE__, __LINE__
def bar=(*args, &block)
puts args.inspect
end
EOS
end
Foo.new.bar= 1
View gist:3196
% cat evaltest.rb
class Zoo
def bar=(a)
puts a.inspect
end
end
class Foo
def initialize
View test.rb
require 'rubygems'
require 'dm-core'
require 'dm-types'
require 'pathname'
require Pathname(__FILE__).dirname + 'lib/active_resource_adapter'
DataMapper.setup(:default, :adapter => :active_resource, :site => "http://localhost:3000/")
class Person
include DataMapper::Resource
View ssbe_authenticator.rb
require 'rubygems'
require 'httpauth'
require 'addressable/uri'
class SSBEAuthenticator
attr_reader :username, :password, :realm, :domain, :challenge
def initialize(username, password)
@username, @password = username, password
View gist:7315
migration( 1, :convert_active_record_users ) do
up do
Users.all(:orm => 'active_record').each do |u|
u.orm = 'datamapper'
u.save
end
end
end
migrate_up!
View gist:7527
<people>
<person>
<name>Paul</name>
<addresses>
<address>
<city>Boulder</city>
<state>Colorado</state>
</address>
</addresses>
</person>