Last active
May 9, 2017 16:14
-
-
Save CharlieHawker/1e977577a317d16729adf7a3ef61d17e to your computer and use it in GitHub Desktop.
A rails app starting point with ActiveAdmin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: rails new APP_PATH -m rails_basic_setup_template.rb --database postgresql -T | |
gem "activeadmin" | |
gem "devise", github: "plataformatec/devise" | |
gem "cancancan" | |
gem "draper" | |
gem "pundit" | |
gem "haml-rails" | |
gem "simple_form" | |
gem "sidekiq" | |
gem_group :development, :test do | |
gem "dotenv" | |
gem "rspec-rails" | |
gem "factory_girl_rails" | |
gem "ffaker" | |
gem "database_cleaner" | |
gem "capybara-screenshot" | |
end | |
gem_group :development do | |
gem "pry-rails" | |
gem "pry-rescue" | |
gem "mailcatcher" | |
gem "foreman" | |
gem "capistrano" | |
gem "capistrano-rails" | |
gem "capistrano-bundler" | |
gem "rvm-capistrano" | |
gem "capistrano-sidekiq" | |
end | |
# Lock versions of ruby an node | |
run "echo 'ruby-2.4.0' >> .ruby-version" | |
run "echo 'lts/boron' >> .node-version" | |
# Touch a .env file | |
run "touch .env" | |
run "touch .env.development" | |
run "echo '.env.development' >> .gitignore" | |
File.open('app/assets/stylesheets/site.scss', 'w') do |f| | |
f.puts '@import "font-awesome/scss/font-awesome";' | |
f.puts '@import "foundation-sites/scss/foundation";' | |
f.puts '@include foundation-everything;' | |
end | |
# Create the Procfile for foreman | |
File.open('Procfile', 'w') do |f| | |
f.puts 'web: bundle exec puma -C config/puma.rb' | |
f.puts 'worker: bundle exec sidekiq -c 5' | |
end | |
# Configure development environment for mailcatcher | |
environment 'config.action_mailer.delivery_method = :smtp', env: 'development' | |
environment 'config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }', env: 'development' | |
# Add some NPM packages | |
run "yarn add foundation-sites" | |
run "yarn add font-awesome" | |
after_bundle do | |
run "spring stop" | |
# Install gem extras | |
generate("rspec:install") | |
generate("simple_form:install --foundation") | |
generate("devise:install") | |
generate("draper:install") | |
generate("pundit:install") | |
generate("haml:application_layout") | |
generate("active_admin:install") | |
# Run erb2haml | |
# rails_command "haml:erb2haml" | |
# Create the default action / view | |
route "root to: 'home#index'" | |
generate("controller", "home index") | |
# Install capistrano | |
run "bundle exec cap install" | |
capify! | |
# Initialise git | |
git :init | |
git add: "." | |
git commit: %Q{ -m 'Initial commit' } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment