Class: Testcloud::Generator::Commands::UseCase
- Defined in:
- lib/testcloud/generator/commands/use_case.rb
Instance Attribute Summary
Attributes inherited from Base
#options, #parsed_options, #template_options, #thor
Instance Method Summary collapse
Methods inherited from Base
#abort_command, #confirmation_prompt, #initialize, #readline, #run
Constructor Details
This class inherits a constructor from Testcloud::Generator::Commands::Base
Instance Method Details
#execute_command ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/testcloud/generator/commands/use_case.rb', line 5 def execute_command spec = find_gemspec_for(Dir.pwd) = (spec) = () target = File.join(Dir.pwd, 'lib', [:path_name]) puts target @template_options = { spec: , use_case: } = @template_options templates = { 'use_cases/new_use_case.rb.tt' => "use_cases/#{[:underscore_name]}.rb", 'use_cases/new_params.rb.tt' => "params/#{[:params_underscore_name]}.rb" } thor.template('use_case/new_use_case.rb.tt', File.join(target, templates['use_cases/new_use_case.rb.tt']), ) thor.template('use_case/new_params.rb.tt', File.join(target, templates['use_cases/new_params.rb.tt']), ) end |