bibliothecary 7.0.2 → 7.1.0

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: 1c44d6a07f7c3cdd1e6517420b6fe59f0b453201f0f4deb7e3870f206ace5a04
4
- data.tar.gz: 07ddf505184913265f608eea5b0ad8f9293b69a47bbe353606651d510b8d6158
3
+ metadata.gz: 74f493b85e3dec08ab0c8aad09b9beb59eee3b8dc5317d6b9f20c6c5620298eb
4
+ data.tar.gz: 1f1dd61989f87a10974e205862e3a01c7808bdad072dcca2f74193d1c731c9ec
5
5
  SHA512:
6
- metadata.gz: 2c8693bace5bb30e27ae2cd72c130a68f8c2e8cdbb0f487b5bef59374a7ac6ad103bc10a2214f3ce2409a5c73dd861136f3e7c4b751d1a17b9ff13bb400a4ba7
7
- data.tar.gz: 6d92229299dd6c3997ab9ff2addde302baf95383660a7849afaa519bc94b519196c7a11aae08bc23c24daaf96bb689c1431f9ab07efe1e0cbcce7f4e0d91e6a5
6
+ metadata.gz: '02351483c4000b031662de8ed48459c74d8d533b9676ba3968060e01cca50fcf5ede59982d8e6237d6ddf8395fa0b5172c87eb13a7d849e866236c88fec20150'
7
+ data.tar.gz: b437fe17ca779bc99a6d78753936726ae102c75ef7e2583ae6544320aa5b65ba53e16e644035c5eaa445cd2bc6fe2fa695856b6e518c5d3fbad389f33c0419ae
@@ -24,14 +24,18 @@ module Bibliothecary
24
24
  {
25
25
  name: dependency["name"],
26
26
  requirement: dependency["version"],
27
- type: 'runtime'
28
- }
27
+ type: "runtime"
28
+ }.tap do |result|
29
+ result[:drupal_requirement] = dependency.dig("source", "reference") if is_drupal_module(dependency)
30
+ end
29
31
  end + manifest.fetch('packages-dev',[]).map do |dependency|
30
32
  {
31
33
  name: dependency["name"],
32
34
  requirement: dependency["version"],
33
- type: 'development'
34
- }
35
+ type: "development"
36
+ }.tap do |result|
37
+ result[:drupal_requirement] = dependency.dig("source", "reference") if is_drupal_module(dependency)
38
+ end
35
39
  end
36
40
  end
37
41
 
@@ -40,6 +44,17 @@ module Bibliothecary
40
44
  map_dependencies(manifest, 'require', 'runtime') +
41
45
  map_dependencies(manifest, 'require-dev', 'development')
42
46
  end
47
+
48
+ # Drupal hosts its own Composer repository, where its "modules" are indexed and searchable. The best way to
49
+ # confirm that Drupal's repo is being used is if its in the "repositories" in composer.json
50
+ # (https://support.acquia.com/hc/en-us/articles/360048081273-Using-Composer-to-manage-dependencies-in-Drupal-8-and-9),
51
+ # but you may only have composer.lock, so we test if the type is "drupal-*" (e.g. "drupal-module" or "drupal-theme")
52
+ # The Drupal team also setup its own mapper of Composer semver -> Drupal tool-specfic versions
53
+ # (https://www.drupal.org/project/project_composer/issues/2622450),
54
+ # so we return the Drupal requirement instead of semver requirement if it's here.
55
+ private_class_method def self.is_drupal_module(dependency)
56
+ dependency["type"] =~ /drupal/ && dependency.dig("source", "reference")
57
+ end
43
58
  end
44
59
  end
45
60
  end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "7.0.2"
2
+ VERSION = "7.1.0"
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: 7.0.2
4
+ version: 7.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-22 00:00:00.000000000 Z
11
+ date: 2021-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb