Sha256: f5ac3ea8683482de003930a17647a14f4997dfafc7bc8e652ceb64f0589b5fa2

Contents?: true

Size: 434 Bytes

Versions: 8

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

8 entries across 8 versions & 1 rubygems

Version Path
bibliothecary-6.4.0 lib/sdl_parser.rb
bibliothecary-6.3.2 lib/sdl_parser.rb
bibliothecary-6.3.1 lib/sdl_parser.rb
bibliothecary-6.3.0 lib/sdl_parser.rb
bibliothecary-6.2.1 lib/sdl_parser.rb
bibliothecary-6.2.0 lib/sdl_parser.rb
bibliothecary-6.1.0 lib/sdl_parser.rb
bibliothecary-6.0.0 lib/sdl_parser.rb