Class: Livechat::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Livechat::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/livechat/install/install_generator.rb
Instance Method Summary collapse
- #create_initializer ⇒ Object
- #create_migration_file ⇒ Object
- #mount_engine ⇒ Object
- #post_install ⇒ Object
Instance Method Details
#create_initializer ⇒ Object
15 16 17 |
# File 'lib/generators/livechat/install/install_generator.rb', line 15 def create_initializer copy_file 'initializer.rb', 'config/initializers/livechat.rb' end |
#create_migration_file ⇒ Object
19 20 21 22 |
# File 'lib/generators/livechat/install/install_generator.rb', line 19 def create_migration_file migration_template 'create_livechat_tables.rb.tt', 'db/migrate/create_livechat_tables.rb' end |
#mount_engine ⇒ Object
24 25 26 |
# File 'lib/generators/livechat/install/install_generator.rb', line 24 def mount_engine route %(mount Livechat::Engine => "/livechat") end |
#post_install ⇒ Object
28 29 30 31 32 33 |
# File 'lib/generators/livechat/install/install_generator.rb', line 28 def post_install say "\nlivechat installed. Run `rails db:migrate`, then add", :green say '`<%= livechat_tag %>` before </body> in your layout.' say 'Answer visitors at /livechat (development only until you set config.authorize_agent).' say "Set config.mailer_from + config.agent_emails to hear about new messages by email.\n" end |