Sha256: cc159b95425c3a86ee841689154a52ae8f3919d41defec94bc8b2252e72f155d

Contents?: true

Size: 680 Bytes

Versions: 83

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

class Gem::Resolver::APISet::GemParser
  def parse(line)
    version_and_platform, rest = line.split(" ", 2)
    version, platform = version_and_platform.split("-", 2)
    dependencies, requirements = rest.split("|", 2).map {|s| s.split(",") } if rest
    dependencies = dependencies ? dependencies.map {|d| parse_dependency(d) } : []
    requirements = requirements ? requirements.map {|d| parse_dependency(d) } : []
    [version, platform, dependencies, requirements]
  end

  private

  def parse_dependency(string)
    dependency = string.split(":")
    dependency[-1] = dependency[-1].split("&") if dependency.size > 1
    dependency
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
rubygems-update-3.3.27 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.22 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.21 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.20 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.19 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.18 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.17 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.16 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.15 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.14 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.13 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.12 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.11 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.10 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.9 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.8 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.7 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.2.34 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.6 lib/rubygems/resolver/api_set/gem_parser.rb
rubygems-update-3.4.5 lib/rubygems/resolver/api_set/gem_parser.rb