Skip to content

Instantly share code, notes, and snippets.

@madebydna
Created August 30, 2010 21:17
Show Gist options
  • Save madebydna/558067 to your computer and use it in GitHub Desktop.
Save madebydna/558067 to your computer and use it in GitHub Desktop.
rvmrc = <<-RVMRC
rvm_gemset_create_on_use_flag=1
rvm_trust_rvmrcs=1
rvm gemset use #{app_name}
RVMRC
create_file ".rvmrc", rvmrc
# Attempting to create/activate gemset and install gems via Bundler
# 1st attempt (what I would do in the console)
run "cd path/to/new/app"
run 'gem install bundler --pre'
run 'bundle install'
# 2nd attempt (using inside(path, &block))
inside app_name do
run 'gem install bundler --pre'
run 'bundle install'
end
# 3rd attempt (actually creating and switching to new rvm gemset)
inside app_name do
run "rvm gemset create #{app_name} && rvm gemset use #{app_name}"
run 'gem install bundler --pre'
run 'bundle install'
end
require File.join(File.dirname(__FILE__), 'core_extensions.rb')
#Create Gemspec
rvmrc = <<-RVMRC
rvm_gemset_create_on_use_flag=1
rvm_trust_rvmrcs=1
rvm gemset use #{app_name}
RVMRC
create_file ".rvmrc", rvmrc
initialize_templater
required_recipes = %w(default jquery haml rspec factory_girl remarkable)
required_recipes.each {|required_recipe| apply recipe(required_recipe)}
load_options
apply(recipe('cucumber')) if yes?("Do you want to some cukes?")
apply recipe('design')
apply recipe('mongoid')
#run "cd ~/rails3_sites/#{app_name}"
inside app_name do
run 'gem install bundler --pre'
run 'bundle install'
end
execute_stategies
generators_configuration = <<-END
config.generators do |g|
g.template_engine :haml
g.test_framework :rspec, :fixture => true, :views => false
g.fixture_replacement :factory_girl, :dir => "spec/factories"
g.stylesheets false
end
END
environment generators_configuration
git :add => "."
git :commit => "-m 'Initial commit'"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment