Class: Replicator::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Replicator::AppGenerator
- Defined in:
- lib/replicator/generators/app_generator.rb
Instance Method Summary collapse
- #configure_app ⇒ Object
- #copy_libraries ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_github_repo ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_replicator_views ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #init_git ⇒ Object
- #migrate_database ⇒ Object
- #outro ⇒ Object
- #remove_files_we_dont_need ⇒ Object
- #replicator_customization ⇒ Object
- #run_bundle ⇒ Object
- #setup_coffeescript ⇒ Object
- #setup_database ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_git ⇒ Object
- #setup_gitignore ⇒ Object
- #setup_production_environment ⇒ Object
- #setup_staging_environment ⇒ Object
- #setup_stylesheets ⇒ Object
- #setup_test_environment ⇒ Object
- #update_routes ⇒ Object
Instance Method Details
#configure_app ⇒ Object
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/replicator/generators/app_generator.rb', line 111 def configure_app say 'Configuring app' build :configure_action_mailer build :blacklist_active_record_attributes build :configure_strong_parameters build :configure_time_zone build :configure_time_formats build :configure_rack_timeout build :disable_xml_params build :setup_default_rake_task build :setup_application_helper build :configure_unicorn build :setup_foreman build :setup_guard build :setup_devise_and_cancan build :generate_pages_controller build :setup_admin_section end |
#copy_libraries ⇒ Object
164 165 166 167 |
# File 'lib/replicator/generators/app_generator.rb', line 164 def copy_libraries say 'Copying libraries' build :copy_libraries end |
#copy_miscellaneous_files ⇒ Object
169 170 171 172 |
# File 'lib/replicator/generators/app_generator.rb', line 169 def copy_miscellaneous_files say 'Copying miscellaneous support files' build :copy_miscellaneous_files end |
#create_github_repo ⇒ Object
149 150 151 152 153 154 |
# File 'lib/replicator/generators/app_generator.rb', line 149 def create_github_repo if [:github] say 'Creating Github repo' build :create_github_repo, [:github] end end |
#create_heroku_apps ⇒ Object
141 142 143 144 145 146 147 |
# File 'lib/replicator/generators/app_generator.rb', line 141 def create_heroku_apps if [:heroku] say 'Creating Heroku apps' build :create_heroku_apps build :set_heroku_remotes end end |
#create_replicator_views ⇒ Object
97 98 99 100 101 102 103 |
# File 'lib/replicator/generators/app_generator.rb', line 97 def create_replicator_views say 'Creating replicator views' build :create_partials_directory build :create_shared_flashes build :create_shared_javascripts build :create_application_layout end |
#customize_error_pages ⇒ Object
174 175 176 177 |
# File 'lib/replicator/generators/app_generator.rb', line 174 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
50 51 52 53 54 55 |
# File 'lib/replicator/generators/app_generator.rb', line 50 def customize_gemfile build :replace_gemfile build :set_ruby_to_version_being_used build :setup_rvmrc bundle_command 'install' end |
#finish_template ⇒ Object
18 19 20 21 |
# File 'lib/replicator/generators/app_generator.rb', line 18 def finish_template invoke :replicator_customization super end |
#init_git ⇒ Object
160 161 162 |
# File 'lib/replicator/generators/app_generator.rb', line 160 def init_git build :init_git end |
#migrate_database ⇒ Object
183 184 185 186 |
# File 'lib/replicator/generators/app_generator.rb', line 183 def migrate_database say 'Migrating database' build :migrate_database end |
#outro ⇒ Object
188 189 190 191 |
# File 'lib/replicator/generators/app_generator.rb', line 188 def outro say 'Congratulations! Replication complete!' say "Remember to run 'rails generate airbrake' with your API key." end |
#remove_files_we_dont_need ⇒ Object
45 46 47 48 |
# File 'lib/replicator/generators/app_generator.rb', line 45 def remove_files_we_dont_need build :remove_public_index build :remove_rails_logo_image end |
#replicator_customization ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/replicator/generators/app_generator.rb', line 23 def replicator_customization invoke :remove_files_we_dont_need invoke :customize_gemfile invoke :setup_database invoke :setup_development_environment invoke :setup_test_environment invoke :setup_production_environment invoke :setup_staging_environment invoke :create_replicator_views invoke :setup_coffeescript invoke :configure_app invoke :setup_stylesheets invoke :copy_miscellaneous_files invoke :customize_error_pages invoke :update_routes invoke :migrate_database invoke :setup_git invoke :create_heroku_apps invoke :create_github_repo invoke :outro end |
#run_bundle ⇒ Object
193 194 195 |
# File 'lib/replicator/generators/app_generator.rb', line 193 def run_bundle # Let's not: We'll bundle manually at the right spot end |
#setup_coffeescript ⇒ Object
105 106 107 108 109 |
# File 'lib/replicator/generators/app_generator.rb', line 105 def setup_coffeescript say 'Setting up CoffeeScript defaults' build :remove_turbolinks build :create_common_javascripts end |
#setup_database ⇒ Object
57 58 59 60 61 62 63 64 65 |
# File 'lib/replicator/generators/app_generator.rb', line 57 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
67 68 69 70 71 72 73 |
# File 'lib/replicator/generators/app_generator.rb', line 67 def setup_development_environment say 'Setting up the development environment' build :raise_on_delivery_errors build :raise_on_unpermitted_parameters build :provide_setup_script build :configure_generators end |
#setup_git ⇒ Object
135 136 137 138 139 |
# File 'lib/replicator/generators/app_generator.rb', line 135 def setup_git say 'Initializing git' invoke :setup_gitignore invoke :init_git end |
#setup_gitignore ⇒ Object
156 157 158 |
# File 'lib/replicator/generators/app_generator.rb', line 156 def setup_gitignore build :gitignore_files end |
#setup_production_environment ⇒ Object
87 88 89 90 |
# File 'lib/replicator/generators/app_generator.rb', line 87 def setup_production_environment say 'Setting up the production environment' build :configure_smtp end |
#setup_staging_environment ⇒ Object
92 93 94 95 |
# File 'lib/replicator/generators/app_generator.rb', line 92 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment end |
#setup_stylesheets ⇒ Object
130 131 132 133 |
# File 'lib/replicator/generators/app_generator.rb', line 130 def setup_stylesheets say 'Set up stylesheets' build :setup_stylesheets end |
#setup_test_environment ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/replicator/generators/app_generator.rb', line 75 def setup_test_environment say 'Setting up the test environment' build :enable_factory_girl_syntax build :test_factories_first build :generate_rspec build :configure_rspec build :use_rspec_binstub build :configure_background_jobs_for_rspec build :enable_database_cleaner build :configure_capybara_webkit end |
#update_routes ⇒ Object
179 180 181 |
# File 'lib/replicator/generators/app_generator.rb', line 179 def update_routes build :update_routes end |