Class: Woods::Generators::InstallGenerator

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

Overview

Rails generator that installs Woods into a Rails application.

Usage:

rails generate woods:install

Creates:

config/initializers/woods.rb        — annotated configuration file
db/migrate/<ts>_create_woods_tables.rb — migration for Woods tables

The migration creates woods_units, woods_edges, and woods_embeddings tables. Works with PostgreSQL, MySQL, and SQLite.

Instance Method Summary collapse

Instance Method Details

#create_initializer_filevoid

This method returns an undefined value.



28
29
30
# File 'lib/generators/woods/install_generator.rb', line 28

def create_initializer_file
  template 'woods.rb.tt', 'config/initializers/woods.rb'
end

#create_migration_filevoid

This method returns an undefined value.



33
34
35
36
37
38
# File 'lib/generators/woods/install_generator.rb', line 33

def create_migration_file
  migration_template(
    'create_woods_tables.rb.erb',
    'db/migrate/create_woods_tables.rb'
  )
end