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_custom_errors ⇒ Object
- #setup_database ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_fontcustom ⇒ Object
- #setup_gems ⇒ Object
- #setup_git ⇒ Object
- #setup_gulp ⇒ Object
- #setup_heroku ⇒ Object
- #setup_initializers ⇒ Object
- #setup_staging_environment ⇒ Object
- #setup_test_environment ⇒ Object
Instance Method Details
#blueberry_customization ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 57 def blueberry_customization invoke :customize_gemfile invoke :setup_database invoke :setup_development_environment invoke :setup_test_environment invoke :setup_staging_environment invoke :create_views invoke :create_assets invoke :configure_app invoke :remove_routes_comment_lines invoke :setup_gems invoke :setup_git invoke :setup_gulp invoke :setup_admin invoke :rake_tasks invoke :setup_custom_errors invoke :setup_initializers invoke :setup_fontcustom invoke :setup_heroku invoke :setup_cache_and_compress end |
#configure_app ⇒ Object
152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 152 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 :hound_config build :configure_i18n build :configure_bin_setup end |
#create_assets ⇒ Object
148 149 150 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 148 def create_assets build :copy_assets_directory if [:bootstrap] end |
#create_views ⇒ Object
143 144 145 146 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 143 def create_views build :create_partials_directory build :create_application_layout end |
#customize_gemfile ⇒ Object
79 80 81 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 79 def customize_gemfile bundle_command 'install' end |
#finish_template ⇒ Object
49 50 51 52 53 54 55 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 49 def finish_template if [:administration] && (![:devise] || ![:bootstrap]) raise 'Administration depends on bootstrap and devise!' end invoke :blueberry_customization super end |
#rake_tasks ⇒ Object
206 207 208 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 206 def rake_tasks build :copy_rake_tasks end |
#remove_routes_comment_lines ⇒ Object
164 165 166 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 164 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#run_bundle ⇒ Object
210 211 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 210 def run_bundle end |
#setup_admin ⇒ Object
130 131 132 133 134 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 130 def setup_admin if [:administration] build :setup_admin end end |
#setup_cache_and_compress ⇒ Object
168 169 170 171 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 168 def setup_cache_and_compress say 'Setting up compress and cache for production env' build :cache_and_compress end |
#setup_custom_errors ⇒ Object
136 137 138 139 140 141 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 136 def setup_custom_errors if [:custom_errors] say 'Setting up custom errors' build :copy_custom_errors end end |
#setup_database ⇒ Object
83 84 85 86 87 88 89 90 91 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 83 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
93 94 95 96 97 98 99 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 93 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_fontcustom ⇒ Object
123 124 125 126 127 128 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 123 def setup_fontcustom if [:fontcustom] say 'Setting up fontcustom' build :copy_fontcustom_config end end |
#setup_gems ⇒ Object
173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 173 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
186 187 188 189 190 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 186 def setup_git say 'Initializing git' build :setup_gitignore build :init_git end |
#setup_gulp ⇒ Object
192 193 194 195 196 197 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 192 def setup_gulp if [:gulp] say 'Adding Gulp asset pipeline' build :gulp_files end end |
#setup_heroku ⇒ Object
199 200 201 202 203 204 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 199 def setup_heroku if [:heroku] say 'Add heroku reviews apps config' build :reviews_app end end |
#setup_initializers ⇒ Object
118 119 120 121 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 118 def setup_initializers say 'Setting up initializers' build :copy_initializers end |
#setup_staging_environment ⇒ Object
112 113 114 115 116 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 112 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment build :setup_secret_token end |
#setup_test_environment ⇒ Object
101 102 103 104 105 106 107 108 109 110 |
# File 'lib/blueberry_rails/generators/app_generator.rb', line 101 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 |