Class: Bibliothecary::Parsers::Conda

Inherits:
Object
  • Object
show all
Includes:
Analyser
Defined in:
lib/bibliothecary/parsers/conda.rb

Class Method Summary collapse

Methods included from Analyser

create_analysis, create_error_analysis, included

Class Method Details

.mappingObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/bibliothecary/parsers/conda.rb', line 8

def self.mapping
  {
    match_filename("environment.yml") => {
      parser: :parse_conda,
      kind: "manifest",
    },
    match_filename("environment.yaml") => {
      parser: :parse_conda,
      kind: "manifest",
    },
    match_filename("environment.yml.lock") => {
      parser: :parse_conda_lockfile,
      kind: "lockfile",
    },
    match_filename("environment.yaml.lock") => {
      parser: :parse_conda_lockfile,
      kind: "lockfile",
    },
  }
end

.parse_conda(info) ⇒ Object



29
30
31
32
# File 'lib/bibliothecary/parsers/conda.rb', line 29

def self.parse_conda(info)
  dependencies = call_conda_parser_web(info, "manifest")[:manifest]
  dependencies.map { |dep| dep.merge(type: "runtime") }
end

.parse_conda_lockfile(info) ⇒ Object



34
35
36
37
# File 'lib/bibliothecary/parsers/conda.rb', line 34

def self.parse_conda_lockfile(info)
  dependencies = call_conda_parser_web(info, "lockfile")[:lockfile]
  dependencies.map { |dep| dep.merge(type: "runtime") }
end