Module: Bibliothecary::ParserMixins::JSONRuntime
- Included in:
- Bibliothecary::Parsers::Dub, Bibliothecary::Parsers::Elm, Bibliothecary::Parsers::Haxelib, Bibliothecary::Parsers::Meteor, Bibliothecary::Parsers::Nuget
- Defined in:
- lib/bibliothecary/parser_mixins/json_runtime.rb
Overview
Provide JSON Runtime Manifest parsing
Instance Method Summary collapse
Instance Method Details
#parse_json_runtime_manifest(file_contents, options: {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/bibliothecary/parser_mixins/json_runtime.rb', line 7 def parse_json_runtime_manifest(file_contents, options: {}) dependencies = JSON.parse(file_contents).fetch("dependencies", []).map do |name, requirement| Dependency.new( platform: platform_name, name: name, requirement: requirement, type: "runtime", source: .fetch(:filename, nil) ) end ParserResult.new(dependencies: dependencies) end |