Created
February 24, 2012 08:03
-
-
Save sapphiriq/1899041 to your computer and use it in GitHub Desktop.
Rails Datamapper template
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
# inspired by http://www.rowtheboat.com/archives/32 | |
# get all datamapper related gems (assume sqlite3 to be database) | |
gem "datamapper4rails"#, :require => 'datamapper4rails' # excuse the typo | |
gem "addressable", :require => "addressable/uri" | |
gem "do_sqlite3" | |
gem 'dm-validations' | |
gem 'dm-timestamps' | |
gem "rspec", :require => false | |
gem "rspec-rails", :require => false | |
rake "gems:install" | |
# have specs | |
generate("rspec") | |
# install datamapper rake tasks | |
generate("dm_install") | |
# fix config files to work with datamapper instead of active_record | |
run "sed -i config/environment.rb -e 's/#.*config.frameworks.*/config.frameworks -= [ :active_record ]/'" | |
run "sed -i spec/spec_helper.rb -e 's/^\\s*config[.]/#\\0/'" | |
run "sed -i test/test_helper.rb -e 's/^[^#]*fixtures/#\\0/'" | |
# fix a problem with missing class constants for models woth relations | |
initializer 'preload_models.rb', <<-CODE | |
require 'datamapper4rails/preload_models' | |
CODE | |
# set up git | |
git :init | |
git :add => '.' | |
git :commit => "-a -m 'Initial commit'" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment