Sha256: af66fc5df492a7fade52527dba0040b6dbaf048438bb35021798e0929e07aa80
Contents?: true
Size: 815 Bytes
Versions: 14
Compression:
Stored size: 815 Bytes
Contents
require 'yaml' require 'json' module Bibliothecary module Parsers class CPAN include Bibliothecary::Analyser def self.mapping { /^META\.json$/i => { kind: 'manifest', parser: :parse_json_manifest }, /^META\.yml$/i => { kind: 'manifest', parser: :parse_yaml_manifest } } end def self.parse_json_manifest(file_contents) manifest = JSON.parse file_contents manifest['prereqs'].map do |_group, deps| map_dependencies(deps, 'requires', 'runtime') end.flatten end def self.parse_yaml_manifest(file_contents) manifest = YAML.load file_contents map_dependencies(manifest, 'requires', 'runtime') end end end end
Version data entries
14 entries across 14 versions & 1 rubygems