Class: Soka::Generators::ToolGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/soka/tool/tool_generator.rb

Overview

Generator for creating new Soka tool classes with configurable parameters

Instance Method Summary collapse

Instance Method Details

#create_test_fileObject



21
22
23
24
25
26
27
28
29
# File 'lib/generators/soka/tool/tool_generator.rb', line 21

def create_test_file
  return unless rspec_installed?

  @tool_class_name = tool_class_name
  @params_list = parse_params

  template 'tool_spec.rb.tt',
           File.join('spec/soka/tools', class_path, "#{tool_file_name}_spec.rb")
end

#create_tool_fileObject



13
14
15
16
17
18
19
# File 'lib/generators/soka/tool/tool_generator.rb', line 13

def create_tool_file
  @tool_class_name = tool_class_name
  @params_list = parse_params

  template 'tool.rb.tt',
           File.join('app/soka/tools', class_path, "#{tool_file_name}.rb")
end