Module: Bibliothecary::MultiParsers::JSONRuntime

Included in:
Parsers::Dub, Parsers::Elm, Parsers::Haxelib, Parsers::Meteor, Parsers::Nuget
Defined in:
lib/bibliothecary/multi_parsers/json_runtime.rb

Overview

Provide JSON Runtime Manifest parsing

Instance Method Summary collapse

Instance Method Details

#parse_json_runtime_manifest(file_contents, options: {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/bibliothecary/multi_parsers/json_runtime.rb', line 5

def parse_json_runtime_manifest(file_contents, options: {})
  JSON.parse(file_contents).fetch('dependencies',[]).map do |name, requirement|
    {
      name: name,
      requirement: requirement,
      type: 'runtime'
    }
  end
end