Class: Bibliothecary::Parsers::Julia

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

Class Method Summary collapse

Methods included from Analyser

included

Class Method Details

.mappingObject



6
7
8
9
10
11
12
13
# File 'lib/bibliothecary/parsers/julia.rb', line 6

def self.mapping
  {
    /^REQUIRE$/i => {
      kind: 'manifest',
      parser: :parse_require
    }
  }
end

.parse_require(manifest) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/bibliothecary/parsers/julia.rb', line 15

def self.parse_require(manifest)
  manifest.split("\n").map do |line|
    match = line.split(/\s/)
    {
      name: match[0],
      requirement: match[1] || '*',
      type: 'runtime'
    }
  end
end