bibliothecary 8.2.5 → 8.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bibliothecary/configuration.rb +0 -2
- data/lib/bibliothecary/parsers/maven.rb +21 -22
- data/lib/bibliothecary/parsers/pypi.rb +1 -1
- 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: ca91a1e5491b7b57370221351c1c90631fd77c12a9687328eccb69b633b477c4
|
4
|
+
data.tar.gz: 9cdbb6238e28ac32d61c624f1d0a98f29939684fdbfe76b29f24b9fa1737c295
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '01295bf67f3ba73a4683b2fc39773d8ae53ac2b1a64ccf674bf8e93aa1cae2cdacb1575a0592f2c9fbb86ddf3cca7cd60475b12252976bad6eafc07514339b34'
|
7
|
+
data.tar.gz: 701ab67291c19f5e7e180beeaa0501050fd3a1726d8d02918b3e305969f70266377d1ad66c65d17517a171c24440df917d233420916bc4429780541bdd688b0f
|
@@ -5,7 +5,6 @@ module Bibliothecary
|
|
5
5
|
attr_accessor :carthage_parser_host
|
6
6
|
attr_accessor :clojars_parser_host
|
7
7
|
attr_accessor :mix_parser_host
|
8
|
-
attr_accessor :gradle_parser_host
|
9
8
|
attr_accessor :yarn_parser_host
|
10
9
|
attr_accessor :conda_parser_host
|
11
10
|
attr_accessor :swift_parser_host
|
@@ -17,7 +16,6 @@ module Bibliothecary
|
|
17
16
|
@carthage_parser_host = 'https://carthage.libraries.io'
|
18
17
|
@clojars_parser_host = 'https://clojars.libraries.io'
|
19
18
|
@mix_parser_host = 'https://mix.libraries.io'
|
20
|
-
@gradle_parser_host = 'https://gradle-parser.libraries.io'
|
21
19
|
@yarn_parser_host = 'https://yarn-parser.libraries.io'
|
22
20
|
@conda_parser_host = 'https://conda-parser.libraries.io'
|
23
21
|
@swift_parser_host = 'http://swift.libraries.io'
|
@@ -13,16 +13,18 @@ module Bibliothecary
|
|
13
13
|
GRADLE_DEP_REGEX = /(\+---|\\---){1}/
|
14
14
|
|
15
15
|
# Builtin methods: https://docs.gradle.org/current/userguide/java_plugin.html#tab:configurations
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
#
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
# Deprecated methods: https://docs.gradle.org/current/userguide/upgrading_version_6.html#sec:configuration_removal
|
17
|
+
GRADLE_DEPENDENCY_METHODS = %w(api compile compileClasspath compileOnly compileOnlyApi implementation runtime runtimeClasspath runtimeOnly testCompile testCompileOnly testImplementation testRuntime testRuntimeOnly)
|
18
|
+
|
19
|
+
# Intentionally overly-simplified regexes to scrape deps from build.gradle (Groovy) and build.gradle.kts (Kotlin) files.
|
20
|
+
# To be truly useful bibliothecary would need full Groovy / Kotlin parsers that speaks Gradle,
|
21
|
+
# because the Groovy and Kotlin DSLs have many dynamic ways of declaring dependencies.
|
22
|
+
GRADLE_VERSION_REGEX = /[\w.-]+/ # e.g. '1.2.3'
|
23
|
+
GRADLE_VAR_INTERPOLATION_REGEX = /\$\w+/ # e.g. '$myVersion'
|
24
|
+
GRADLE_CODE_INTERPOLATION_REGEX = /\$\{.*\}/ # e.g. '${my-project-settings["version"]}'
|
25
|
+
GRADLE_GAV_REGEX = /([\w.-]+)\:([\w.-]+)(?:\:(#{GRADLE_VERSION_REGEX}|#{GRADLE_VAR_INTERPOLATION_REGEX}|#{GRADLE_CODE_INTERPOLATION_REGEX}))?/ # e.g. "group:artifactId:1.2.3"
|
26
|
+
GRADLE_GROOVY_SIMPLE_REGEX = /(#{GRADLE_DEPENDENCY_METHODS.join('|')})\s*\(?\s*['"]#{GRADLE_GAV_REGEX}['"]/m
|
27
|
+
GRADLE_KOTLIN_SIMPLE_REGEX = /(#{GRADLE_DEPENDENCY_METHODS.join('|')})\s*\(\s*"#{GRADLE_GAV_REGEX}"/m
|
26
28
|
|
27
29
|
MAVEN_PROPERTY_REGEX = /\$\{(.+?)\}/
|
28
30
|
MAX_DEPTH = 5
|
@@ -233,24 +235,21 @@ module Bibliothecary
|
|
233
235
|
end
|
234
236
|
|
235
237
|
def self.parse_gradle(file_contents, options: {})
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
json['dependencies'].map do |dependency|
|
241
|
-
name = gradle_dependency_name(dependency["group"], dependency["name"])
|
242
|
-
next unless name =~ /[\w-]+\.[\w_-]+(\.[\w-])?\:[\w-]/
|
238
|
+
file_contents
|
239
|
+
.scan(GRADLE_GROOVY_SIMPLE_REGEX) # match 'implementation "group:artifactId:version"'
|
240
|
+
.reject { |(_type, group, artifactId, _version)| group.nil? || artifactId.nil? } # remove any matches with missing group/artifactId
|
241
|
+
.map { |(type, group, artifactId, version)|
|
243
242
|
{
|
244
|
-
name:
|
245
|
-
requirement:
|
246
|
-
type:
|
243
|
+
name: [group, artifactId].join(":"),
|
244
|
+
requirement: version || "*",
|
245
|
+
type: type
|
247
246
|
}
|
248
|
-
|
247
|
+
}
|
249
248
|
end
|
250
249
|
|
251
250
|
def self.parse_gradle_kts(file_contents, options: {})
|
252
251
|
file_contents
|
253
|
-
.scan(
|
252
|
+
.scan(GRADLE_KOTLIN_SIMPLE_REGEX) # match 'implementation("group:artifactId:version")'
|
254
253
|
.reject { |(_type, group, artifactId, _version)| group.nil? || artifactId.nil? } # remove any matches with missing group/artifactId
|
255
254
|
.map { |(type, group, artifactId, version)|
|
256
255
|
{
|
@@ -84,7 +84,7 @@ module Bibliothecary
|
|
84
84
|
end
|
85
85
|
|
86
86
|
def self.parse_poetry(file_contents, options: {})
|
87
|
-
manifest = Tomlrb.parse(file_contents)
|
87
|
+
manifest = Tomlrb.parse(file_contents).fetch('tool', {}).fetch('poetry', {})
|
88
88
|
map_dependencies(manifest['dependencies'], 'runtime') + map_dependencies(manifest['dev-dependencies'], 'develop')
|
89
89
|
end
|
90
90
|
|
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: 8.
|
4
|
+
version: 8.3.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: 2022-05-
|
11
|
+
date: 2022-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tomlrb
|