Sha256: 6b54471bab8cee4ddcce34554905954eef744be61165d24966b82a1df2711e4c
Contents?: true
Size: 1.21 KB
Versions: 16
Compression:
Stored size: 1.21 KB
Contents
module Bibliothecary module Parsers class Carthage include Bibliothecary::Analyser def self.mapping { /^Cartfile$/ => { kind: 'manifest', parser: :parse_cartfile }, /^Cartfile\.private$/ => { kind: 'manifest', parser: :parse_cartfile_private }, /^Cartfile\.resolved$/ => { kind: 'lockfile', parser: :parse_cartfile_resolved } } end def self.parse_cartfile(manifest) map_dependencies(manifest, 'cartfile') end def self.parse_cartfile_private(manifest) map_dependencies(manifest, 'cartfile.private') end def self.parse_cartfile_resolved(manifest) map_dependencies(manifest, 'cartfile.resolved') end def self.map_dependencies(manifest, path) response = Typhoeus.post("https://carthage.libraries.io/#{path}", params: {body: manifest}) json = JSON.parse(response.body) json.map do |dependency| { name: dependency['name'], version: dependency['version'], type: dependency["type"] } end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems