Class: Webhukhs::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Webhukhs::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/webhukhs/install_generator.rb
Overview
Rails generator used for setting up Webhukhs in a Rails application. Run it with bin/rails g webhukhs:install in your console.
Instance Method Summary collapse
-
#copy_files ⇒ void
Copies initializer file into host application.
-
#create_migration_file ⇒ void
Creates migration files required by Webhukhs tables.
Instance Method Details
#copy_files ⇒ void
This method returns an undefined value.
Copies initializer file into host application.
25 26 27 |
# File 'lib/webhukhs/install_generator.rb', line 25 def copy_files template "webhukhs.rb", File.join("config", "initializers", "webhukhs.rb") end |
#create_migration_file ⇒ void
This method returns an undefined value.
Creates migration files required by Webhukhs tables.
17 18 19 20 |
# File 'lib/webhukhs/install_generator.rb', line 17 def create_migration_file migration_template "create_webhukhs_tables.rb.erb", File.join(db_migrate_path, "create_webhukhs_tables.rb") migration_template "add_headers_to_webhukhs_webhooks.rb.erb", File.join(db_migrate_path, "add_headers_to_webhukhs_webhooks.rb") end |