Sha256: 4b05f312051c5df62111a99de1200a6d064c4971ee6be297d0d46f9afe994314
Contents?: true
Size: 1.07 KB
Versions: 3
Compression:
Stored size: 1.07 KB
Contents
require 'json' module Bibliothecary module Parsers class Hex include Bibliothecary::Analyser def self.mapping { /^mix\.exs$/ => { kind: 'manifest', parser: :parse_mix }, /^mix\.lock$/ => { kind: 'lockfile', parser: :parse_mix_lock } } end def self.parse_mix(manifest) response = Typhoeus.post("#{Bibliothecary.configuration.mix_parser_host}/", body: manifest) json = JSON.parse response.body json.map do |name, version| { name: name, requirement: version, type: "runtime" } end end def self.parse_mix_lock(manifest) response = Typhoeus.post("#{Bibliothecary.configuration.mix_parser_host}/lock", body: manifest) json = JSON.parse response.body json.map do |name, info| { name: name, requirement: info['version'], type: "runtime" } end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bibliothecary-6.2.1 | lib/bibliothecary/parsers/hex.rb |
bibliothecary-6.2.0 | lib/bibliothecary/parsers/hex.rb |
bibliothecary-6.1.0 | lib/bibliothecary/parsers/hex.rb |