Sha256: 400b5bffaab763040b91aaad1869d840fe9f1f5cbd834e58c032666e6f054bfb

Contents?: true

Size: 604 Bytes

Versions: 13

Compression:

Stored size: 604 Bytes

Contents

# frozen_string_literal: true

require "sod"

module Pragmater
  module CLI
    module Commands
      # Inserts pragmas.
      class Insert < Sod::Command
        include Import[:input, :kernel]

        handle "insert"

        description "Insert pragma comments."

        on Actions::Root
        on Actions::Comment
        on Actions::Pattern

        def initialize(handler: Inserter.new, **)
          super(**)
          @handler = handler
        end

        def call = handler.call(input) { |path| kernel.puts path }

        private

        attr_reader :handler
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
pragmater-14.6.0 lib/pragmater/cli/commands/insert.rb
pragmater-14.4.0 lib/pragmater/cli/commands/insert.rb
pragmater-14.3.0 lib/pragmater/cli/commands/insert.rb
pragmater-14.2.0 lib/pragmater/cli/commands/insert.rb
pragmater-14.1.1 lib/pragmater/cli/commands/insert.rb
pragmater-14.1.0 lib/pragmater/cli/commands/insert.rb
pragmater-14.0.0 lib/pragmater/cli/commands/insert.rb
pragmater-13.2.1 lib/pragmater/cli/commands/insert.rb
pragmater-13.2.0 lib/pragmater/cli/commands/insert.rb
pragmater-13.1.0 lib/pragmater/cli/commands/insert.rb
pragmater-13.0.3 lib/pragmater/cli/commands/insert.rb
pragmater-13.0.2 lib/pragmater/cli/commands/insert.rb
pragmater-13.0.1 lib/pragmater/cli/commands/insert.rb