Class: Pfm::Command::GeneratorCommands::Base
- Defined in:
- lib/idlc-sdk-pfm/command/generator_commands/base.rb
Overview
## Base
Base class for ‘chef generate` subcommands. Contains basic behaviors for setting up the generator context, detecting git, and launching a chef converge.
The behavior of the generators is largely delegated to a chef cookbook. The default implementation is the ‘code_generator` cookbook in pfm/skeletons/code_generator.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
-
#initialize(params) ⇒ Base
constructor
A new instance of Base.
- #params_valid? ⇒ Boolean
- #read_and_validate_params ⇒ Object
- #setup_context ⇒ Object
Methods inherited from Base
#build_base_dir, #build_dir, #build_exists?, #build_setup, #deploy_setup, #deploy_setupv2, #inf_base_dir, #needs_help?, #needs_version?, #run_with_default_options, #templates_dir, #verbose?
Methods included from Helpers
debug, err, msg, system_command
Constructor Details
#initialize(params) ⇒ Base
Returns a new instance of Base.
22 23 24 25 26 27 |
# File 'lib/idlc-sdk-pfm/command/generator_commands/base.rb', line 22 def initialize(params) super() @params_valid = true @errors = [] @params = params end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
18 19 20 |
# File 'lib/idlc-sdk-pfm/command/generator_commands/base.rb', line 18 def errors @errors end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
17 18 19 |
# File 'lib/idlc-sdk-pfm/command/generator_commands/base.rb', line 17 def params @params end |
Instance Method Details
#params_valid? ⇒ Boolean
44 45 46 |
# File 'lib/idlc-sdk-pfm/command/generator_commands/base.rb', line 44 def params_valid? @params_valid end |
#read_and_validate_params ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/idlc-sdk-pfm/command/generator_commands/base.rb', line 32 def read_and_validate_params arguments = (params) case arguments.size when 1 when 2 else @params_valid = false end end |
#setup_context ⇒ Object
29 30 |
# File 'lib/idlc-sdk-pfm/command/generator_commands/base.rb', line 29 def setup_context end |