Sha256: 0e7b8f370334ce2ea7350d421b34d5347892885ff3ef95c1ea14738a15097ddb

Contents?: true

Size: 557 Bytes

Versions: 10

Compression:

Stored size: 557 Bytes

Contents

# frozen_string_literal: true

require "sod"

module Pennyworth
  module CLI
    module Actions
      # Handles the text action.
      class Text < Sod::Action
        include Import[:io]

        description "Render Alfred text script filter."

        on "--text", argument: "CONTENT"

        def initialize(processor: Processor.for_text, **)
          super(**)
          @processor = processor
        end

        def call(content) = io.puts processor.call(content).to_json

        private

        attr_reader :processor
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pennyworth-17.8.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.7.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.6.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.5.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.4.1 lib/pennyworth/cli/actions/text.rb
pennyworth-17.4.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.3.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.2.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.1.0 lib/pennyworth/cli/actions/text.rb
pennyworth-17.0.0 lib/pennyworth/cli/actions/text.rb