Sha256: 33d399009be40a4f2f735763df298bd252c258c9a563f7aac3a81846eaf2cea2

Contents?: true

Size: 434 Bytes

Versions: 6

Compression:

Stored size: 434 Bytes

Contents

require "sdl4r"

class SdlParser
  attr_reader :contents, :type
  def initialize(type, contents)
    @contents = contents
    @type = type || "runtime"
  end

  def dependencies
    parse.children("dependency").inject([]) do |deps, dep|
      deps.push({
        name: dep.value,
        requirement: dep.attribute("version") || ">= 0",
        type: type,
      })
    end.uniq
  end

  def parse
    SDL4R::read(contents)
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
bibliothecary-9.1.0 lib/sdl_parser.rb
bibliothecary-9.0.0 lib/sdl_parser.rb
bibliothecary-8.8.1 lib/sdl_parser.rb
bibliothecary-8.7.7 lib/sdl_parser.rb
bibliothecary-8.7.6 lib/sdl_parser.rb
bibliothecary-8.7.5 lib/sdl_parser.rb