Module: Cybele::Helpers::General
- Included in:
- AppBuilder
- Defined in:
- lib/cybele/helpers/general.rb
Instance Method Summary collapse
- #add_cybele_version ⇒ Object
- #add_editor_config ⇒ Object
- #add_gems ⇒ Object
- #configure_bullet ⇒ Object
- #create_database ⇒ Object
- #force_ssl_setting ⇒ Object
- #generate_config ⇒ Object
- #generate_rollbar ⇒ Object
- #readme ⇒ Object
- #remove_readme_rdoc ⇒ Object
- #use_postgres_config_template ⇒ Object
Instance Method Details
#add_cybele_version ⇒ Object
36 37 38 39 |
# File 'lib/cybele/helpers/general.rb', line 36 def add_cybele_version copy_file 'VERSION.txt', 'VERSION.txt' run 'ln -s ../VERSION.txt public/VERSION.txt' end |
#add_editor_config ⇒ Object
32 33 34 |
# File 'lib/cybele/helpers/general.rb', line 32 def add_editor_config copy_file 'editorconfig', '.editorconfig' end |
#add_gems ⇒ Object
17 18 19 20 |
# File 'lib/cybele/helpers/general.rb', line 17 def add_gems # Add gems append_file('Gemfile', template_content('Gemfile.erb')) end |
#configure_bullet ⇒ Object
62 63 64 |
# File 'lib/cybele/helpers/general.rb', line 62 def configure_bullet configure_environment 'development', template_content('bullet/bullet_settings.rb.erb') end |
#create_database ⇒ Object
47 48 49 |
# File 'lib/cybele/helpers/general.rb', line 47 def create_database bundle_command 'exec rake db:create db:migrate' end |
#force_ssl_setting ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/cybele/helpers/general.rb', line 22 def force_ssl_setting gsub_file 'config/environments/production.rb', /# config.force_ssl = true/, "config.force_ssl = ENV['RAILS_FORCE_SSL'].present?" gsub_file 'config/environments/staging.rb', /# config.force_ssl = true/, "config.force_ssl = ENV['RAILS_FORCE_SSL'].present?" %w[.env.local .env.production .env.staging .env.sample].each do |env| append_file(env, template_content('ssl/ssl_env_all.erb')) end end |
#generate_config ⇒ Object
51 52 53 54 55 56 |
# File 'lib/cybele/helpers/general.rb', line 51 def generate_config generate 'config:install' run 'cp config/settings/development.yml config/settings/staging.yml' append_file('config/settings.yml', template_content('settings.yml.erb')) remove_file 'config/settings.local.yml', force: true end |
#generate_rollbar ⇒ Object
58 59 60 |
# File 'lib/cybele/helpers/general.rb', line 58 def generate 'rollbar' end |
#readme ⇒ Object
6 7 8 9 10 |
# File 'lib/cybele/helpers/general.rb', line 6 def readme template 'README.md.erb', 'README.md', force: true end |
#remove_readme_rdoc ⇒ Object
12 13 14 15 |
# File 'lib/cybele/helpers/general.rb', line 12 def remove_readme_rdoc remove_file 'README.rdoc', force: true end |
#use_postgres_config_template ⇒ Object
41 42 43 44 45 |
# File 'lib/cybele/helpers/general.rb', line 41 def use_postgres_config_template template 'postgresql_database.yml.erb', 'config/database.yml', force: true end |