Sha256: 61e9d748c3cab0f3f7b2b7bd1473dc10e75625ceeed3092df426267a1a0012ff
Contents?: true
Size: 625 Bytes
Versions: 16
Compression:
Stored size: 625 Bytes
Contents
require "yaml" class CompareLinker class GemDictionary attr_reader :file, :rubygems def initialize @file = File.join(__dir__, '../../data/rubygems.yml') end # Look gem info up from Dictionary # # @param gem_name [String] # @return [Array<String>] [repo_owner, repo_name] # @return [Array<NilClass>] cannot look up def lookup(gem_name) repo_full_name = rubygems[gem_name] if repo_full_name repo_full_name.split("/") else [nil, nil] end end private def rubygems @rubygems ||= YAML.load(IO.read(file)) end end end
Version data entries
16 entries across 16 versions & 1 rubygems