class Bibliothecary::Parsers::Shard
Public Class Methods
map_dependencies(hash, key, type)
click to toggle source
# File lib/bibliothecary/parsers/shard.rb, line 34 def self.map_dependencies(hash, key, type) hash.fetch(key,[]).map do |name, requirement| Dependency.new( name: name, requirement: requirement["version"], type: type, ) end end
mapping()
click to toggle source
# File lib/bibliothecary/parsers/shard.rb, line 8 def self.mapping { match_filename("shard.yml", case_insensitive: true) => { kind: "manifest", parser: :parse_yaml_manifest, }, match_filename("shard.lock", case_insensitive: true) => { kind: "lockfile", parser: :parse_yaml_lockfile, }, } end
parse_yaml_lockfile(file_contents, options: {})
click to toggle source
# File lib/bibliothecary/parsers/shard.rb, line 23 def self.parse_yaml_lockfile(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument manifest = YAML.load file_contents map_dependencies(manifest, "shards", "runtime") end
parse_yaml_manifest(file_contents, options: {})
click to toggle source
# File lib/bibliothecary/parsers/shard.rb, line 28 def self.parse_yaml_manifest(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument manifest = YAML.load file_contents map_dependencies(manifest, "dependencies", "runtime") + map_dependencies(manifest, "development_dependencies", "runtime") end