Class: Mechanic::EngineGenerator
- Inherits:
-
Rails::Generators::PluginNewGenerator
- Object
- Rails::Generators::PluginNewGenerator
- Mechanic::EngineGenerator
- Defined in:
- lib/mechanic/generators/engine_generator.rb
Instance Method Summary collapse
- #call_the_mechanic ⇒ Object
- #configure_engine ⇒ Object
- #create_github_repo ⇒ Object
- #customize_gemspec ⇒ Object
- #finish_template ⇒ Object
- #init_git ⇒ Object
- #run_bundle ⇒ Object
- #setup_development_environment ⇒ Object
- #setup_git ⇒ Object
- #setup_gitignore ⇒ Object
- #setup_test_database ⇒ Object
- #wrap_up ⇒ Object
Instance Method Details
#call_the_mechanic ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/mechanic/generators/engine_generator.rb', line 27 def call_the_mechanic invoke :setup_development_environment invoke :customize_gemspec invoke :setup_test_database invoke :configure_engine invoke :setup_git invoke :create_github_repo invoke :wrap_up end |
#configure_engine ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/mechanic/generators/engine_generator.rb', line 62 def configure_engine say 'Configuring engine' build :configure_action_mailer build :generate_rspec build :configure_time_zone if [:webkit] build :configure_capybara_webkit end build :add_email_validator build :setup_default_rake_task end |
#create_github_repo ⇒ Object
82 83 84 85 86 87 |
# File 'lib/mechanic/generators/engine_generator.rb', line 82 def create_github_repo if [:github] say 'Creating Github repo' build :create_github_repo, [:github] end end |
#customize_gemspec ⇒ Object
42 43 44 45 46 47 48 49 50 |
# File 'lib/mechanic/generators/engine_generator.rb', line 42 def customize_gemspec build :add_custom_gems if [:webkit] build :add_capybara_webkit_gem end bundle_command 'install' end |
#finish_template ⇒ Object
22 23 24 25 |
# File 'lib/mechanic/generators/engine_generator.rb', line 22 def finish_template invoke :call_the_mechanic super end |
#init_git ⇒ Object
97 98 99 |
# File 'lib/mechanic/generators/engine_generator.rb', line 97 def init_git build :init_git end |
#run_bundle ⇒ Object
101 102 103 |
# File 'lib/mechanic/generators/engine_generator.rb', line 101 def run_bundle # Let's not: We'll bundle manually at the right spot end |
#setup_development_environment ⇒ Object
37 38 39 40 |
# File 'lib/mechanic/generators/engine_generator.rb', line 37 def setup_development_environment say 'Setting up the development environment' build :raise_delivery_errors end |
#setup_git ⇒ Object
76 77 78 79 80 |
# File 'lib/mechanic/generators/engine_generator.rb', line 76 def setup_git say 'Initializing git' invoke :setup_gitignore invoke :init_git end |
#setup_gitignore ⇒ Object
93 94 95 |
# File 'lib/mechanic/generators/engine_generator.rb', line 93 def setup_gitignore build :gitignore_files end |
#setup_test_database ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'lib/mechanic/generators/engine_generator.rb', line 52 def setup_test_database say 'Setting up database in spec/dummy' if 'postgresql' == [:database] build :use_postgres_config_template end build :create_database end |
#wrap_up ⇒ Object
89 90 91 |
# File 'lib/mechanic/generators/engine_generator.rb', line 89 def wrap_up say 'Congratulations! Your trip to shop was a success.' end |