Class: Suspenders::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Suspenders::AppGenerator
- Defined in:
- lib/suspenders/generators/app_generator.rb
Instance Method Summary collapse
- #configure_app ⇒ Object
- #copy_libraries ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_common_javascripts ⇒ Object
- #create_github_repo ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_suspenders_views ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #init_git ⇒ Object
- #outro ⇒ Object
- #remove_files_we_dont_need ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #run_bundle ⇒ 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
- #suspenders_customization ⇒ Object
Instance Method Details
#configure_app ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/suspenders/generators/app_generator.rb', line 108 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 :configure_unicorn build :setup_foreman end |
#copy_libraries ⇒ Object
155 156 157 158 |
# File 'lib/suspenders/generators/app_generator.rb', line 155 def copy_libraries say 'Copying libraries' build :copy_libraries end |
#copy_miscellaneous_files ⇒ Object
160 161 162 163 |
# File 'lib/suspenders/generators/app_generator.rb', line 160 def copy_miscellaneous_files say 'Copying miscellaneous support files' build :copy_miscellaneous_files end |
#create_common_javascripts ⇒ Object
103 104 105 106 |
# File 'lib/suspenders/generators/app_generator.rb', line 103 def create_common_javascripts say 'Pulling in some common javascripts' build :create_common_javascripts end |
#create_github_repo ⇒ Object
140 141 142 143 144 145 |
# File 'lib/suspenders/generators/app_generator.rb', line 140 def create_github_repo if [:github] say 'Creating Github repo' build :create_github_repo, [:github] end end |
#create_heroku_apps ⇒ Object
133 134 135 136 137 138 |
# File 'lib/suspenders/generators/app_generator.rb', line 133 def create_heroku_apps if [:heroku] say 'Creating Heroku apps' build :create_heroku_apps end end |
#create_suspenders_views ⇒ Object
95 96 97 98 99 100 101 |
# File 'lib/suspenders/generators/app_generator.rb', line 95 def create_suspenders_views say 'Creating suspenders views' build :create_partials_directory build :create_shared_flashes build :create_shared_javascripts build :create_application_layout end |
#customize_error_pages ⇒ Object
165 166 167 168 |
# File 'lib/suspenders/generators/app_generator.rb', line 165 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
49 50 51 52 53 |
# File 'lib/suspenders/generators/app_generator.rb', line 49 def customize_gemfile build :replace_gemfile build :set_ruby_to_version_being_used bundle_command 'install --binstubs=bin/stubs' end |
#finish_template ⇒ Object
18 19 20 21 |
# File 'lib/suspenders/generators/app_generator.rb', line 18 def finish_template invoke :suspenders_customization super end |
#init_git ⇒ Object
151 152 153 |
# File 'lib/suspenders/generators/app_generator.rb', line 151 def init_git build :init_git end |
#outro ⇒ Object
174 175 176 177 |
# File 'lib/suspenders/generators/app_generator.rb', line 174 def outro say 'Congratulations! You just pulled our suspenders.' say "Remember to run 'rails generate airbrake' with your API key." end |
#remove_files_we_dont_need ⇒ Object
44 45 46 47 |
# File 'lib/suspenders/generators/app_generator.rb', line 44 def remove_files_we_dont_need build :remove_public_index build :remove_rails_logo_image end |
#remove_routes_comment_lines ⇒ Object
170 171 172 |
# File 'lib/suspenders/generators/app_generator.rb', line 170 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#run_bundle ⇒ Object
179 180 181 |
# File 'lib/suspenders/generators/app_generator.rb', line 179 def run_bundle # Let's not: We'll bundle manually at the right spot end |
#setup_database ⇒ Object
55 56 57 58 59 60 61 62 63 |
# File 'lib/suspenders/generators/app_generator.rb', line 55 def setup_database say 'Setting up database' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#setup_development_environment ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/suspenders/generators/app_generator.rb', line 65 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
127 128 129 130 131 |
# File 'lib/suspenders/generators/app_generator.rb', line 127 def setup_git say 'Initializing git' invoke :setup_gitignore invoke :init_git end |
#setup_gitignore ⇒ Object
147 148 149 |
# File 'lib/suspenders/generators/app_generator.rb', line 147 def setup_gitignore build :gitignore_files end |
#setup_production_environment ⇒ Object
85 86 87 88 |
# File 'lib/suspenders/generators/app_generator.rb', line 85 def setup_production_environment say 'Setting up the production environment' build :configure_smtp end |
#setup_staging_environment ⇒ Object
90 91 92 93 |
# File 'lib/suspenders/generators/app_generator.rb', line 90 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment end |
#setup_stylesheets ⇒ Object
122 123 124 125 |
# File 'lib/suspenders/generators/app_generator.rb', line 122 def setup_stylesheets say 'Set up stylesheets' build :setup_stylesheets end |
#setup_test_environment ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/suspenders/generators/app_generator.rb', line 73 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 :configure_background_jobs_for_rspec build :enable_database_cleaner build :configure_capybara_webkit build :setup_guard_spork end |
#suspenders_customization ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/suspenders/generators/app_generator.rb', line 23 def suspenders_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_suspenders_views invoke :create_common_javascripts invoke :configure_app invoke :setup_stylesheets invoke :copy_miscellaneous_files invoke :customize_error_pages invoke :remove_routes_comment_lines invoke :setup_git invoke :create_heroku_apps invoke :create_github_repo invoke :outro end |