class Flashee::Generators::Install::BootstrapGenerator

Houses the logic to install flashee into the target rails app using the bootstrap CSS framework. BootstrapGenerator translates to the `flashee:install:bootstrap

Public Instance Methods

create_helper() click to toggle source

Creates bootstrap mode helper.

# File lib/generators/flashee/install/bootstrap_generator.rb, line 9
def create_helper
  @helper_file = Builders.helper_builder "bootstrap"
  helper_target_path = File.join(Rails.root, "app", "helpers", "flashee_helper.rb")

  Builders.file_builder helper_target_path, @helper_file
end
create_partial() click to toggle source

Creates bootstrap mode view partial

# File lib/generators/flashee/install/bootstrap_generator.rb, line 17
def create_partial
  Builders.view_builder "bootstrap"
end
print_post_install_info() click to toggle source

After installation completes, print the ERB snippet to the command line.

# File lib/generators/flashee/install/bootstrap_generator.rb, line 22
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