Created
January 25, 2009 19:15
-
-
Save ddemaree/52499 to your computer and use it in GitHub Desktop.
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
inside 'gems/bundler' do | |
run 'git init' | |
run 'git pull --depth 1 git://github.com/wycats/bundler.git' | |
run 'rm -rf .git .gitignore' | |
end | |
file 'script/bundle', %{ | |
#!/usr/bin/env ruby | |
path = File.expand_path(File.join(File.dirname(__FILE__), "..", "gems/bundler/lib")) | |
$LOAD_PATH.unshift path | |
require 'rubygems' | |
require 'rubygems/command' | |
require 'bundler' | |
require 'bundler/commands/bundle_command' | |
Gem::Commands::BundleCommand.new.invoke(*ARGV) | |
}.strip | |
run 'chmod +x script/bundle' | |
file 'Gemfile', <<-GEMF | |
clear_sources | |
source 'http://gemcutter.org' | |
disable_system_gems | |
bundle_path 'gems' | |
gem 'rails', '#{Rails::VERSION::STRING}' | |
except :production do | |
gem 'ruby-debug' | |
gem 'sqlite3-ruby' | |
gem 'shoulda' | |
gem 'factory_girl' | |
gem 'rspec', '1.2.9' | |
gem 'rspec-rails', '1.2.9' | |
end | |
GEMF | |
file '.gitignore', <<-GIGN | |
.DS_Store | |
gems/* | |
!gems/cache | |
!gems/bundler | |
log/*.* | |
tmp/*/* | |
db/*.sqlite3 | |
db/*.sqlite | |
GIGN | |
run "script/bundle" | |
append_file '/config/preinitializer.rb', %{ | |
require File.expand_path( File.join( File.dirname(__FILE__), "..", "gems", "environment" ) ) | |
} | |
gsub_file 'config/environment.rb', "require File.join(File.dirname(__FILE__), 'boot')", %{ | |
require File.join(File.dirname(__FILE__), 'boot') | |
# Hijack rails initializer to load the bundler gem environment before loading the rails environment. | |
Rails::Initializer.module_eval do | |
alias load_environment_without_bundler load_environment | |
def load_environment | |
Bundler.require_env configuration.environment | |
load_environment_without_bundler | |
end | |
end | |
} | |
#gem 'mislav-will_paginate', :version => '~> 2.2.3', :lib => 'will_paginate', :source => 'http://gems.github.com' | |
#gem 'thoughtbot-factory_girl', :lib => "factory_girl", :source => "http://gems.github.com" | |
#gem 'thoughtbot-shoulda', :lib => 'shoulda', :source => "http://gems.github.com/" | |
#rake "gems:install", :sudo => true | |
#generate(:authenticated,"user session") | |
#rake "db:migrate" | |
generate(:rspec) | |
generate(:rspec_controller, "website index") | |
route "map.root :controller => 'website'" | |
run "rm public/index.html" | |
run "rm public/images/rails.png" | |
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