Sha256: 517295a258a5e95f39b53aa45a0a4f98d6d1ec6be8d7266cc98cd40be2f64886

Contents?: true

Size: 760 Bytes

Versions: 15

Compression:

Stored size: 760 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: {}) # rubocop:disable Lint/UnusedMethodArgument
        SdlParser.new(:runtime, file_contents).dependencies
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bibliothecary-12.0.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-11.0.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-11.0.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-10.2.4 lib/bibliothecary/parsers/dub.rb
bibliothecary-10.2.3 lib/bibliothecary/parsers/dub.rb
bibliothecary-10.2.2 lib/bibliothecary/parsers/dub.rb
bibliothecary-10.2.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-10.1.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-10.0.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-9.1.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-9.0.0 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.8.1 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.7 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.6 lib/bibliothecary/parsers/dub.rb
bibliothecary-8.7.5 lib/bibliothecary/parsers/dub.rb