Sha256: 767d5be3f916e69cf5633cf5310981be1caa2cfc891bbb2c9459dca0a68d16df

Contents?: true

Size: 713 Bytes

Versions: 35

Compression:

Stored size: 713 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

      add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)

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

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
bibliothecary-8.7.4 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.3 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.2 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.6.5 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.6.4 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.6.3 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.6.2 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.6.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.6.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.5.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.5.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.6 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.5 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.4 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.3 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.2 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.4.0 lib/bibliothecary/parsers/dub.rb