Permalink
Browse files

moved and rewrite rails application template.

  • Loading branch information...
kanetann committed Jan 14, 2013
1 parent f621510 commit 28134e71f8bde615f72ab3f2568c632b8ad6dd1a
Showing with 147 additions and 0 deletions.
  1. +2 −0 rails/.rspec
  2. +62 −0 rails/spec/spec_helper.rb
  3. +83 −0 rails/template.rb
View
@@ -0,0 +1,2 @@
+--colour
+--drb
View
@@ -0,0 +1,62 @@
+require 'rubygems'
+require 'spork'
+#uncomment the following line to use spork with the debugger
+#require 'spork/ext/ruby-debug'
+
+Spork.prefork do
+ # Loading more in this block will cause your tests to run faster. However,
+ # if you change any configuration or code from libraries loaded here, you'll
+ # need to restart spork for it take effect.
+
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
+ ENV["RAILS_ENV"] ||= 'test'
+ require File.expand_path("../../config/environment", __FILE__)
+ require 'rspec/rails'
+ require 'rspec/autorun'
+
+ # Requires supporting ruby files with custom matchers and macros, etc,
+ # in spec/support/ and its subdirectories.
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
+
+ RSpec.configure do |config|
+ # ## Mock Framework
+ #
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
+ #
+ # config.mock_with :mocha
+ # config.mock_with :flexmock
+ # config.mock_with :rr
+
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
+ config.fixture_path = "#{::Rails.root}/spec/fixtures"
+
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
+ # examples within a transaction, remove the following line or assign false
+ # instead of true.
+ config.use_transactional_fixtures = true
+
+ # If true, the base class of anonymous controllers will be inferred
+ # automatically. This will be the default behavior in future versions of
+ # rspec-rails.
+ config.infer_base_class_for_anonymous_controllers = false
+
+ config.before(:suite) do
+ DatabaseCleaner.strategy = :truncation
+ DatabaseCleaner.clean_with(:truncation)
+ end
+
+ config.before(:each) do
+ DatabaseCleaner.start
+ end
+
+ config.after(:each) do
+ DatabaseCleaner.clean
+ end
+
+ end
+end
+
+Spork.each_run do
+ # This code will be run each time you run your specs.
+ FactoryGirl.reload
+end
View
@@ -0,0 +1,83 @@
+# rails application template
+# rails-templates/facebook.rb at master · jm/rails-templates · GitHub <https://github.com/jm/rails-templates/blob/master/facebook.rb>
+# Ruby on Rails Guides: Rails Application Templates <http://edgeguides.rubyonrails.org/rails_application_templates.html>
+
+run "rm public/index.html"
+environment '
+config.generators do |g|
+ g.fixture_replacement :factory_girl
+end
+'
+
+
+gem 'devise'
+gem 'cancan'
+gem 'twitter-bootstrap-rails'
+gem 'unicorn'
+gem 'formtastic'
+gem 'kaminari'
+gem 'resque'
+
+gem_group :development, :test do
+ # testing framework
+ gem 'rspec-rails'
+ gem 'capybara'
+
+ # fixture
+ gem 'factory_girl_rails'
+ gem 'database_cleaner'
+
+ # client notify
+ gem 'growl'
+
+ # coverage
+ gem 'simplecov'
+
+ # pry
+ gem 'pry'
+ gem 'pry-doc'
+ gem 'pry-debugger' # binding.pry
+ gem 'pry-rails'
+
+ # deploy
+ gem 'capistrano'
+ gem 'capistrano-ext'
+ gem 'capistrano_colors'
+
+ # browser debug
+ gem 'better_errors'
+ gem 'binding_of_caller'
+
+ # useful gems
+ gem 'spork'
+ gem 'guard'
+ gem 'guard-bundler'
+ gem 'guard-rspec'
+ gem 'guard-spork'
+ gem 'guard-rails'
+ gem 'guard-livereload'
+ gem 'rb-fsevent'
+ gem 'rails-clean-logs'
+ gem 'awesome_print'
+end
+
+run "bundle install"
+
+run "rails g rspec:install"
+run "guard init rspec"
+run "bundle exec spork --bootstrap"
+
+run "cp ~/dotfiles/rails/.rspec .rspec"
+run "cp ~/dotfiles/rails/spec/spec_helper.rb spec/spec_helper.rb"
+
+# device
+run "rails g devise:install"
+
+# scaffold
+generate(:scaffold, "article title:string content:text")
+route "root to: 'articles#index'"
+
+# database
+run "rake db:migrate"
+
+generate("factory_girl:model", "article title:string content:text")

0 comments on commit 28134e7

Please sign in to comment.