Class: Webhukhs::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
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

Instance Method Details

#copy_filesvoid

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_filevoid

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