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.3.9 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.8 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.7 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.6 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.5 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.4 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.3 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.2 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.3.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.2.6 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.2.5 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.2.4 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.2.3 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.2.2 lib/bibliothecary/parsers/dub.rb