class Cybele::AppGenerator
Public Class Methods
new(*args)
click to toggle source
Calls superclass method
# File lib/cybele/generators/app_generator.rb, line 76 def initialize(*args) super # Set options @options = options.dup dependency_control(@options) if @options[:skip_ask] ask_questions(@options) unless @options[:skip_ask] end
Public Instance Methods
active_storage()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 191 def active_storage say 'Make active_storage amazon configuration', :green build :active_storage_setting end
configure_error_pages()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 214 def configure_error_pages say 'Setup custom exception pages and 404 page', :green build :configure_error_pages end
configure_locale_language()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 158 def configure_locale_language say 'Configure locale', :green build :configure_locale_language end
configure_mail_setting()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 203 def configure_mail_setting say 'Setup mail settings' build :configure_action_mailer build :configure_smtp end
configure_recipient_interceptor()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 148 def configure_recipient_interceptor say 'Setup mail settings with recipient_interceptor in staging', :green build :configure_recipient_interceptor end
customize_app_files()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 229 def customize_app_files say 'Customize default files', :green build :customize_model_files build :customize_mailer_files build :customize_default_view_files end
customize_gemfile()
click to toggle source
:reek: TooManyStatements
# File lib/cybele/generators/app_generator.rb, line 86 def customize_gemfile say 'Customize gem file', :green build :add_gems build :add_simple_form_gem unless @options[:skip_simple_form] build :add_show_for_gem unless @options[:skip_show_for] build :add_haml_gems unless @options[:skip_haml] build :add_required_view_gems unless @options[:skip_view_files] bundle_command 'install --binstubs=bin/stubs' end
customize_optional_view_files()
click to toggle source
:reek: TooManyStatements
# File lib/cybele/generators/app_generator.rb, line 237 def customize_optional_view_files return if @options[:skip_view_files] say 'Customize optional view files', :green build :customize_assets_files build :customize_vendor_files build :customize_helper_files build :customize_view_files_with_option build :generate_devise_views build :configure_routes build :customize_controller_files build :add_devise_protect_from_forgery build :add_devise_strong_parameter build :add_devise_authenticate_admin build :configure_basic_authentication end
docker_development_env()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 253 def docker_development_env return if @options[:skip_docker] say 'Setup docker development environment', :green build :setup_docker_development_env end
force_ssl()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 186 def force_ssl say 'Add ssl control into staging.rb and production.rb', :green build :force_ssl_setting end
gitignore_files_and_folders()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 209 def gitignore_files_and_folders build :setup_gitignore_files build :setup_gitignore_folders end
goodbye()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 274 def goodbye say 'Congratulations! That\'s all...', :green end
remove_files_we_dont_need()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 106 def remove_files_we_dont_need say 'Remove files we don\'t need', :green build :remove_readme_rdoc end
setup_audited()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 224 def setup_audited say 'Setup audited gem', :green build :configure_audited end
setup_bullet_config()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 181 def setup_bullet_config say 'Setup bullet config' build :configure_bullet end
setup_config()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 111 def setup_config say 'Generate config', :green build :generate_config end
setup_cybele_version()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 101 def setup_cybele_version say 'Add .VERSION.txt file', :green build :add_cybele_version end
setup_database()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 121 def setup_database if @options[:database] == 'postgresql' say 'Set up postgresql template', :green build :use_postgres_config_template end return if @options[:skip_create_database] say 'Create database', :green build :create_database end
setup_devise()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 196 def setup_devise say 'Generate devise' build :generate_devise_settings say 'Adding devise models' build :generate_devise_models end
setup_dotenv()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 116 def setup_dotenv say 'Generate .env.* files', :green build :configure_dotenv end
setup_editor_config()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 96 def setup_editor_config say 'Add .editor_config file', :green build :add_editor_config end
setup_environment_generator()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 264 def setup_environment_generator say 'Environment generator setup', :green build :add_environment_to_lib end
setup_git_and_git_flow()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 269 def setup_git_and_git_flow say 'Initialize git and git flow' build :git_and_git_flow_commands end
setup_haml()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 175 def setup_haml return if @options[:skip_haml] say 'Setting up haml and generate haml-rails', :green build :configure_haml end
setup_pronto()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 259 def setup_pronto say 'Pronto is setup', :green build :add_pronto_to_gemfile end
setup_pronto_config()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 219 def setup_pronto_config say 'Setup pronto config', :green build :configure_pronto end
setup_responders()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 138 def setup_responders say 'Setting up responders', :green build :configure_responders end
setup_rollbar()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 153 def setup_rollbar say 'Generate rollbar', :green build :generate_rollbar end
setup_show_for()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 163 def setup_show_for return if @options[:skip_show_for] say 'Generate show_for', :green build :configure_show_for end
setup_sidekiq()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 132 def setup_sidekiq return if @options[:skip_sidekiq] say 'Setting up sidekiq', :green build :configure_sidekiq end
setup_simple_form()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 169 def setup_simple_form return if @options[:skip_simple_form] say 'Setting up simple_form', :green build :configure_simple_form end
setup_staging_environment()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 143 def setup_staging_environment say 'Setting up the staging environment', :green build :setup_staging_environment end
Protected Instance Methods
get_builder_class()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 284 def get_builder_class Cybele::AppBuilder end
Private Instance Methods
arg_checker(selected_options, option, option_array)
click to toggle source
:reek: TooManyStatements
# File lib/cybele/generators/app_generator.rb, line 326 def arg_checker(selected_options, option, option_array) return if selected_options[option] failed = false option_array.each do |opt| if selected_options[opt] puts "Don't #{opt}" failed = true end end return unless failed puts "#{option} dependency error!" puts puts 'See --help for more info' exit 0 end
ask_questions(options)
click to toggle source
:reek: TooManyStatements
# File lib/cybele/generators/app_generator.rb, line 295 def ask_questions(options) say 'Ask cybele options', :green option_with_ask_limited(options, :database, DATABASES) option_with_ask_yes(options, :skip_create_database) option_with_ask_yes(options, :skip_sidekiq) option_with_ask_yes(options, :skip_simple_form) option_with_ask_yes(options, :skip_show_for) option_with_ask_yes(options, :skip_haml) option_with_ask_yes(options, :skip_view_files) option_with_ask_yes(options, :skip_docker) options.freeze dependency_control(options) end
config_master_key_content()
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 290 def config_master_key_content IO.read(File.join(destination_root, '/config/master.key')) end
dependency_control(selected_options)
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 321 def dependency_control(selected_options) arg_checker(selected_options, :skip_view_files, %i[skip_haml skip_show_for skip_simple_form]) end
option_with_ask_limited(options, key, limits)
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 317 def option_with_ask_limited(options, key, limits) options[key] = ask("#{key.to_s.humanize} :", limited_to: limits) end
option_with_ask_yes(options, key)
click to toggle source
# File lib/cybele/generators/app_generator.rb, line 309 def option_with_ask_yes(options, key) say "==> #{key.to_s.humanize}", :green say 'Type for answer yes: y|yes', :green say 'Type for answer no: n|no|any character', :yellow options[key] = yes?('Ans :', :green) end