Sha256: 4ab6bd091f15e99316acc6e4ac6e4df9b7eb2b18bb526e9949b1ec7ab4314c44

Contents?: true

Size: 643 Bytes

Versions: 5

Compression:

Stored size: 643 Bytes

Contents

require 'json'
require 'sdl_parser'

module Bibliothecary
  module Parsers
    class Dub
      include Bibliothecary::Analyser
      extend Bibliothecary::MultiParsers::JSONRuntime

      def self.mapping
        {
          match_filename("dub.json") => {
            kind: 'manifest',
            parser: :parse_json_runtime_manifest
          },
          match_filename("dub.sdl") => {
            kind: 'manifest',
            parser: :parse_sdl_manifest
          }
        }
      end

      def self.parse_sdl_manifest(file_contents, options: {})
        SdlParser.new(:runtime, file_contents).dependencies
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bibliothecary-8.2.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.2.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.1.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.1.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.0.0 lib/bibliothecary/parsers/dub.rb