Skip to content

Team-Eval/presto-rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Presto for Rails

Presto Logs were used to power the steam locomotive that pushed the DeLorean time machine up to 88 mph."

-- Futurepedia

Presto Rails, on the other hand, accelerates the initial setup of your amazing rails application.

##Installation

$ gem install presto-rails

##Usage

$ presto <your-rails-app-name>

##Details

Presto sets up the following defaults based on a commonly used stack at The Flatiron School:

####1) Generates a new rails app without mini-test

$ rails new <your-rails-app-name> -T

####2) Adds development and testing gems

group :test, :development do
  gem 'rspec-rails'
  gem 'capybara'
  gem 'selenium-webdriver'
  gem 'better_errors'
  gem 'binding_of_caller'
  gem 'terminal-notifier-guard'
  gem 'factory_girl_rails'
  gem 'simplecov'
  gem 'database_cleaner'
  gem 'guard', '>=2.1.0'
  gem 'guard-rspec'
end

####3) Initializes RSpec for the app

$ rails g rspec:install

####4) Configures spec_helper.rb

a. Adds SimpleCov

require 'simplecov'
SimpleCov.start 'rails'

b. Comments out fixtures in favor of factory_girl

# config.fixture_path = "#{::Rails.root}/spec/fixtures"

c. Disables transactional fixtures

config.use_transactional_fixtures = false

d. Adds Database Cleaner

config.before(:suite) do
  DatabaseCleaner.strategy = :transaction
  DatabaseCleaner.clean_with(:truncation)
end

config.before(:each) do
  DatabaseCleaner.start
end

config.after(:each) do
  DatabaseCleaner.clean
end

####5) Provisions specs for features

a. Adds features directory

$ mkdir -p spec/features

b. Adds spec/feature_helper.rb

require 'spec_helper'
require 'capybara/rails'

####6) Creates Guardfile

guard 'rspec' do
  watch(%r{^spec/.+_spec\.rb$})
  watch(%r{^lib/(.+)\.rb$})     { |m| "spec/lib/#{m[1]}_spec.rb" }
  watch('spec/spec_helper.rb')  { "spec" }

  # Rails example
  watch(%r{^app/(.+)\.rb$})                           { |m| "spec/#{m[1]}_spec.rb" }
  watch(%r{^app/(.*)(\.erb|\.haml)$})                 { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
  watch(%r{^app/controllers/(.+)_(controller)\.rb$})  { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
  watch(%r{^spec/support/(.+)\.rb$})                  { "spec" }
  watch('config/routes.rb')                           { "spec/routing" }
  watch('app/controllers/application_controller.rb')  { "spec/controllers" }

  # Capybara features specs
  watch(%r{^app/views/(.+)/.*\.(erb|haml)$})          { |m| "spec/features/#{m[1]}_spec.rb" }

end

###Authors Manuel Neuhauser

Josh Scaglione

Logan Hasson

###License MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published