Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
Make the rails templates act as close as possible to a default Rails …
Browse files Browse the repository at this point in the history
…3.1 app
  • Loading branch information
dmarkow committed Jan 5, 2012
1 parent a0b20ae commit d469381
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 37 deletions.
10 changes: 1 addition & 9 deletions templates/rails/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,13 @@ def compile(str, requirements, separators, anchor)

say ''
say '---------------------------------------------------------------------------'
say "Edit your Gemfile (do not forget to run 'bundle install' after doing that)"
say '---------------------------------------------------------------------------'
say 'If you want to use rspec for testing, you first need to uncomment the line'
say "that declares it in the Gemfile. The you need to run 'bundle install' again"
say "Once that's done, you need to actually install it into your app and update"
say "your spec_helper as shown in the dm-rails README"
say '---------------------------------------------------------------------------'
say 'Install rspec (optional): script/rails g rspec:install'
say 'Have a look at the dm-rails README: http://github.com/datamapper/dm-rails'
say '---------------------------------------------------------------------------'
say 'Have a look at available rake tasks: rake -T'
say 'Generate a simple scaffold: rails g scaffold Person name:string'
say 'Create, automigrate and seed the DB: rake db:setup'
say 'Start the server: script/rails server'
say '---------------------------------------------------------------------------'
say 'After the sever booted, point your browser at http://localhost:3000/people'
say 'After the server booted, point your browser at http://localhost:3000/people'
say '---------------------------------------------------------------------------'
say ''
20 changes: 7 additions & 13 deletions templates/rails/config.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
gsub_file 'config/application.rb', /require 'rails\/all'/ do
<<-RUBY
# Pick the frameworks you want:
# Comment out the frameworks you don't want (if you don't want ActionMailer,
# make sure to comment out the `config.action_mailer` lines in your
# config/environments/development.rb and config/environments/test.rb files):
require 'action_controller/railtie'
require 'dm-rails/railtie'
require 'sprockets/railtie'
# require 'action_mailer/railtie'
# require 'active_resource/railtie'
# require 'rails/test_unit/railtie'
require 'action_mailer/railtie'
require 'active_resource/railtie'
require 'rails/test_unit/railtie'
RUBY
end

gsub_file 'config/environments/development.rb', /config.action_mailer.raise_delivery_errors = false/ do
"# config.action_mailer.raise_delivery_errors = false"
end

gsub_file 'config/environments/test.rb', /config.action_mailer.delivery_method = :test/ do
"# config.action_mailer.delivery_method = :test"
end
end
29 changes: 14 additions & 15 deletions templates/rails/gemfile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
gem 'activesupport', RAILS_VERSION, :require => 'active_support'
gem 'actionpack', RAILS_VERSION, :require => 'action_pack'
gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer'
gem 'activeresource', RAILS_VERSION, :require => 'active_resource'
gem 'railties', RAILS_VERSION, :require => 'rails'
gem 'tzinfo'
Expand Down Expand Up @@ -48,6 +49,7 @@
gem 'dm-timestamps', DM_VERSION
gem 'dm-observer', DM_VERSION
# Gems used only for assets and not required
# in production environments by default.
group :assets do
Expand All @@ -56,26 +58,23 @@
gem 'uglifier', '>= 1.0.3'
end
group(:development, :test) do
gem 'jquery-rails'
# Uncomment this if you want to use rspec for testing your application
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# gem 'rspec-rails', '~> 2.0.1'
# Use unicorn as the web server
# gem 'unicorn'
# To get a detailed overview about what queries get issued and how long they take
# have a look at rails_metrics. Once you bundled it, you can run
#
# rails g rails_metrics Metric
# rake db:automigrate
#
# to generate a model that stores the metrics. You can access them by visiting
#
# /rails_metrics
#
# in your rails application.
# Deploy with Capistrano
# gem 'capistrano'
# gem 'rails_metrics', '~> 0.1', :git => 'git://github.com/engineyard/rails_metrics'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
group :test do
# Pretty printed test output
gem 'turn', '~> 0.8.3', :require => false
end
GEMFILE
Expand Down

0 comments on commit d469381

Please sign in to comment.