Sha256: 3e581bd9d16e2171dfedd19b51bef68fba46aa13bf93f87ab9f97f8b890ca505

Contents?: true

Size: 652 Bytes

Versions: 8

Compression:

Stored size: 652 Bytes

Contents

# frozen_string_literal: true

require "sod"

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

        description "Render Alfred RubyGems script filter."

        on "--gems", argument: "[HANDLE]"

        default { Container[:settings].ruby_gems_owner }

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

        def call(handle = default) = io.puts processor.call("owners/#{handle}/gems.json").to_json

        private

        attr_reader :processor
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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