Sha256: 88abcbc9d0a65d19a16be23e3a2c1e62ea46805b1435a364afa5fb031c936431

Contents?: true

Size: 732 Bytes

Versions: 8

Compression:

Stored size: 732 Bytes

Contents

# frozen_string_literal: true

require "sod"

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

        description "Render Alfred RubyGems script filter."

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

        default { Container[:configuration].ruby_gems_owner }

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

        def call handle = nil
          endpoint = "owners/#{handle || default}/gems.json"
          kernel.puts processor.call(endpoint).to_json
        end

        private

        attr_reader :processor
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
pennyworth-15.4.1 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.4.0 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.3.0 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.2.0 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.1.1 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.1.0 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.0.3 lib/pennyworth/cli/actions/ruby_gems.rb
pennyworth-15.0.2 lib/pennyworth/cli/actions/ruby_gems.rb