module Bibliothecary::MultiParsers::JSONRuntime

Provide JSON Runtime Manifest parsing

Public Instance Methods

parse_json_runtime_manifest(file_contents, options: {}) click to toggle source
# File lib/bibliothecary/multi_parsers/json_runtime.rb, line 5
def parse_json_runtime_manifest(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
  JSON.parse(file_contents).fetch("dependencies",[]).map do |name, requirement|
    Dependency.new(
      name: name,
      requirement: requirement,
      type: "runtime",
    )
  end
end