Sha256: d6f54438e2e39777d5d6cf6b4d966e32e29fb0cb2bdae71f1c6fe383bb4b5ab7
Contents?: true
Size: 784 Bytes
Versions: 16
Compression:
Stored size: 784 Bytes
Contents
require 'json' require 'typhoeus' module Bibliothecary module Parsers class Clojars include Bibliothecary::Analyser def self.mapping { /^project\.clj$/ => { kind: 'manifest', parser: :parse_manifest } } end def self.parse_manifest(manifest) response = Typhoeus.post("https://clojars.libraries.io/project.clj", body: manifest) json = JSON.parse response.body index = json.index("dependencies") return [] unless index; dependencies = json[index + 1] dependencies.map do |dependency| { name: dependency[0], version: dependency[1], type: "runtime" } end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems