Class: Lotus::CliSubCommands::Generate Private

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/lotus/cli_sub_commands/generate.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A set of generator subcommands

It is run with:

`bundle exec lotus generate`

Since:

  • 0.6.0

Instance Method Summary collapse

Instance Method Details

#actions(application_name = nil, controller_and_action_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0



39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/lotus/cli_sub_commands/generate.rb', line 39

def actions(application_name = nil, controller_and_action_name)
  if Lotus::Environment.new(options).container? && application_name.nil?
    msg = "ERROR: \"lotus generate action\" was called with arguments [\"#{controller_and_action_name}\"]\n" \
          "Usage: \"lotus action APPLICATION_NAME CONTROLLER_NAME#ACTION_NAME\""
    fail Error, msg
  end

  if options[:help]
    invoke :help, ['action']
  else
    Lotus::Commands::Generate::Action.new(options, application_name, controller_and_action_name).start
  end
end

#app(application_name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0



117
118
119
120
121
122
123
124
# File 'lib/lotus/cli_sub_commands/generate.rb', line 117

def app(application_name)
  if options[:help]
    invoke :help, ['app']
  else
    require 'lotus/commands/generate/app'
    Lotus::Commands::Generate::App.new(options, application_name).start
  end
end

#mailer(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0



98
99
100
101
102
103
104
# File 'lib/lotus/cli_sub_commands/generate.rb', line 98

def mailer(name)
  if options[:help]
    invoke :help, ['mailer']
  else
    Lotus::Commands::Generate::Mailer.new(options, name).start
  end
end

#migration(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0



59
60
61
62
63
64
65
66
# File 'lib/lotus/cli_sub_commands/generate.rb', line 59

def migration(name)
  if options[:help]
    invoke :help, ['migration']
  else
    require 'lotus/commands/generate/migration'
    Lotus::Commands::Generate::Migration.new(options, name).start
  end
end

#model(name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.6.0



79
80
81
82
83
84
85
86
# File 'lib/lotus/cli_sub_commands/generate.rb', line 79

def model(name)
  if options[:help]
    invoke :help, ['model']
  else
    require 'lotus/commands/generate/model'
    Lotus::Commands::Generate::Model.new(options, name).start
  end
end