Sha256: 3d58c7c84a89b5d131f1f803da393aca3fe9a41bc6d2fec0f7f700d3c8a4f658

Contents?: true

Size: 703 Bytes

Versions: 2

Compression:

Stored size: 703 Bytes

Contents

# frozen_string_literal: true

# Backward compatibility for gem specification lookup
# @see Gem::SourceIndex
module YARD
  module GemIndex
    module_function

    def find_all_by_name(*args)
      if defined?(Gem::Specification) && Gem::Specification.respond_to?(:find_all_by_name)
        Gem::Specification.find_all_by_name(*args)
      else
        Gem.source_index.find_name(*args)
      end
    end

    def each(&block)
      if defined?(Gem::Specification) && Gem::Specification.respond_to?(:each)
        Gem::Specification.each(&block)
      else
        Gem.source_index.find_name('').each(&block)
      end
    end

    def all
      each.to_a
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
yard-0.9.18 lib/yard/gem_index.rb
yard-0.9.17 lib/yard/gem_index.rb