Skip to content

Instantly share code, notes, and snippets.

View snusnu's full-sized avatar

Martin Gamsjaeger snusnu

View GitHub Profile
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
require 'extlib/assertions' # pull it in
require 'extlib/inflection' # use active_support
require 'extlib/lazy_array' # pull it in
require 'extlib/logger' # use active_support
require 'extlib/class' # pull it in
require 'extlib/hash' # use active_support
require 'extlib/mash' # use active_support (if available)
require 'extlib/pathname' # think about dropping
require 'extlib/module' # think about using active_support
require 'extlib/object' # pull it in
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
require 'rubygems'
require 'dm-core'
module DataMapper
# monkey patch alarm
def self.setup(*args)
# original code
# ------------------------------------------------
# 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
## no idea
'Merb::Controller#cookies creating should append secure to the end of the cookie header when marked as such' FAILED
expected "safecook=no-hackers-here; domain=specs.merbivore.com; path=/; secure;" to match /secure$/
## probably bundler related
'using dependency to require a simple gem loads dependencies immediately if Merb is already started' FAILED
expected not nil, got nil
require 'rubygems'
require 'dm-core'
require 'spec'
module DataMapper
module ActiveModel
# This is mostly copied from active_model and adapted to use extlib under the hood.
# see http://github.com/rails/rails/blob/master/activemodel/lib/active_model/naming.rb
module DataMapper
module Types
class UtcDateTime < DataMapper::Type
primitive DateTime
def self.load(value, property)
if value.nil?
# local dev box in austria
mungo:alfred snusnu$ git ls-remote origin
18fb8e6a6ed2bf14b680e8aa4ad1473b034004ac HEAD
18fb8e6a6ed2bf14b680e8aa4ad1473b034004ac refs/heads/master
4a1619a0e5955cfd58b744a709d89a96206f9736 refs/heads/style
# EY slice somewhere i dunno :)
snusnu@ey04-s00167 ~/github/alfred $ git ls-remote origin
#!/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)