Skip to content

Instantly share code, notes, and snippets.

@cupakromer
Last active December 17, 2015 19:19
Show Gist options
  • Save cupakromer/5659339 to your computer and use it in GitHub Desktop.
Save cupakromer/5659339 to your computer and use it in GitHub Desktop.
Custom Rails Config
rails new PROJECT_NAME --skip-bundle --skip-active-record --skip-test-unit (--database=postgresql UNLESS MONGOID)
cd PROJECT_NAME
# Setup current Ruby version with patch level and gemset
rvm --ruby-version use `ruby -v | awk '{ print $2 }'`@PROJECT_NAME --create

INSTALL RSPEC
rspec 2.14.0rc1
rspec-rails

  gem 'jquery-rails'
  gem 'jquery-ui-rails'
  gem 'sass-rails'
  gem 'zurb-foundation'
  gem 'font-awesome-rails'
  #gem 'font-awesome-sass-rails' #DOES THIS WORK WITH ZURB?
  gem 'bourbon'
  gem 'pry-rails'
  gem 'pry-nav'
  gem "better_errors"
  gem "binding_of_caller"
  gem 'dotenv-rails'???
  gem 'simple_form'

INSTALL MONGOID
mongoid
mongoid-rspec

INSTALL SLIM
slim-rails

CONFIG MONGOID / POSTGRESQL
CONFIG SLIM

gem 'puma'  # ALSO IF USING POSTGRESQL CHANGE database.yml pool: 16

TURBOLINKS??
CACHING??
CSS RESET??
OMNIAUTH?? DEVISE?? OTHER??

gem 'ZenTest'  # Includes autotest??
gem 'heckle'  # Doesn't work with Ruby 2.0.0 :grimacing:
gem 'metric_fu'
gem 'bourbon'
gem 'bson_ext'


git ignore .ruby-gemset
git ignore secret key file (config/initializers/secret_token.rb)? example file? dotenv gem?

rspec --init
rails g rspec:install
rails g mongoid:config
rails g foundation:install
rails generate simple_form:install --foundation

git mv app/assets/stylesheets/application.css app/assets/stylesheets/application.scss
git rm app/views/layouts/application.html.erb

# Setup Bourbon (see https://github.com/thoughtbot/bourbon)
# Remove sprockets: "*= require_tree ." from app/assets/stylesheets/application.scss
sed -i ????
# Add bourbon "@import "bourbon";" to app/assets/stylesheets/application.scss
echo "@import 'bourbon';" >> app/assets/stylesheets/application.scss
source 'https://rubygems.org'
ruby '2.0.0'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Run the puma server
gem 'puma'
# Use postgres for the database
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
# Use Slim for views
gem 'slim-rails'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-ui-rails'
# Use Zurb foundation for app skeleton
gem 'zurb-foundation'
# Use font-awesome for more icons
gem 'font-awesome-rails'
# User Bourbon for advanced Sass mixins
gem 'bourbon'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
# Use devise for authentication
gem 'devise'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
group :development, :test do
gem 'rspec-rails'
gem 'capybara'
gem 'pry-rails'
gem 'pry-nav'
gem 'database_cleaner'
gem "better_errors"
gem "binding_of_caller"
end
group :production do
gem 'rails_12factor' # Setup plugin for heroku
end
#!/usr/bin/env ruby
require 'fileutils'
unless ARGV[0]
end
# 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'
require 'capybara/rails'
require 'capybara/rspec'
# 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 }
# Checks for pending migrations before tests are run.
# If you are not using ActiveRecord, you can remove this line.
ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
module RSpec
def root
@rspec_root ||= Rails.root.join 'spec'
end
end
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 = true
# Run specs in random order to surface order dependencies. If you find an
# order dependency and want to debug it, you can fix the order by providing
# the seed, which is printed after each run.
# --seed 1234
config.order = "random"
config.treat_symbols_as_metadata_keys_with_true_values = true
config.alias_it_should_behave_like_to :has_behavior
config.alias_it_should_behave_like_to :it_has_behavior, 'has behavior:'
config.run_all_when_everything_filtered = true
config.filter_run :focus
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment