bibliothecary 6.8.9 → 6.8.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bibliothecary/parsers/pypi.rb +34 -0
- data/lib/bibliothecary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e741631279743ce1c101374e150651f3e234754a303b988c4c01a14e8ac384e
|
4
|
+
data.tar.gz: 7cd1e774a59ae18e9810340b2da990d973d05c26e0fe1cc0778ffbec9cdb8d24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3a17720851d21d2f9289e9342a750d535c38b55cc4e1c58202855b557d7d52e46adcc768b0f629d6f4ff8104a7b954760a6f966fe48e1bee610efa28645f2cbe
|
7
|
+
data.tar.gz: e11348d1eaf3b9fa87e50ad20c307845e5ece4b51cc09b032dd392927e986ade478a2d5c46b71b94ec005ca4048bedc927389dad5790b4f609aa62749d04547b
|
@@ -31,6 +31,14 @@ module Bibliothecary
|
|
31
31
|
match_filename("Pipfile.lock") => {
|
32
32
|
kind: 'lockfile',
|
33
33
|
parser: :parse_pipfile_lock
|
34
|
+
},
|
35
|
+
match_filename("pyproject.toml") => {
|
36
|
+
kind: 'manifest',
|
37
|
+
parser: :parse_poetry
|
38
|
+
},
|
39
|
+
match_filename("poetry.lock") => {
|
40
|
+
kind: 'lockfile',
|
41
|
+
parser: :parse_poetry_lock
|
34
42
|
}
|
35
43
|
}
|
36
44
|
end
|
@@ -40,6 +48,11 @@ module Bibliothecary
|
|
40
48
|
map_dependencies(manifest['packages'], 'runtime') + map_dependencies(manifest['dev-packages'], 'develop')
|
41
49
|
end
|
42
50
|
|
51
|
+
def self.parse_poetry(file_contents)
|
52
|
+
manifest = TomlRB.parse(file_contents)['tool']['poetry']
|
53
|
+
map_dependencies(manifest['dependencies'], 'runtime') + map_dependencies(manifest['dev-dependencies'], 'develop')
|
54
|
+
end
|
55
|
+
|
43
56
|
def self.map_dependencies(packages, type)
|
44
57
|
return [] unless packages
|
45
58
|
packages.map do |name, info|
|
@@ -82,6 +95,27 @@ module Bibliothecary
|
|
82
95
|
deps
|
83
96
|
end
|
84
97
|
|
98
|
+
def self.parse_poetry_lock(file_contents)
|
99
|
+
manifest = TomlRB.parse(file_contents)
|
100
|
+
deps = []
|
101
|
+
manifest["package"].each do |package|
|
102
|
+
# next if group == "_meta"
|
103
|
+
group = case package['category']
|
104
|
+
when 'main'
|
105
|
+
'runtime'
|
106
|
+
when 'dev'
|
107
|
+
'develop'
|
108
|
+
end
|
109
|
+
|
110
|
+
deps << {
|
111
|
+
name: package['name'],
|
112
|
+
requirement: map_requirements(package),
|
113
|
+
type: group
|
114
|
+
}
|
115
|
+
end
|
116
|
+
deps
|
117
|
+
end
|
118
|
+
|
85
119
|
def self.parse_setup_py(manifest)
|
86
120
|
match = manifest.match(INSTALL_REGEXP)
|
87
121
|
return [] unless match
|
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.
|
4
|
+
version: 6.8.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Nesbitt
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-06-
|
11
|
+
date: 2020-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: toml-rb
|