Module: Cybele::Helpers::General

Included in:
AppBuilder
Defined in:
lib/cybele/helpers/general.rb

Instance Method Summary collapse

Instance Method Details

#add_cybele_versionObject



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_configObject



32
33
34
# File 'lib/cybele/helpers/general.rb', line 32

def add_editor_config
  copy_file 'editorconfig', '.editorconfig'
end

#add_gemsObject



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_bulletObject



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_databaseObject



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_settingObject



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_configObject



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_rollbarObject



58
59
60
# File 'lib/cybele/helpers/general.rb', line 58

def generate_rollbar
  generate 'rollbar'
end

#readmeObject



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_rdocObject



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_templateObject



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