Sha256: 60e24c9c4806d5838006b69b5aa15fa16fd6b2c103548265721a9be0fd5bedfc

Contents?: true

Size: 510 Bytes

Versions: 5

Compression:

Stored size: 510 Bytes

Contents

# frozen_string_literal: true

# Generator for new particles.
class CommonGenerator < Rails::Generators::NamedBase
  class_option :spec, type: :boolean, default: true

  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
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
laminar-rails-0.4.2 lib/generators/common_generator.rb
laminar-rails-0.4.1 lib/generators/common_generator.rb
laminar-rails-0.4.0 lib/generators/common_generator.rb
laminar-rails-0.3.0 lib/generators/common_generator.rb
laminar-rails-0.2.0 lib/generators/common_generator.rb