Class: BlueberryRails::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- BlueberryRails::AppGenerator
- Defined in:
- lib/blueberry_rails/generators/app_generator.rb
Instance Method Summary collapse
- #blueberry_customization ⇒ Object
- #configure_app ⇒ Object
- #create_assets ⇒ Object
- #create_views ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #rake_tasks ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #run_bundle ⇒ Object
- #setup_admin ⇒ Object
- #setup_cache_and_compress ⇒ Object
- #setup_cocoon ⇒ Object
- #setup_custom_errors ⇒ Object
- #setup_database ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_gems ⇒ Object
- #setup_git ⇒ Object
- #setup_heroku ⇒ Object
- #setup_initializers ⇒ Object
- #setup_integration_environment ⇒ Object
- #setup_linters ⇒ Object
- #setup_staging_environment ⇒ Object
- #setup_test_environment ⇒ Object
Instance Method Details
#blueberry_customization ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 54 def blueberry_customization invoke :customize_gemfile invoke :setup_database invoke :setup_development_environment invoke :setup_test_environment invoke :setup_staging_environment invoke :setup_integration_environment invoke :create_views invoke :create_assets invoke :configure_app invoke :remove_routes_comment_lines invoke :setup_gems invoke :setup_git invoke :setup_admin invoke :rake_tasks invoke :setup_custom_errors invoke :setup_initializers invoke :setup_heroku invoke :setup_cache_and_compress invoke :setup_linters end |
#configure_app ⇒ Object
146 147 148 149 150 151 152 153 154 155 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 146 def configure_app build :secret_token build :setup_mailer_hosts build :create_pryrc build :create_procfile build :create_puma_config build :add_ruby_version_file build :configure_i18n build :configure_bin_setup end |
#create_assets ⇒ Object
142 143 144 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 142 def create_assets build :copy_assets_directory if [:bootstrap] end |
#create_views ⇒ Object
137 138 139 140 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 137 def create_views build :create_partials_directory build :create_application_layout end |
#customize_gemfile ⇒ Object
76 77 78 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 76 def customize_gemfile bundle_command 'install' end |
#finish_template ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 46 def finish_template if [:administration] && (![:devise] || ![:bootstrap]) raise 'Administration depends on bootstrap and devise!' end invoke :blueberry_customization super end |
#rake_tasks ⇒ Object
202 203 204 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 202 def rake_tasks build :copy_rake_tasks end |
#remove_routes_comment_lines ⇒ Object
157 158 159 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 157 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#run_bundle ⇒ Object
206 207 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 206 def run_bundle end |
#setup_admin ⇒ Object
124 125 126 127 128 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 124 def setup_admin if [:administration] build :setup_admin end end |
#setup_cache_and_compress ⇒ Object
161 162 163 164 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 161 def setup_cache_and_compress say 'Setting up compress and cache for production env' build :cache_and_compress end |
#setup_cocoon ⇒ Object
197 198 199 200 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 197 def setup_cocoon say 'Setting up Cocoon' build :cocoon_config end |
#setup_custom_errors ⇒ Object
130 131 132 133 134 135 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 130 def setup_custom_errors if [:custom_errors] say 'Setting up custom errors' build :copy_custom_errors end end |
#setup_database ⇒ Object
80 81 82 83 84 85 86 87 88 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 80 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
90 91 92 93 94 95 96 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 90 def setup_development_environment say 'Setting up the development environment' build :configure_generators build :raise_on_unpermitted_parameters build :configure_i18n_logger build :configure_mailcatcher end |
#setup_gems ⇒ Object
166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 166 def setup_gems say 'Setting up SimpleForm' build :configure_simple_form if [:devise] say 'Setting up devise' build :install_devise build :replace_users_factory build :replace_root_controller_spec else build :create_root_page end end |
#setup_git ⇒ Object
179 180 181 182 183 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 179 def setup_git say 'Initializing git' build :setup_gitignore build :init_git end |
#setup_heroku ⇒ Object
185 186 187 188 189 190 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 185 def setup_heroku if [:heroku] say 'Add heroku reviews apps config' build :reviews_app end end |
#setup_initializers ⇒ Object
119 120 121 122 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 119 def setup_initializers say 'Setting up initializers' build :copy_initializers end |
#setup_integration_environment ⇒ Object
114 115 116 117 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 114 def setup_integration_environment say 'Setting up the integration environment' build :setup_integration_environment end |
#setup_linters ⇒ Object
192 193 194 195 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 192 def setup_linters say 'Setting up linters' build :hound_config end |
#setup_staging_environment ⇒ Object
109 110 111 112 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 109 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment end |
#setup_test_environment ⇒ Object
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 98 def setup_test_environment say 'Setting up the test environment' build :generate_rspec build :configure_rspec build :setup_rspec_support_files build :test_factories_first build :configure_circle build :init_guard build :setup_guard end |