Sha256: 38193ca7ac1105f199be31882302aefb57e4636df795cfeb2d74f357cee22ac5

Contents?: true

Size: 550 Bytes

Versions: 6

Compression:

Stored size: 550 Bytes

Contents

# frozen_string_literal: true

require "core"

module Pennyworth
  module Integrations
    module RubyGems
      # Provides low-level API access to the RubyGems API.
      class Client
        include Import[:configuration, :http]

        def get endpoint
          http.get("#{configuration.ruby_gems_api_url}/#{endpoint}")
              .then do |response|
                return JSON response.body.to_s, symbolize_names: true if response.status.success?

                Core::EMPTY_HASH
              end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pennyworth-15.4.1 lib/pennyworth/integrations/ruby_gems/client.rb
pennyworth-15.4.0 lib/pennyworth/integrations/ruby_gems/client.rb
pennyworth-15.3.0 lib/pennyworth/integrations/ruby_gems/client.rb
pennyworth-15.2.0 lib/pennyworth/integrations/ruby_gems/client.rb
pennyworth-15.1.1 lib/pennyworth/integrations/ruby_gems/client.rb
pennyworth-15.1.0 lib/pennyworth/integrations/ruby_gems/client.rb