Class: Cybele::AppBuilder

Overview

rubocop:disable Metrics/ClassLength

Instance Method Summary collapse

Methods included from Helpers::ActiveStorage

#active_storage_setting

Methods included from Helpers::General

#add_cybele_version, #add_editor_config, #add_gems, #configure_bullet, #create_database, #force_ssl_setting, #generate_config, #generate_rollbar, #readme, #remove_readme_rdoc, #use_postgres_config_template

Methods included from Helpers::Pronto

#configure_pronto

Methods included from Helpers::Docker

#setup_docker_development_env

Methods included from Helpers::AppFiles::ViewGems

#add_required_view_gems

Methods included from Helpers::AppFiles::ViewFiles

#customize_default_view_files, #customize_view_files_with_option

Methods included from Helpers::AppFiles::HelperFiles

#customize_helper_files

Methods included from Helpers::AppFiles::MailerFiles

#customize_mailer_files

Methods included from Helpers::AppFiles::VendorFiles

#customize_vendor_files

Methods included from Helpers::AppFiles::ModelFiles

#customize_model_files

Methods included from Helpers::AppFiles::ControllerFiles

#customize_controller_files

Methods included from Helpers::AppFiles::AssetsFiles

#customize_assets_files, #javascript_files, #stylesheet_files

Methods included from Helpers::BasicAuthentication

#configure_basic_authentication

Methods included from Helpers::Routes

#configure_routes

Methods included from Helpers::Audited

#configure_audited

Methods included from Helpers::ErrorPages

#configure_error_pages

Methods included from Helpers::Devise

#add_devise_authenticate_admin, #add_devise_protect_from_forgery, #add_devise_strong_parameter, #generate_devise_models, #generate_devise_settings, #generate_devise_views

Methods included from Helpers::Mailer

#configure_action_mailer, #configure_smtp

Methods included from Helpers::LocaleLanguage

#configure_locale_language

Methods included from Helpers::Haml

#add_haml_gems, #configure_haml

Methods included from Helpers::ShowFor

#add_show_for_gem, #configure_show_for

Methods included from Helpers::RecipientInterceptor

#configure_recipient_interceptor

Methods included from Helpers::Dotenv

#configure_dotenv

Methods included from Helpers::SimpleForm

#add_simple_form_gem, #configure_simple_form

Methods included from Helpers::Responders

#configure_responders

Methods included from Helpers::Sidekiq

#configure_sidekiq

Methods included from Helpers::Staging

#setup_staging_environment

Instance Method Details

#add_environment_to_libObject



74
75
76
# File 'lib/cybele/app_builder.rb', line 74

def add_environment_to_lib
  copy_file 'environment/environment_generator.rb', 'lib/generators/environment/environment_generator.rb'
end

#add_pronto_to_gemfileObject



67
68
69
70
71
72
# File 'lib/cybele/app_builder.rb', line 67

def add_pronto_to_gemfile
  # Add gems
  append_file('Gemfile', template_content('pronto/pronto_Gemfile.erb'))
  bundle_command 'update'
  bundle_command 'install'
end

#git_and_git_flow_commandsObject



54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/cybele/app_builder.rb', line 54

def git_and_git_flow_commands
  run 'mkdir .environments'
  run 'mv .env.local .environments/'
  run 'mv .env.production .environments/'
  run 'mv .env.staging .environments/'
  run 'ln -s .environments/.env.local .env.local'
  run 'cd .environments && git init && git add . && git commit -m "Env initialized" && cd ..'
  git :init
  git flow: 'init -d -f'
  git add: '.'
  git commit: '-m "Project initialized"'
end

#setup_gitignore_filesObject



34
35
36
37
# File 'lib/cybele/app_builder.rb', line 34

def setup_gitignore_files
  remove_file '.gitignore', force: true
  copy_file 'cybele_gitignore', '.gitignore'
end

#setup_gitignore_foldersObject



39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/cybele/app_builder.rb', line 39

def setup_gitignore_folders
  %w[
    app/assets/images
    db/migrate
    spec/support
    spec/lib
    spec/models
    spec/views
    spec/controllers
    spec/helpers
  ].each do |dir|
    empty_directory_with_keep_file dir
  end
end