bibliothecary 9.0.0 → 9.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: 5ee8f5b235766985dfe5ebab204d9102ab1ccaaa9d554bfe554717e5714a4d6a
4
- data.tar.gz: 7c151adfd305c726b1fb071e057499b6db8e9ed23af5cae870faed1237ca3f12
3
+ metadata.gz: 663746258869345c2ab91235203d083b8c20862ceacc435726e0e903a5924a2c
4
+ data.tar.gz: d675d548e6c34bb985895087948753f43a132c09c28608a56d3cfce5cc14b0fa
5
5
  SHA512:
6
- metadata.gz: 23631d08bd943cf601e1304bcc4dfc02eb61dc23813919e5f3c3fc46c747ebb38d827f11ae559f80004c47751e74adc4aa98792d0176bec0ff3edff239018827
7
- data.tar.gz: 3216f53aa721364f9f0209cb30a8b6a000e672a7ba874f4b5d2282a100611c5f1a26d9c921020fd3c4bf3e39ee0cb89ccbd63d91bfe462967ac85c28cd5b5e79
6
+ metadata.gz: 65b0c2930fd92537908a604c94e2a12852e5cc5167838f3fb7c86325a16fc930479b746096a063506f01174c9eb40a792e7f88e1aacefce0f657059b630297a6
7
+ data.tar.gz: 1b29d13ee41d4a6aabe54854ebe316f1f17cea1be88ba9a73a290c645f3cad4853e2cc6497f419dff474809e1905c1ad851d1d214a58373eee013774830a23e6
@@ -7,13 +7,13 @@ module Bibliothecary
7
7
  include Bibliothecary::Analyser
8
8
 
9
9
  GPM_REGEXP = /^(.+)\s+(.+)$/
10
+ GOMOD_COMMENT_REGEXP = /(\/\/(.*))/
10
11
  GOMOD_REPLACEMENT_SEPARATOR_REGEXP = /\s=>\s/
11
- GOMOD_DEP_REGEXP = /(?<name>\S+)\s?(?<requirement>[^\s=>]+)?/ # the " =>" negative character class is to make sure we don't capture the delimiter for "replace" deps
12
+ GOMOD_DEP_REGEXP = /(?<name>\S+)\s?(?<requirement>[^\s=>]+)?\s*(?<indirect>\/\/\s+indirect)?/ # the " =>" negative character class is to make sure we don't capture the delimiter for "replace" deps
12
13
  GOMOD_SINGLELINE_DEP_REGEXP = /^(?<category>require|exclude|replace|retract)\s+#{GOMOD_DEP_REGEXP}.*$/
13
14
  GOMOD_MULTILINE_DEP_REGEXP = /^#{GOMOD_DEP_REGEXP}.*$/
14
15
  GOMOD_MULTILINE_START_REGEXP = /^(?<category>require|exclude|replace|retract)\s+\(/
15
16
  GOMOD_MULTILINE_END_REGEXP = /^\)/
16
- GOMOD_COMMENT_REGEXP = /(\/\/(.*))/
17
17
  GOSUM_REGEXP = /^(.+)\s+(.+)\s+(.+)$/
18
18
 
19
19
  def self.mapping
@@ -158,8 +158,8 @@ module Bibliothecary
158
158
  }
159
159
  file_contents
160
160
  .lines
161
+ .map(&:strip)
161
162
  .reject { |line| line =~ /^#{GOMOD_COMMENT_REGEXP}/ } # ignore comment lines
162
- .map { |line| line.strip.gsub(GOMOD_COMMENT_REGEXP, "") } # strip out trailing comments
163
163
  .each do |line|
164
164
  if line.match(GOMOD_MULTILINE_END_REGEXP) # detect the end of a multiline
165
165
  current_multiline_category = nil
@@ -227,6 +227,7 @@ module Bibliothecary
227
227
  name: replacement_match[:name],
228
228
  requirement: replacement_match[:requirement] || "*",
229
229
  type: "runtime",
230
+ direct: !match[:indirect],
230
231
  }
231
232
  when "retract"
232
233
  {
@@ -234,12 +235,14 @@ module Bibliothecary
234
235
  requirement: match[:requirement] || "*",
235
236
  type: "runtime",
236
237
  deprecated: true,
238
+ direct: !match[:indirect],
237
239
  }
238
240
  else
239
241
  {
240
242
  name: match[:name],
241
243
  requirement: match[:requirement] || "*",
242
244
  type: "runtime",
245
+ direct: !match[:indirect],
243
246
  }
244
247
  end
245
248
  end
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "9.0.0"
2
+ VERSION = "9.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: 9.0.0
4
+ version: 9.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: 2024-06-17 00:00:00.000000000 Z
11
+ date: 2024-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb