123456789_123456789_123456789_123456789_123456789_

Class: ActionMailbox::Generators::InstallGenerator

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, ::Rails::Generators::Base, Thor::Group
Instance Chain:
self, ::Rails::Generators::Base, ::Rails::Generators::Actions, Thor::Actions, Thor::Group
Inherits: Rails::Generators::Base
Defined in: actionmailbox/lib/generators/action_mailbox/install/install_generator.rb

Class Method Summary

::Rails::Generators::Base - Inherited

.base_root

Returns the base root for a common set of generators.

.default_source_root

Returns the default source root for a given generator.

.desc

Tries to get the description from a USAGE file one folder above the source root otherwise uses a default description.

.hide!

Convenience method to hide this generator from the available ones when running rails generator command.

.hook_for

Invoke a generator based on the value supplied by the user to the given option named “name”.

.namespace

Convenience method to get the namespace from the class name.

.remove_hook_for

Remove a previously added hook.

.source_root

Returns the source root for this generator using default_source_root as default.

Instance Method Summary

::Rails::Generators::Actions - Included

#add_source

Add the given source to Gemfile

#application
#environment

Adds configuration code to a Rails runtime environment.

#gem

Adds a gem declaration to the Gemfile for the specified gem.

#gem_group

Wraps gem entries inside a group.

#generate

Runs another generator.

#git

Runs one or more git commands.

#github,
#initializer

Creates an initializer file in config/initializers/.

#lib

Creates a file in lib/.

#rails_command

Runs the specified Rails command.

#rake

Runs the specified Rake task.

#rakefile

Creates a Rake tasks file in lib/tasks/.

#readme

Reads the given file at the source root and prints it in the console.

#route

Make an entry in Rails routing file config/routes.rb.

#vendor

Creates a file in vendor/.

Instance Method Details

#add_action_mailbox_production_environment_config

[ GitHub ]

  
# File 'actionmailbox/lib/generators/action_mailbox/install/install_generator.rb', line 15

def add_action_mailbox_production_environment_config
  environment <<~end_of_config, env: "production"
    # Prepare the ingress controller used to receive mail
    # config.action_mailbox.ingress = :relay

  end_of_config
end

#create_action_mailbox_files

[ GitHub ]

  
# File 'actionmailbox/lib/generators/action_mailbox/install/install_generator.rb', line 10

def create_action_mailbox_files
  say "Copying application_mailbox.rb to app/mailboxes", :green
  template "application_mailbox.rb", "app/mailboxes/application_mailbox.rb"
end

#create_migrations

[ GitHub ]

  
# File 'actionmailbox/lib/generators/action_mailbox/install/install_generator.rb', line 23

def create_migrations
  rails_command "railties:install:migrations FROM=active_storage,action_mailbox", inline: true
end