Sha256: 4a8b4e356434548610c80a4e00ae7baf4939eed6be9587c5698c5e6953a4aca7

Contents?: true

Size: 565 Bytes

Versions: 17

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

require "sod"

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

        description "Render Alfred text script filter."

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

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

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

        private

        attr_reader :processor
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
pennyworth-16.7.0 lib/pennyworth/cli/actions/text.rb
pennyworth-16.5.0 lib/pennyworth/cli/actions/text.rb
pennyworth-16.4.0 lib/pennyworth/cli/actions/text.rb
pennyworth-16.3.0 lib/pennyworth/cli/actions/text.rb
pennyworth-16.2.0 lib/pennyworth/cli/actions/text.rb
pennyworth-16.1.0 lib/pennyworth/cli/actions/text.rb
pennyworth-16.0.0 lib/pennyworth/cli/actions/text.rb
pennyworth-15.4.1 lib/pennyworth/cli/actions/text.rb
pennyworth-15.4.0 lib/pennyworth/cli/actions/text.rb
pennyworth-15.3.0 lib/pennyworth/cli/actions/text.rb
pennyworth-15.2.0 lib/pennyworth/cli/actions/text.rb
pennyworth-15.1.1 lib/pennyworth/cli/actions/text.rb
pennyworth-15.1.0 lib/pennyworth/cli/actions/text.rb
pennyworth-15.0.3 lib/pennyworth/cli/actions/text.rb
pennyworth-15.0.2 lib/pennyworth/cli/actions/text.rb
pennyworth-15.0.1 lib/pennyworth/cli/actions/text.rb
pennyworth-15.0.0 lib/pennyworth/cli/actions/text.rb