Sha256: 0078d65003dc993832d7774c7803d44f990b0a59605db3977de5bf4c662f1a7a

Contents?: true

Size: 430 Bytes

Versions: 20

Compression:

Stored size: 430 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,
        version: dep.attribute('version') || ">= 0",
        type: type,
      })
    end.uniq
  end

  def parse
    SDL4R::read(contents)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
bibliothecary-5.6.2 lib/sdl_parser.rb
bibliothecary-5.6.1 lib/sdl_parser.rb
bibliothecary-5.6.0 lib/sdl_parser.rb
bibliothecary-5.5.5 lib/sdl_parser.rb
bibliothecary-5.5.4 lib/sdl_parser.rb
bibliothecary-5.5.3 lib/sdl_parser.rb
bibliothecary-5.5.2 lib/sdl_parser.rb
bibliothecary-5.5.1 lib/sdl_parser.rb
bibliothecary-5.5.0 lib/sdl_parser.rb
bibliothecary-5.4.0 lib/sdl_parser.rb
bibliothecary-5.3.4 lib/sdl_parser.rb
bibliothecary-5.3.3 lib/sdl_parser.rb
bibliothecary-5.3.2 lib/sdl_parser.rb
bibliothecary-5.3.1 lib/sdl_parser.rb
bibliothecary-5.3.0 lib/sdl_parser.rb
bibliothecary-5.2.0 lib/sdl_parser.rb
bibliothecary-5.1.0 lib/sdl_parser.rb
bibliothecary-5.0.2 lib/sdl_parser.rb
bibliothecary-5.0.1 lib/sdl_parser.rb
bibliothecary-5.0.0 lib/sdl_parser.rb