Class: Bibliothecary::Parsers::Bower

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

Class Method Summary collapse

Methods included from Analyser

create_analysis, create_error_analysis, included

Class Method Details

.mappingObject



10
11
12
13
14
15
16
17
# File 'lib/bibliothecary/parsers/bower.rb', line 10

def self.mapping
  {
    match_filename("bower.json") => {
      kind: "manifest",
      parser: :parse_manifest,
    },
  }
end

.parse_manifest(file_contents, options: {}) ⇒ Object



21
22
23
24
25
# File 'lib/bibliothecary/parsers/bower.rb', line 21

def self.parse_manifest(file_contents, options: {})
  json = JSON.parse(file_contents)
  map_dependencies(json, "dependencies", "runtime", options.fetch(:filename, nil)) +
    map_dependencies(json, "devDependencies", "development", options.fetch(:filename, nil))
end