Sha256: 6799d283a9b7c4d49a1bcaf38626aafe2925472d09192d03d56bcda9a4c18d3c

Contents?: true

Size: 690 Bytes

Versions: 12

Compression:

Stored size: 690 Bytes

Contents

require_relative '../setup/setup_generator.rb'

module Service
  module Generators
    class MicroGenerator < Rails::Generators::NamedBase
      source_root File.expand_path('templates', __dir__)

      argument :micros, type: :array, default: [], banner: 'micros micros'

      def setup
        invoke Service::Generators::SetupGenerator, [name]
      end

      def create_micros
        micros.each do |m|
          @micro = m.classify

          path = "app/services/#{service_name}/usecases/micros/#{m.underscore}.rb"
          template 'micro.rb.erb', path
        end
      end

      private

      def service_name
        "#{name.underscore}_service"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
command_service_object-1.1.1 lib/generators/service/micro/micro_generator.rb
command_service_object-1.1.0 lib/generators/service/micro/micro_generator.rb
command_service_object-1.0.0 lib/generators/service/micro/micro_generator.rb
command_service_object-0.6.5 lib/generators/service/micro/micro_generator.rb
command_service_object-0.6.4 lib/generators/service/micro/micro_generator.rb
command_service_object-0.6.3 lib/generators/service/micro/micro_generator.rb
command_service_object-0.6.2 lib/generators/service/micro/micro_generator.rb
command_service_object-0.6.1 lib/generators/service/micro/micro_generator.rb
command_service_object-0.6.0 lib/generators/service/micro/micro_generator.rb
command_service_object-0.5.11 lib/generators/service/micro/micro_generator.rb
command_service_object-0.5.10 lib/generators/service/micro/micro_generator.rb
command_service_object-0.5.9 lib/generators/service/micro/micro_generator.rb