Class: SmSmsCampaignWebhook::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SmSmsCampaignWebhook::Generators::InstallGenerator
- Defined in:
- lib/generators/sm_sms_campaign_webhook/install/install_generator.rb
Overview
Installs files to prep an app for SMS campaign webhook.
Instance Method Summary collapse
-
#add_mount_path ⇒ Object
Mount engine to path in config/routes.rb.
-
#copy_initializer ⇒ Object
Copy initializer template to config/initializers.
-
#copy_processor ⇒ Object
Copy processor template to app/processors.
-
#show_readme ⇒ Object
Dump the README for the app developer.
Instance Method Details
#add_mount_path ⇒ Object
Mount engine to path in config/routes.rb
23 24 25 26 27 |
# File 'lib/generators/sm_sms_campaign_webhook/install/install_generator.rb', line 23 def add_mount_path insert_into_file "config/routes.rb", " mount SmSmsCampaignWebhook::Engine => \"/sms_campaign\"\n", after: "Rails.application.routes.draw do\n" end |
#copy_initializer ⇒ Object
Copy initializer template to config/initializers
13 14 15 |
# File 'lib/generators/sm_sms_campaign_webhook/install/install_generator.rb', line 13 def copy_initializer template "sm_sms_campaign_webhook.rb", "config/initializers/sm_sms_campaign_webhook.rb" end |
#copy_processor ⇒ Object
Copy processor template to app/processors
18 19 20 |
# File 'lib/generators/sm_sms_campaign_webhook/install/install_generator.rb', line 18 def copy_processor template "sms_payload_processor.rb.erb", "app/processors/sms_payload_processor.rb" end |
#show_readme ⇒ Object
Dump the README for the app developer
30 31 32 |
# File 'lib/generators/sm_sms_campaign_webhook/install/install_generator.rb', line 30 def show_readme readme "README" if behavior == :invoke end |