Class: Lotus::CliSubCommands::Generate Private
- Inherits:
-
Thor
- Object
- Thor
- Lotus::CliSubCommands::Generate
- 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`
Instance Method Summary collapse
- #actions(application_name = nil, controller_and_action_name) ⇒ Object private
- #app(application_name) ⇒ Object private
- #mailer(name) ⇒ Object private
- #migration(name) ⇒ Object private
- #model(name) ⇒ Object private
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.
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().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 [:help] invoke :help, ['action'] else Lotus::Commands::Generate::Action.new(, 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.
117 118 119 120 121 122 123 124 |
# File 'lib/lotus/cli_sub_commands/generate.rb', line 117 def app(application_name) if [:help] invoke :help, ['app'] else require 'lotus/commands/generate/app' Lotus::Commands::Generate::App.new(, 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.
98 99 100 101 102 103 104 |
# File 'lib/lotus/cli_sub_commands/generate.rb', line 98 def mailer(name) if [:help] invoke :help, ['mailer'] else Lotus::Commands::Generate::Mailer.new(, 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.
59 60 61 62 63 64 65 66 |
# File 'lib/lotus/cli_sub_commands/generate.rb', line 59 def migration(name) if [:help] invoke :help, ['migration'] else require 'lotus/commands/generate/migration' Lotus::Commands::Generate::Migration.new(, 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.
79 80 81 82 83 84 85 86 |
# File 'lib/lotus/cli_sub_commands/generate.rb', line 79 def model(name) if [:help] invoke :help, ['model'] else require 'lotus/commands/generate/model' Lotus::Commands::Generate::Model.new(, name).start end end |