Class: Flashee::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Flashee::Generators::InstallGenerator
- Defined in:
- lib/generators/flashee/install_generator.rb
Overview
Houses the logic to install flashee into the target rails app. InstallGenerator translates to the ‘flashee:install` command.
Instance Method Summary collapse
-
#create_helper ⇒ Object
Creates basic mode helper.
-
#create_partial ⇒ Object
Creates basic mode view partial.
-
#print_post_install_info ⇒ Object
After installation completes, print the ERB snippet to the command line.
Instance Method Details
#create_helper ⇒ Object
Creates basic mode helper.
8 9 10 11 12 |
# File 'lib/generators/flashee/install_generator.rb', line 8 def create_helper @helper_file = Builders.helper_builder "basic" helper_target_path = File.join(Rails.root, "app", "helpers", "flashee_helper.rb") Builders.file_builder helper_target_path, @helper_file end |
#create_partial ⇒ Object
Creates basic mode view partial
15 16 17 |
# File 'lib/generators/flashee/install_generator.rb', line 15 def create_partial Builders.view_builder "basic" end |
#print_post_install_info ⇒ Object
After installation completes, print the ERB snippet to the command line.
20 21 22 23 24 25 26 27 28 |
# File 'lib/generators/flashee/install_generator.rb', line 20 def print_post_install_info puts "===================================================================" puts "# One more step to go, To render the #" puts "# flash messages, you will need to add #" puts "# this line to application.html.erb. #" puts "# #" puts '# <%= render partial: "partials/flash_messages", flash: flash %> #' puts "===================================================================" end |