Class: Generapp::Generators::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Generapp::Generators::AppGenerator
- Defined in:
- lib/generapp/generators/app_generator.rb
Overview
Rails App generator
Instance Method Summary collapse
- #configure_app ⇒ Object
- #create_generapp_views ⇒ Object
- #finish_template ⇒ Object
- #generapp_customization ⇒ Object
- #generate_spring_binstubs ⇒ Object
- #get_builder_class ⇒ Object protected
- #init_git ⇒ Object
- #outro ⇒ Object
- #setup_bundler_audit ⇒ Object
- #setup_database ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_gems ⇒ Object
- #setup_git ⇒ Object
- #setup_production_environment ⇒ Object
- #setup_rubocop ⇒ Object
- #setup_stylesheets ⇒ Object
- #setup_test_environment ⇒ Object
- #using_active_record? ⇒ Boolean protected
Instance Method Details
#configure_app ⇒ Object
86 87 88 89 90 91 |
# File 'lib/generapp/generators/app_generator.rb', line 86 def configure_app say 'Configuring app' Generapp::Actions::Configuration.instance_methods(false).each do |action| build action.to_sym end end |
#create_generapp_views ⇒ Object
79 80 81 82 83 84 |
# File 'lib/generapp/generators/app_generator.rb', line 79 def create_generapp_views say 'Creating views' Generapp::Actions::Views.instance_methods(false).each do |action| build action.to_sym end end |
#finish_template ⇒ Object
32 33 34 35 |
# File 'lib/generapp/generators/app_generator.rb', line 32 def finish_template invoke :generapp_customization super end |
#generapp_customization ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/generapp/generators/app_generator.rb', line 37 def generapp_customization invoke :setup_gems invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :create_generapp_views invoke :configure_app invoke :setup_stylesheets invoke :setup_database invoke :setup_git invoke :setup_bundler_audit invoke :setup_rubocop invoke :generate_spring_binstubs invoke :outro end |
#generate_spring_binstubs ⇒ Object
122 123 124 125 |
# File 'lib/generapp/generators/app_generator.rb', line 122 def generate_spring_binstubs say 'Springifying executables' build :generate_spring_binstubs end |
#get_builder_class ⇒ Object (protected)
138 139 140 |
# File 'lib/generapp/generators/app_generator.rb', line 138 def get_builder_class Generapp::AppBuilder end |
#init_git ⇒ Object
127 128 129 |
# File 'lib/generapp/generators/app_generator.rb', line 127 def init_git build :init_git end |
#outro ⇒ Object
131 132 133 134 |
# File 'lib/generapp/generators/app_generator.rb', line 131 def outro say "Done generating #{app_name}" say "Remember to run 'bundle exec honeybadger install [YOUR API KEY HERE]'" end |
#setup_bundler_audit ⇒ Object
112 113 114 115 |
# File 'lib/generapp/generators/app_generator.rb', line 112 def setup_bundler_audit say 'Setting up bundler-audit' build :setup_bundler_audit end |
#setup_database ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/generapp/generators/app_generator.rb', line 98 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
58 59 60 61 62 63 |
# File 'lib/generapp/generators/app_generator.rb', line 58 def setup_development_environment say 'Setting up the development environment' Generapp::Actions::Develop.instance_methods(false).each do |action| build action.to_sym end end |
#setup_gems ⇒ Object
53 54 55 56 |
# File 'lib/generapp/generators/app_generator.rb', line 53 def setup_gems build :set_ruby_version bundle_command 'install' end |
#setup_git ⇒ Object
106 107 108 109 110 |
# File 'lib/generapp/generators/app_generator.rb', line 106 def setup_git return if [:skip_git] say 'Initializing git' invoke :init_git end |
#setup_production_environment ⇒ Object
72 73 74 75 76 77 |
# File 'lib/generapp/generators/app_generator.rb', line 72 def setup_production_environment say 'Setting up the production environment' Generapp::Actions::Production.instance_methods(false).each do |action| build action.to_sym end end |
#setup_rubocop ⇒ Object
117 118 119 120 |
# File 'lib/generapp/generators/app_generator.rb', line 117 def setup_rubocop say 'Setting up rubocop' build :setup_rubocop end |
#setup_stylesheets ⇒ Object
93 94 95 96 |
# File 'lib/generapp/generators/app_generator.rb', line 93 def setup_stylesheets say 'Setting up stylesheets' build :setup_stylesheets end |
#setup_test_environment ⇒ Object
65 66 67 68 69 70 |
# File 'lib/generapp/generators/app_generator.rb', line 65 def setup_test_environment say 'Setting up the test environment' Generapp::Actions::Test.instance_methods(false).each do |action| build action.to_sym end end |
#using_active_record? ⇒ Boolean (protected)
142 143 144 |
# File 'lib/generapp/generators/app_generator.rb', line 142 def using_active_record? ![:skip_active_record] end |