Class: Sparkler::AppGenerator
- Inherits:
-
Rails::Generators::AppGenerator
- Object
- Rails::Generators::AppGenerator
- Sparkler::AppGenerator
- Defined in:
- lib/sparkler/generators/app_generator.rb
Instance Method Summary collapse
- #configure_generators ⇒ Object
- #copy_miscellaneous_files ⇒ Object
- #create_views_and_layouts ⇒ Object
- #customize_gemfile ⇒ Object
- #finish_template ⇒ Object
- #outro ⇒ Object
- #remove_routes_comment_lines ⇒ Object
- #remove_useless_files ⇒ Object
- #run_bundle ⇒ Object
- #setup_database ⇒ Object
- #setup_env ⇒ Object
- #setup_foundation ⇒ Object
- #setup_git ⇒ Object
- #setup_rspec ⇒ Object
- #setup_scripts ⇒ Object
- #setup_sentry ⇒ Object
- #setup_spring ⇒ Object
- #setup_staging_environment ⇒ Object
- #sparkler_customization ⇒ Object
- #use_coffeescript ⇒ Object
Instance Method Details
#configure_generators ⇒ Object
87 88 89 90 |
# File 'lib/sparkler/generators/app_generator.rb', line 87 def configure_generators say 'Configuring generators' build :configure_generators end |
#copy_miscellaneous_files ⇒ Object
109 110 111 112 |
# File 'lib/sparkler/generators/app_generator.rb', line 109 def copy_miscellaneous_files say 'Copying miscellaneous support files' build :copy_miscellaneous_files end |
#create_views_and_layouts ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/sparkler/generators/app_generator.rb', line 59 def create_views_and_layouts say 'Creating layouts and partials' build :create_partials_directory build :create_shared_flashes say 'Setting up High Voltage and a home page' build :setup_high_voltage end |
#customize_gemfile ⇒ Object
80 81 82 83 84 85 |
# File 'lib/sparkler/generators/app_generator.rb', line 80 def customize_gemfile say 'Setting up gems and bundling' build :gemfile bundle_command 'install --path vendor' bundle_command 'package' end |
#finish_template ⇒ Object
10 11 12 13 |
# File 'lib/sparkler/generators/app_generator.rb', line 10 def finish_template invoke :sparkler_customization super end |
#outro ⇒ Object
128 129 130 |
# File 'lib/sparkler/generators/app_generator.rb', line 128 def outro say 'Congratulations! Your app is ready to go!' end |
#remove_routes_comment_lines ⇒ Object
124 125 126 |
# File 'lib/sparkler/generators/app_generator.rb', line 124 def remove_routes_comment_lines build :remove_routes_comment_lines end |
#remove_useless_files ⇒ Object
38 39 40 41 |
# File 'lib/sparkler/generators/app_generator.rb', line 38 def remove_useless_files build :remove_public_index build :remove_rails_logo_image end |
#run_bundle ⇒ Object
132 133 134 |
# File 'lib/sparkler/generators/app_generator.rb', line 132 def run_bundle end |
#setup_database ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/sparkler/generators/app_generator.rb', line 43 def setup_database if [:database] == 'postgresql' build :use_postgres_config_template build :setup_local_postgres if [:local_database] build :create_postgres_database elsif [:database] == 'sqlite3' build :use_sqlite_config_template build :create_sqlite_database end end |
#setup_env ⇒ Object
114 115 116 117 |
# File 'lib/sparkler/generators/app_generator.rb', line 114 def setup_env say 'Adding an .env file' build :add_env_from_template end |
#setup_foundation ⇒ Object
68 69 70 71 72 73 |
# File 'lib/sparkler/generators/app_generator.rb', line 68 def setup_foundation say 'Generating Foundation' build :setup_foundation build :add_foundation_to_application build :create_application_layout end |
#setup_git ⇒ Object
92 93 94 95 96 97 |
# File 'lib/sparkler/generators/app_generator.rb', line 92 def setup_git say 'Initalizing git repo' build :setup_gitignore build :init_git build :ignore_local_postgres if [:local_database] end |
#setup_rspec ⇒ Object
119 120 121 122 |
# File 'lib/sparkler/generators/app_generator.rb', line 119 def setup_rspec say 'Configuring Rspec' build :configure_rspec end |
#setup_scripts ⇒ Object
99 100 101 102 |
# File 'lib/sparkler/generators/app_generator.rb', line 99 def setup_scripts say 'Adding convenience scripts' build :setup_scripts end |
#setup_sentry ⇒ Object
75 76 77 78 |
# File 'lib/sparkler/generators/app_generator.rb', line 75 def setup_sentry say 'Configuring Sentry' build :setup_sentry end |
#setup_spring ⇒ Object
104 105 106 107 |
# File 'lib/sparkler/generators/app_generator.rb', line 104 def setup_spring say 'Setting up Spring binstubs' build :use_spring_binstubs end |
#setup_staging_environment ⇒ Object
54 55 56 57 |
# File 'lib/sparkler/generators/app_generator.rb', line 54 def setup_staging_environment say 'Setting up the staging environment' build :setup_staging_environment end |
#sparkler_customization ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/sparkler/generators/app_generator.rb', line 15 def sparkler_customization invoke :configure_generators invoke :customize_gemfile invoke :setup_database invoke :remove_useless_files invoke :remove_routes_comment_lines invoke :setup_staging_environment invoke :create_views_and_layouts invoke :copy_miscellaneous_files invoke :setup_foundation invoke :use_coffeescript invoke :setup_sentry invoke :setup_env invoke :setup_rspec invoke :setup_git invoke :setup_scripts invoke :setup_spring end |
#use_coffeescript ⇒ Object
34 35 36 |
# File 'lib/sparkler/generators/app_generator.rb', line 34 def use_coffeescript build :use_coffeescript end |