Skip to content

Instantly share code, notes, and snippets.

@owahab
Last active August 29, 2015 14:10
Show Gist options
  • Save owahab/5e6dac80313170fcd0f9 to your computer and use it in GitHub Desktop.
Save owahab/5e6dac80313170fcd0f9 to your computer and use it in GitHub Desktop.
# Gems
# ==================================================
# Use unicorn web server
gem "unicorn"
# For encrypted password
gem "bcrypt-ruby"
# Store sessions in database
gem 'activerecord-session_store', github: 'rails/activerecord-session_store'
# Authentication
gem "devise"
# Authorization
gem "cancancan", "~> 1.9"
# UI Framework
gem "foundation-rails"
gem "paperclip", "~> 4.2.0"
gem "seedbank"
gem "mail_view", "~> 2.0.4"
# Background queues
gem "resque"
# Background mail sending
gem "resque_mailer"
# Assets
gem 'libv8'
gem 'execjs'
# jQuery
gem 'jquery-ui-rails'
# Google fonts
gem 'google-webfonts-rails', github: 'overc/google-webfonts-rails'
gem "font-awesome-rails", "~> 4.1"
gem "themify-icons-rails", github: "overc/themify-icons-rails"
## Pagination
gem 'kaminari'
gem_group :development do
# Run them all
gem 'foreman'
gem "quiet_assets"
# I/O Watcher
gem 'guard'
# Rspec for tests (https://github.com/rspec/rspec-rails)
gem "rspec-rails"
# Guard for automatically launching your specs when files are modified. (https://github.com/guard/guard-rspec)
gem "guard-rspec"
# Provides a better error page for Rails and other Rack apps
gem 'better_errors'
# Retrieve the binding of a method's caller, enhances better_errors gem
gem 'binding_of_caller'
# Display the originator or SQL queries run on database
gem 'query_trace'
# Debugging baby
gem 'debugger'
# Open emails in browser window
gem 'letter_opener'
# A much better alternative to irb
gem 'pry-rails'
gem 'terminal-notifier-guard'
end
gem_group :test do
# Unit testing with Rsepc
gem "rspec-rails"
# Capybara for integration testing (https://github.com/jnicklas/capybara)
gem "capybara"
gem "capybara-webkit"
# FactoryGirl instead of Rails fixtures (https://github.com/thoughtbot/factory_girl)
gem "factory_girl_rails"
# Testing Coverage
gem 'simplecov', require: false
gem "database_cleaner", require: false
gem "faker" # Setting require: false breaks faker when invoked under seedbank
gem "rspec-rails"
gem "shoulda-matchers"
end
# Bundle
# ==================================================
run "bundle install"
# Ignore rails doc files, Vim/Emacs swap files, .DS_Store, and more
# ===================================================
run "cat << EOF >> .gitignore
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
/db/*.sqlite3-journal
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
/.bundle
/db/*.sqlite3
/db/*.sqlite3-journal
/log/*.log
/tmp
database.yml
doc/
*.swp
*~
.project
.idea
.secret
.DS_Store
.env
/public
/log
.vagrant
EOF"
# Environment Setup
# ==================================================
file ".env", <<-CODE
PORT=3000
RAILS_ENV=development
CODE
# Use Procfile for foreman
file "Procfile", <<-CODE
web: bundle exec rails server -p $PORT
CODE
# We need this with foreman to see log output immediately
environment "STDOUT.sync = true", env: "development"
# Use letter opener to open emails
environment "config.action_mailer.delivery_method = :letter_opener", env: "development"
# Set default domain in outgoing emails
environment "config.action_mailer.default_url_options = { :host => 'localhost:3000' }", env: "development"
# Initialize guard
# ==================================================
run "bundle exec guard init rspec"
# Generating...
# ==================================================
# Session in database
generate "active_record:session_migration"
initializer "session_store", <<-CODE
#{@app_name.camelize}::Application.config.session_store :active_record_store
CODE
run "rm app/views/layouts/application.html.erb"
generate "foundation:install"
# Devise
generate "devise:install"
generate "devise User name:string"
generate "devise:views users"
# CanCan
generate "cancan:ability"
# Static pages controller and views
generate "controller home"
route "resources :home, only: [:index]"
route "root to: 'home#index'"
# Clean up Assets
# ==================================================
# Use SASS extension for application.css
run "mv app/assets/stylesheets/application.css app/assets/stylesheets/application.css.scss"
# Git: Initialize
# ==================================================
git :init
git add: "."
git commit: %Q{ -m 'Initial commit' -q }
# Set username in database.yml to current user
run "sed -i -e \"s/username: #{@app_name}/username: $(whoami)/\" config/database.yml"
# Create database and migrate
rake "db:drop"
rake "db:create"
rake "db:migrate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment