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
- #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_spring ⇒ Object
- #setup_stylesheets ⇒ Object
- #setup_test_environment ⇒ Object
- #using_active_record? ⇒ Boolean protected
Instance Method Details
#configure_app ⇒ Object
84 85 86 87 88 89 |
# File 'lib/generapp/generators/app_generator.rb', line 84 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
77 78 79 80 81 82 |
# File 'lib/generapp/generators/app_generator.rb', line 77 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
31 32 33 34 |
# File 'lib/generapp/generators/app_generator.rb', line 31 def finish_template invoke :generapp_customization super end |
#generapp_customization ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/generapp/generators/app_generator.rb', line 36 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_spring invoke :outro end |
#get_builder_class ⇒ Object (protected)
131 132 133 |
# File 'lib/generapp/generators/app_generator.rb', line 131 def get_builder_class Generapp::AppBuilder end |
#init_git ⇒ Object
120 121 122 |
# File 'lib/generapp/generators/app_generator.rb', line 120 def init_git build :init_git end |
#outro ⇒ Object
124 125 126 127 |
# File 'lib/generapp/generators/app_generator.rb', line 124 def outro say "Done generating #{app_name}" say "Remember to run 'bundle exec honeybadger install [YOUR API KEY HERE]'" end |
#setup_bundler_audit ⇒ Object
110 111 112 113 |
# File 'lib/generapp/generators/app_generator.rb', line 110 def setup_bundler_audit say 'Setting up bundler-audit' build :setup_bundler_audit end |
#setup_database ⇒ Object
96 97 98 99 100 101 102 |
# File 'lib/generapp/generators/app_generator.rb', line 96 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
56 57 58 59 60 61 |
# File 'lib/generapp/generators/app_generator.rb', line 56 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
51 52 53 54 |
# File 'lib/generapp/generators/app_generator.rb', line 51 def setup_gems build :set_ruby_version bundle_command 'install' end |
#setup_git ⇒ Object
104 105 106 107 108 |
# File 'lib/generapp/generators/app_generator.rb', line 104 def setup_git return if [:skip_git] say 'Initializing git' invoke :init_git end |
#setup_production_environment ⇒ Object
70 71 72 73 74 75 |
# File 'lib/generapp/generators/app_generator.rb', line 70 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_spring ⇒ Object
115 116 117 118 |
# File 'lib/generapp/generators/app_generator.rb', line 115 def setup_spring say 'Springifying executables' build :setup_spring end |
#setup_stylesheets ⇒ Object
91 92 93 94 |
# File 'lib/generapp/generators/app_generator.rb', line 91 def setup_stylesheets say 'Setting up stylesheets' build :setup_stylesheets end |
#setup_test_environment ⇒ Object
63 64 65 66 67 68 |
# File 'lib/generapp/generators/app_generator.rb', line 63 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)
135 136 137 |
# File 'lib/generapp/generators/app_generator.rb', line 135 def using_active_record? ![:skip_active_record] end |