abstract class Marten::CLI::Generator
- Marten::CLI::Generator
- Reference
- Object
Overview
Abstract generator.
Generators are classes that operate in the context of the gen
management command. They can be leveraged to
generate new abstractions, structures, and files within an existing application.
Included Modules
Direct Known Subclasses
- Marten::CLI::Generator::App
- Marten::CLI::Generator::Email
- Marten::CLI::Generator::Handler
- Marten::CLI::Generator::Model
- Marten::CLI::Generator::Schema
- Marten::CLI::Generator::SecretKey
Defined in:
marten/cli/generator.crmarten/cli/generator/app.cr
marten/cli/generator/auth.cr
marten/cli/generator/email.cr
marten/cli/generator/email/context.cr
marten/cli/generator/email/templates.cr
marten/cli/generator/handler.cr
marten/cli/generator/handler/context.cr
marten/cli/generator/handler/templates.cr
marten/cli/generator/model.cr
marten/cli/generator/model/context.cr
marten/cli/generator/model/field_definition.cr
marten/cli/generator/model/field_definition/qualifier_renderer.cr
marten/cli/generator/model/templates.cr
marten/cli/generator/schema.cr
marten/cli/generator/schema/context.cr
marten/cli/generator/schema/field_definition.cr
marten/cli/generator/schema/templates.cr
marten/cli/generator/secret_key.cr
Constructors
Class Method Summary
-
.footer_description(footer_description : String | Symbol)
Allows to define a footer description that will be displayed after the generator usage help.
-
.footer_description
Returns the footer description of the generator.
-
.generator_name(name : String | Symbol)
Allows to set the name of the generator.
-
.generator_name
Returns the name of the considered generator.
-
.help(help : String)
Allows to set the help description of the generator.
-
.help
Returns the help description of the generator.
Instance Method Summary
-
#command : Marten::CLI::Manage::Command::Gen
Returns the command instance that is used to invoke the generator.
-
#create_app_files(app_config : Apps::Config, files : Array(Tuple(String, String)))
Creates the specified files under the passed application config.
-
#create_spec_files(files : Array(Tuple(String, String)))
Creates the specified files under the project's spec folder.
-
#print_warnings
Prints the warning messages that have been collected during the generator execution.
- #run : Nil
- #setup
-
#warnings : Array(String)
Returns an array of warning messages that should be printed at the end of the generator execution.
-
#warnings=(warnings : Array(String))
Allows to set the warning messages that should be printed at the end of the generator execution.
Constructor Detail
Class Method Detail
Allows to set the name of the generator.
The value set using this method will be used by users when they invoke the generator through the use of the
marten gen
management command.
Instance Method Detail
Returns the command instance that is used to invoke the generator.
Creates the specified files under the passed application config.
files
must be an array of tuples where the first element is the path of the file to create and the second
element is the content of the file.
Creates the specified files under the project's spec folder.
files
must be an array of tuples where the first element is the path of the file to create and the second
element is the content of the file.
Prints the warning messages that have been collected during the generator execution.
Returns an array of warning messages that should be printed at the end of the generator execution.
Allows to set the warning messages that should be printed at the end of the generator execution.