bibliothecary 6.8.1 → 6.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eba49f95b74f689cbe73561342e6bb17c6e46a6ff29b3fce387d58d16b681e4c
4
- data.tar.gz: 4e7c6979cd79bca265bb22561fe4ab401d77ac6233019e6a9a0bb0e40e5fbd34
3
+ metadata.gz: 378e983675d94e76e43f46f817d52a998117ae5087eafd7560d59332331f984b
4
+ data.tar.gz: e0b15d4f98ee40e47419ac2e28cbc916ec8d3f2349d3823f45bc71e20b8b31f9
5
5
  SHA512:
6
- metadata.gz: 99ed7c075636c3899a69116c24ada3a60564346703bed2271e41a0d2e587a91387fbcddae515a04d53c882ed2540d4574860104fdab4dd87421d5b56c5ecadd5
7
- data.tar.gz: 89bffd86e5fc0ff5c4bf04829a287158f60b86ca4f6f686e0773267e27f48bfda910a403e791e6388efd078eeabd868a47804aa1a8fde04892297ada507692d5
6
+ metadata.gz: ca1645d2941bb6098cabb01faedb1a2a25eb1888c4b87d078108a7bd6cae6ff7b93e2dfc852f4cbb239f70d63e36baabdbe3cb8afdd90b6107181f86c30cf0e1
7
+ data.tar.gz: de5e4d546172d0e661d52e8f951624b134ec9ad2cf4a04bdbecbe7f5aa23305f8f42df25c4e8fba3888a477109e5707b43e44d422c923bad3b6c3bb598d8d3c4
@@ -4,7 +4,7 @@ module Bibliothecary
4
4
  module Parsers
5
5
  class Conda
6
6
  include Bibliothecary::Analyser
7
- FILE_KINDS = %i[manifest lockfile]
7
+ FILE_KINDS = %w[manifest lockfile]
8
8
 
9
9
  def self.mapping
10
10
  {
@@ -34,14 +34,14 @@ module Bibliothecary
34
34
  Bibliothecary::Analyser.create_analysis(
35
35
  "conda",
36
36
  info.relative_path,
37
- kind.to_s,
38
- results[kind].map { |dep| dep.slice(:name, :requirement).merge(type: "runtime") }
37
+ kind,
38
+ results[kind.to_sym].map { |dep| dep.slice(:name, :requirement).merge(type: "runtime") }
39
39
  )
40
40
  end
41
41
  end
42
42
 
43
43
  def self.parse_pip(info)
44
- dependencies = YAML.load(info.contents)["dependencies"]
44
+ dependencies = YAML.safe_load(info.contents)["dependencies"]
45
45
  pip = dependencies.find { |dep| dep.is_a?(Hash) && dep["pip"]}
46
46
  return unless pip
47
47
 
@@ -21,8 +21,9 @@ module Bibliothecary
21
21
  package_manager = file_infos.first.package_manager
22
22
  @platform = package_manager.platform_name
23
23
  @path = Pathname.new(File.dirname(file_infos.first.relative_path)).cleanpath.to_path
24
- @manifests = file_infos.select { |info| package_manager.determine_kind_from_info(info) == "manifest" }.map { |info| File.basename(info.relative_path) }
25
- @lockfiles = file_infos.select { |info| package_manager.determine_kind_from_info(info) == "lockfile" }.map { |info| File.basename(info.relative_path) }
24
+ # `package_manager.determine_kind_from_info(info)` can be an Array, so use include? which also works for string
25
+ @manifests = file_infos.select { |info| package_manager.determine_kind_from_info(info).include? "manifest" }.map { |info| File.basename(info.relative_path) }
26
+ @lockfiles = file_infos.select { |info| package_manager.determine_kind_from_info(info).include? "lockfile" }.map { |info| File.basename(info.relative_path) }
26
27
  end
27
28
  end
28
29
  end
@@ -62,7 +62,7 @@ module Bibliothecary
62
62
  end
63
63
 
64
64
  def find_manifests(path)
65
- RelatedFilesInfo.create_from_file_infos(load_file_info_list(path).reject { |info| info.package_manager.nil? })
65
+ RelatedFilesInfo.create_from_file_infos(load_file_info_list(path).reject { |info| info.package_manager.nil? })
66
66
  end
67
67
 
68
68
  def analyse_file(file_path, contents)
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "6.8.1"
2
+ VERSION = "6.8.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bibliothecary
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.8.1
4
+ version: 6.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-29 00:00:00.000000000 Z
11
+ date: 2019-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb