Class: CommonGenerator

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

Overview

Generator for new particles.

Instance Method Summary collapse

Instance Method Details

#generateObject



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/common_generator.rb', line 7

def generate
  self.class.source_root(File.expand_path('templates', __dir__))

  template "#{self.class.generator_name}.erb",
           File.join('app/flows', class_path, "#{file_name}.rb")

  return unless options[:spec]

  template 'spec.erb',
           File.join('spec/flows', class_path, "#{file_name}_spec.rb")
end