Sha256: 85f132fed692534776fddc110cdad93906a2047e2487be40c08106964dac3a2a

Contents?: true

Size: 763 Bytes

Versions: 56

Compression:

Stored size: 763 Bytes

Contents

require 'json'

module Bibliothecary
  module Parsers
    class Elm
      include Bibliothecary::Analyser

      def self.mapping
        {
          match_filenames("elm-package.json", "elm_dependencies.json") => {
            kind: 'manifest',
            parser: :parse_json_runtime_manifest
          },
          match_filename("elm-stuff/exact-dependencies.json") => {
            kind: 'lockfile',
            parser: :parse_json_lock
          }
        }
      end

      def self.parse_json_lock(file_contents)
        manifest = JSON.parse file_contents
        manifest.map do |name, requirement|
          {
            name: name,
            requirement: requirement,
            type: 'runtime'
          }
        end
      end
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
bibliothecary-7.3.6 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.3.5 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.3.4 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.3.3 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.3.2 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.3.1 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.3.0 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.2.1 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.2.0 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.1.5 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.1.4 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.1.3 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.1.2 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.1.1 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.1.0 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.0.2 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.0.1 lib/bibliothecary/parsers/elm.rb
bibliothecary-7.0.0 lib/bibliothecary/parsers/elm.rb
bibliothecary-6.12.3 lib/bibliothecary/parsers/elm.rb
bibliothecary-6.12.2 lib/bibliothecary/parsers/elm.rb