Class: ActiveEndpoint::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/active_endpoint/install_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(_dirname) ⇒ Object



9
10
11
# File 'lib/generators/active_endpoint/install_generator.rb', line 9

def next_migration_number(_dirname)
  Time.current.strftime('%Y%m%d%H%M%S')
end

Instance Method Details

#copy_initializer_fileObject



16
17
18
19
# File 'lib/generators/active_endpoint/install_generator.rb', line 16

def copy_initializer_file
  puts '=> Copy initializer file to config/initializers/active_endpoint.rb'
  copy_file 'active_endpoint.rb', 'config/initializers/active_endpoint.rb'
end

#copy_migration_fileObject



21
22
23
24
25
# File 'lib/generators/active_endpoint/install_generator.rb', line 21

def copy_migration_file
  puts '=> Create migration file in db/migrate/***_create_active_endpoint_probes.rb'
  migration_template 'migration.erb', 'db/migrate/create_active_endpoint_probes.rb',
                     migration_version: migration_version
end