class Bibliothecary::Parsers::Elm

Public Class Methods

mapping() click to toggle source
# File lib/bibliothecary/parsers/elm.rb, line 9
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
parse_json_lock(file_contents, options: {}) click to toggle source
# File lib/bibliothecary/parsers/elm.rb, line 24
def self.parse_json_lock(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
  manifest = JSON.parse file_contents
  manifest.map do |name, requirement|
    Dependency.new(
      name: name,
      requirement: requirement,
      type: "runtime",
    )
  end
end