Class: Wired::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Wired::AppGenerator
- Defined in:
- lib/wired/generators/app_generator.rb
Direct Known Subclasses
Instance Method Summary collapse
- #app_name_clean ⇒ Object
- #app_powder_name ⇒ Object
- #application_setup ⇒ Object
- #bundle_gems ⇒ Object
- #configure_app ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_heroku_apps ⇒ Object
- #create_wired_views ⇒ Object
- #customize_error_pages ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #outro ⇒ Object
- #remove_files_we_dont_need ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #run_bundle ⇒ Object
- #setup_database ⇒ Object
- #setup_git ⇒ Object
- #setup_robots_txt ⇒ Object
- #setup_test ⇒ Object
- #todo ⇒ Object
- #wired_customization ⇒ Object
Instance Method Details
#app_name_clean ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/wired/generators/app_generator.rb', line 17 def app_name_clean clean = app_name.parameterize clean = clean.gsub '_', '-' clean = "wl-#{clean}" if clean.length < 3 clean = clean[0..19] if clean.length > 20 clean end |
#app_powder_name ⇒ Object
25 26 27 28 29 |
# File 'lib/wired/generators/app_generator.rb', line 25 def app_powder_name clean = app_name.parameterize clean = clean.gsub '_', '-' clean end |
#application_setup ⇒ Object
48 49 50 51 |
# File 'lib/wired/generators/app_generator.rb', line 48 def application_setup build :powder_setup build :setup_robots_txt end |
#bundle_gems ⇒ Object
65 66 67 |
# File 'lib/wired/generators/app_generator.rb', line 65 def bundle_gems bundle_command 'install' end |
#configure_app ⇒ Object
84 85 86 87 88 89 90 |
# File 'lib/wired/generators/app_generator.rb', line 84 def configure_app say 'Configuring app' build :configure_time_zone build :set_asset_host build :set_action_mailer_config build :add_email_validator end |
#copy_miscellaneous_files ⇒ Object
92 93 94 |
# File 'lib/wired/generators/app_generator.rb', line 92 def copy_miscellaneous_files build :copy_miscellaneous_files end |
#create_heroku_apps ⇒ Object
123 124 125 126 127 128 |
# File 'lib/wired/generators/app_generator.rb', line 123 def create_heroku_apps unless ['skip-heroku'] say 'Creating Heroku apps' build :create_heroku_apps end end |
#create_wired_views ⇒ Object
69 70 71 72 73 74 75 |
# File 'lib/wired/generators/app_generator.rb', line 69 def create_wired_views say 'Creating views' build :create_partials_directory build :create_shared_flashes build :create_shared_analytics build :create_application_layout end |
#customize_error_pages ⇒ Object
102 103 104 105 |
# File 'lib/wired/generators/app_generator.rb', line 102 def customize_error_pages say 'Customizing the 500/404/422 pages' build :customize_error_pages end |
#customize_gemfile ⇒ Object
60 61 62 63 |
# File 'lib/wired/generators/app_generator.rb', line 60 def customize_gemfile build :replace_gemfile build :set_ruby_to_version_being_used end |
#finish_template ⇒ Object
12 13 14 15 |
# File 'lib/wired/generators/app_generator.rb', line 12 def finish_template invoke :wired_customization super end |
#outro ⇒ Object
130 131 132 |
# File 'lib/wired/generators/app_generator.rb', line 130 def outro say " _ _ _ ___ ___ _ ___ ___ \n | || || || - > | __>| | / - \\| - >\n | || || \\ | __>| |_ | | || _ \\\n |_/\\_||_||_|\\_\\|___>|___||_|_||___/\n" end |
#remove_files_we_dont_need ⇒ Object
53 54 55 56 57 58 |
# File 'lib/wired/generators/app_generator.rb', line 53 def remove_files_we_dont_need build :remove_doc_folder build :remove_public_index build :remove_rails_logo_image build :remove_turbo_links end |
#remove_routes_comment_lines ⇒ Object
107 108 109 |
# File 'lib/wired/generators/app_generator.rb', line 107 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#run_bundle ⇒ Object
138 139 140 |
# File 'lib/wired/generators/app_generator.rb', line 138 def run_bundle # Let's not: We'll bundle manually at the right spot end |
#setup_database ⇒ Object
77 78 79 80 81 82 |
# File 'lib/wired/generators/app_generator.rb', line 77 def setup_database say 'Setting up database' build :setup_database_config build :create_database build :add_postgres_drop_override end |
#setup_git ⇒ Object
116 117 118 119 120 121 |
# File 'lib/wired/generators/app_generator.rb', line 116 def setup_git say 'Setting up git' build :gitignore_files build :setup_git build :deploy_github unless ['skip-github'] end |
#setup_robots_txt ⇒ Object
96 97 98 99 100 |
# File 'lib/wired/generators/app_generator.rb', line 96 def setup_robots_txt build :create_robots_txt build :remove_public_robots build :add_robots_routes end |
#setup_test ⇒ Object
111 112 113 114 |
# File 'lib/wired/generators/app_generator.rb', line 111 def setup_test say 'Setting up test environment' build :test_configuration_files end |
#todo ⇒ Object
134 135 136 |
# File 'lib/wired/generators/app_generator.rb', line 134 def todo say "\n ------TODO------" end |
#wired_customization ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/wired/generators/app_generator.rb', line 31 def wired_customization invoke :remove_files_we_dont_need invoke :customize_gemfile invoke :create_wired_views invoke :setup_test invoke :setup_database invoke :configure_app invoke :customize_error_pages invoke :remove_routes_comment_lines invoke :application_setup invoke :bundle_gems invoke :setup_git invoke :create_heroku_apps invoke :outro invoke :todo end |