Sha256: 9fad09cfb9999f250dbdc936290e9f36bf15d092582ce3b110de9061293c6bb4
Contents?: true
Size: 781 Bytes
Versions: 16
Compression:
Stored size: 781 Bytes
Contents
require_relative '../setup/setup_generator.rb' module Service module Generators class CommandGenerator < Rails::Generators::NamedBase include CommandServiceObject::ModelHelper source_root File.expand_path('templates', __dir__) argument :commands, type: :array, default: [], banner: 'command command' def call invoke Service::Generators::SetupGenerator, [name] @model_attributes = model_attributes commands.each do |c| @command = c.classify path = "app/services/#{service_name}/commands/#{c.underscore}.rb" template 'command.rb.erb', path unless options.skip_command? end end private def service_name "#{name.underscore}_service" end end end end
Version data entries
16 entries across 16 versions & 1 rubygems