Class: Wicked::Pipeline::StepGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Includes:
Generators::Helpers
Defined in:
lib/generators/wicked/pipeline/step/step_generator.rb

Instance Method Summary collapse

Methods included from Generators::Helpers

#available_locales, #hashify_locale_keypath, #indented, #options_as_switches, #remove_possible_suffix

Instance Method Details

#create_locale_fileObject



25
26
27
28
29
30
31
32
33
34
# File 'lib/generators/wicked/pipeline/step/step_generator.rb', line 25

def create_locale_file
  return if options[:skip_locales]

  @structure = hashify_locale_keypath([*class_path, "#{file_name}_step"].join("."))

  available_locales.each do |locale|
    @locale = locale
    template "locale.yml", File.join("config/locales/steps", class_path, "#{file_name}_step.#{locale}.yml")
  end
end

#create_step_fileObject



19
20
21
# File 'lib/generators/wicked/pipeline/step/step_generator.rb', line 19

def create_step_file
  template "step.rb", File.join("app/steps", class_path, "#{file_name}_step.rb")
end