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
desc "Support bundling from a typical datamapper dev checkout (allows BUNDLE_GEMFILE=Gemfile.local bundle exec foo)" | |
task :create_local_gemfile do |t| | |
datamapper = ENV['DATAMAPPER'] || File.expand_path('../..', __FILE__) | |
excluded_adapters = (ENV['EXCLUDED_ADAPTERS'] || '').split(',') | |
regex = /:git => \"#\{datamapper\}\/(.*?)(\.git|\")/ | |
File.open(File.expand_path('../Gemfile.local', __FILE__), 'w') do |f| | |
File.open(File.expand_path('../Gemfile', __FILE__), 'r').each do |line| |
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 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 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
# If you're working on more than one datamapper gem at a time, then it's | |
# recommended to create a local Gemfile and use this instead of the git | |
# sources. This will make sure that you are developing against your | |
# other local datamapper sources that you currently work on. Gemfile.local | |
# will behave identically to the standard Gemfile apart from the fact that | |
# it fetches the gems from local paths. This means that you can use the | |
# same environment variables, like ADAPTER when running bundle commands. | |
# Gemfile.local is added to .gitignore, so you don't need to worry about | |
# accidentally checking local development paths into git. | |
# |
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 'active_support/inflector' | |
# dm-core/spec/adapter.rb | |
module DataMapper | |
module Spec | |
module Adapters | |
def self.setup(adapter_name) | |
SpecAdapter.new(adapter_name) | |
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
class Payment | |
include DataMapper::Resource | |
property :id, Serial | |
belongs_to :payee, 'User' | |
belongs_to :payer, 'User' | |
end | |
class User |
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
/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 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
-------------------------------------------------------------------------------- | |
The datamapper ecosystem | |
-------------------------------------------------------------------------------- | |
nr of members: 1593 | |
nr of projects: 130 | |
total watchers: 1524 | |
total forkers: 278 | |
total collaborators: 105 | |
total contributors: 207 | |
-------------------------------------------------------------------------------- |
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 -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 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 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 'action_view' | |
require 'active_support' | |
require 'mustache' | |
class Mustache | |
# TODO - Think about allowing to overwrite layout methods in subclassing views | |
# | |
# http://github.com/defunkt/mustache/blob/master/lib/mustache/sinatra.rb#L79-82 | |
# http://github.com/defunkt/mustache/blob/master/lib/mustache/sinatra.rb#L96-102 |