Sha256: f5b8b3768c9f22068de624fa6d04f0006ce2739b30aa1a6e55db8bea36497c4d

Contents?: true

Size: 543 Bytes

Versions: 2

Compression:

Stored size: 543 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Gems
    # Loads a gem's specification.
    class Loader
      def self.call(path, ...) = new(...).call path

      def initialize client: ::Gem::Specification, presenter: Gems::Presenter
        warn "[DEPRECATION]: Loader is deprecated, use Spek gem instead."

        @client = client
        @presenter = presenter
      end

      def call(path) = client.load(path.to_s).then { |record| presenter.new record }

      private

      attr_reader :client, :presenter
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-16.2.0 lib/gemsmith/gems/loader.rb
gemsmith-16.1.0 lib/gemsmith/gems/loader.rb