bibliothecary 6.8.0 → 6.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad656049717370381dab1f44bfe7b0da145a5428b04e9366519c3f39f8bdf2aa
4
- data.tar.gz: 8e30a85be3b00e5d56ae5826ecd0fef20c4d4bc348486a54cfdb0f26e0892262
3
+ metadata.gz: eba49f95b74f689cbe73561342e6bb17c6e46a6ff29b3fce387d58d16b681e4c
4
+ data.tar.gz: 4e7c6979cd79bca265bb22561fe4ab401d77ac6233019e6a9a0bb0e40e5fbd34
5
5
  SHA512:
6
- metadata.gz: b852fe3cb0da5168a2de6b25dac9bfb9335aba3f3eb2d36ca04db1c4492d7e150d30037a2d41571861fe15b1a8beb2094312bb71c3ef0e43d2a553c7991c714c
7
- data.tar.gz: 05e20877ea6700d89dc33f61dde31a63b8352435c72a27dd881ae7521dac2f6c6fb770ae7c46488c2ee5dd5e43a32e77e6c41f6329fff049625e04aab2f11763
6
+ metadata.gz: 99ed7c075636c3899a69116c24ada3a60564346703bed2271e41a0d2e587a91387fbcddae515a04d53c882ed2540d4574860104fdab4dd87421d5b56c5ecadd5
7
+ data.tar.gz: 89bffd86e5fc0ff5c4bf04829a287158f60b86ca4f6f686e0773267e27f48bfda910a403e791e6388efd078eeabd868a47804aa1a8fde04892297ada507692d5
@@ -19,8 +19,17 @@ module Bibliothecary
19
19
 
20
20
  # Overrides Analyser.analyse_contents_from_info
21
21
  def self.analyse_contents_from_info(info)
22
- results = call_conda_parser_web(info.contents)
22
+ [parse_conda(info), parse_pip(info)].flatten.compact
23
+ rescue Bibliothecary::RemoteParsingError => e
24
+ Bibliothecary::Analyser::create_error_analysis(platform_name, info.relative_path, "runtime", e.message)
25
+ rescue Psych::SyntaxError => e
26
+ Bibliothecary::Analyser::create_error_analysis(platform_name, info.relative_path, "runtime", e.message)
27
+ end
28
+
29
+ private
23
30
 
31
+ def self.parse_conda(info)
32
+ results = call_conda_parser_web(info.contents)
24
33
  FILE_KINDS.map do |kind|
25
34
  Bibliothecary::Analyser.create_analysis(
26
35
  "conda",
@@ -29,11 +38,20 @@ module Bibliothecary
29
38
  results[kind].map { |dep| dep.slice(:name, :requirement).merge(type: "runtime") }
30
39
  )
31
40
  end
32
- rescue Bibliothecary::RemoteParsingError => e
33
- Bibliothecary::Analyser::create_error_analysis(platform_name, info.relative_path, "runtime", e.message)
34
41
  end
35
42
 
36
- private
43
+ def self.parse_pip(info)
44
+ dependencies = YAML.load(info.contents)["dependencies"]
45
+ pip = dependencies.find { |dep| dep.is_a?(Hash) && dep["pip"]}
46
+ return unless pip
47
+
48
+ Bibliothecary::Analyser.create_analysis(
49
+ "pypi",
50
+ info.relative_path,
51
+ "manifest",
52
+ Pypi.parse_requirements_txt(pip["pip"].join("\n"))
53
+ )
54
+ end
37
55
 
38
56
  def self.call_conda_parser_web(file_contents)
39
57
  host = Bibliothecary.configuration.conda_parser_host
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "6.8.0"
2
+ VERSION = "6.8.1"
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.0
4
+ version: 6.8.1
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-27 00:00:00.000000000 Z
11
+ date: 2019-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: toml-rb
@@ -302,8 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
302
302
  - !ruby/object:Gem::Version
303
303
  version: '0'
304
304
  requirements: []
305
- rubyforge_project:
306
- rubygems_version: 2.7.6
305
+ rubygems_version: 3.0.4
307
306
  signing_key:
308
307
  specification_version: 4
309
308
  summary: Find and parse manifests