Sha256: d82dedaa0e1b865b7b98194402c0a493c686831a3b4fa5fc23b878740dc00fe8

Contents?: true

Size: 514 Bytes

Versions: 2

Compression:

Stored size: 514 Bytes

Contents

# frozen_string_literal: true

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

    def copy_files
      if behavior == :revoke
        template 'command_template.rb', "app/handlers/#{file_path}_handler/command.rb"
      elsif behavior == :invoke
        empty_directory Pathname.new('app/commands').join(*class_path)
        template 'command_template.rb', "app/handlers/#{file_path}_handler/command.rb"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
steel_wheel-0.6.1 lib/generators/steel_wheel/command/command_generator.rb
steel_wheel-0.6.0 lib/generators/steel_wheel/command/command_generator.rb