Class: Masks::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Masks::InstallGenerator
- Defined in:
- lib/generators/masks/install/install_generator.rb
Overview
Generator for rails g masks:install.
Instance Method Summary collapse
- #add_migrations ⇒ Object
- #add_routing ⇒ Object
- #copy_initializer_file ⇒ Object
- #copy_masks_json ⇒ Object
Instance Method Details
#add_migrations ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/generators/masks/install/install_generator.rb', line 20 def add_migrations if yes?("generate migrations for masks?") rails_command "masks:install:migrations" else puts puts 'run "rails masks:install:migrations" to add them later on...' end puts puts "[masks] welcome!" puts "[masks] visit https://masks.geiger.to for more information." end |
#add_routing ⇒ Object
8 9 10 |
# File 'lib/generators/masks/install/install_generator.rb', line 8 def add_routing route 'mount Masks::Engine => "/"' end |
#copy_initializer_file ⇒ Object
12 13 14 |
# File 'lib/generators/masks/install/install_generator.rb', line 12 def copy_initializer_file copy_file "initializer.rb", "config/initializers/masks.rb" end |
#copy_masks_json ⇒ Object
16 17 18 |
# File 'lib/generators/masks/install/install_generator.rb', line 16 def copy_masks_json copy_file "masks.json", "masks.json" end |