Last active
December 10, 2015 23:19
-
-
Save jkovar/4508830 to your computer and use it in GitHub Desktop.
This file contains 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
run 'rm public/index.html' | |
# RVM | |
file '.rvmrc', "rvm 1.9.2@#{app_name} --create" | |
# Setup database | |
gsub_file 'config/database.yml', /username: (.*)/, 'host: localhost' | |
gsub_file 'config/database.yml', /password:/, '' | |
# Gems | |
gem 'gecon', :git => '[email protected]:gecon.git' | |
# TODO: zkusit presunout definici dalsich gemu do gecon dependencies | |
gem 'thin' | |
gem 'activeadmin' | |
gem "ckeditor" | |
gem 'globalize3', '0.2.0.beta8' | |
gem 'aws-sdk', '1.3.3' | |
gem 'paperclip', '2.5.2' | |
gem 'treasure_hunt' | |
gem 'dalli' | |
gem 'asset_sync' | |
gem 'i18n-js' | |
gem 'cocaine', '0.3.2' | |
gem_group :production, :staging do | |
gem "sentry-raven", :git => "https://github.com/getsentry/raven-ruby.git" | |
end | |
if yes?('Do you want to install Trivia?') | |
gem 'trivia' | |
@trivia = true | |
else | |
@trivia = false | |
end | |
# Run Bundler | |
run "rvm 1.9.2@#{app_name} --create" | |
run 'bundle install' | |
# Create database | |
rake 'db:create' | |
# ActiveAdmin | |
generate 'active_admin:install' | |
run 'rm app/assets/javascripts/active_admin.js' | |
run 'echo "window.CKEDITOR_BASEPATH=\"<%= Rails.application.config.action_controller.asset_host %>/assets/ckeditor/\";" > app/assets/javascripts/active_admin.js.erb' | |
# CkEditor | |
generate 'ckeditor:install --orm=active_record --backend=paperclip' | |
# Treasure Hunt | |
generate 'treasure_hunt:install' | |
# Gecon | |
generate 'gecon:install' | |
# Trivia | |
if @trivia | |
generate 'trivia:install' | |
generate 'gecon:trivia' | |
end | |
# Users codes | |
if yes?('Do you want to generate codes insertion?') | |
generate 'gecon:users_codes' | |
end | |
# Lokalizace | |
locales = [] | |
begin | |
locale = ask("Which locale do you want to add? ('quit' for exit):") | |
locales << locale unless locale == 'quit' | |
end while locale != 'quit' | |
generate "gecon:locales #{locales.join(' ')}" | |
# Run migrations and seed | |
rake 'db:migrate' | |
rake 'db:seed' | |
# Procfile | |
run "echo \"web: bundle exec rails server thin -p $PORT -e $RACK_ENV\" > Procfile" | |
# devise sign out | |
gsub_file 'config/initializers/devise.rb', /# config.sign_out_all_scopes = true/, "config.sign_out_all_scopes = false" | |
# Bundle gecon into vendor for an easy heroku deploy | |
if yes?('Do you want to bundle the Gecon gem into vendor?') | |
run 'mkdir vendor/gems' | |
run 'git clone [email protected]:gecon.git vendor/gems/gecon' | |
run 'rm -rf vendor/gems/gecon/.git' | |
run 'rm -rf vendor/gems/gecon/.rvmrc' | |
run 'rm -rf vendor/gems/gecon/.gitignore' | |
gsub_file 'Gemfile', /:git => "[email protected]:gecon.git"/, ":path => 'vendor/gems/gecon'" | |
run 'bundle update gecon' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment