bibliothecary 8.7.3 → 8.7.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +21 -4
  3. data/.rubocop.yml +32 -941
  4. data/Gemfile +1 -1
  5. data/Rakefile +10 -0
  6. data/bibliothecary.gemspec +2 -2
  7. data/lib/bibliothecary/analyser.rb +6 -6
  8. data/lib/bibliothecary/cli.rb +8 -8
  9. data/lib/bibliothecary/configuration.rb +8 -8
  10. data/lib/bibliothecary/file_info.rb +2 -2
  11. data/lib/bibliothecary/multi_parsers/bundler_like_manifest.rb +1 -1
  12. data/lib/bibliothecary/multi_parsers/cyclonedx.rb +16 -17
  13. data/lib/bibliothecary/multi_parsers/dependencies_csv.rb +16 -16
  14. data/lib/bibliothecary/multi_parsers/json_runtime.rb +3 -3
  15. data/lib/bibliothecary/multi_parsers/spdx.rb +14 -14
  16. data/lib/bibliothecary/parsers/bower.rb +7 -7
  17. data/lib/bibliothecary/parsers/cargo.rb +15 -15
  18. data/lib/bibliothecary/parsers/carthage.rb +16 -16
  19. data/lib/bibliothecary/parsers/clojars.rb +7 -7
  20. data/lib/bibliothecary/parsers/cocoapods.rb +20 -20
  21. data/lib/bibliothecary/parsers/conda.rb +9 -9
  22. data/lib/bibliothecary/parsers/cpan.rb +12 -12
  23. data/lib/bibliothecary/parsers/cran.rb +12 -12
  24. data/lib/bibliothecary/parsers/dub.rb +8 -8
  25. data/lib/bibliothecary/parsers/elm.rb +8 -8
  26. data/lib/bibliothecary/parsers/go.rb +131 -66
  27. data/lib/bibliothecary/parsers/hackage.rb +13 -13
  28. data/lib/bibliothecary/parsers/haxelib.rb +4 -4
  29. data/lib/bibliothecary/parsers/hex.rb +11 -11
  30. data/lib/bibliothecary/parsers/julia.rb +4 -4
  31. data/lib/bibliothecary/parsers/maven.rb +88 -89
  32. data/lib/bibliothecary/parsers/meteor.rb +4 -4
  33. data/lib/bibliothecary/parsers/npm.rb +31 -31
  34. data/lib/bibliothecary/parsers/nuget.rb +44 -44
  35. data/lib/bibliothecary/parsers/packagist.rb +14 -14
  36. data/lib/bibliothecary/parsers/pub.rb +13 -13
  37. data/lib/bibliothecary/parsers/pypi.rb +80 -72
  38. data/lib/bibliothecary/parsers/rubygems.rb +15 -15
  39. data/lib/bibliothecary/parsers/shard.rb +13 -13
  40. data/lib/bibliothecary/parsers/swift_pm.rb +6 -6
  41. data/lib/bibliothecary/purl_util.rb +1 -1
  42. data/lib/bibliothecary/runner.rb +4 -4
  43. data/lib/bibliothecary/version.rb +1 -1
  44. data/lib/bibliothecary.rb +3 -3
  45. data/lib/sdl_parser.rb +5 -5
  46. metadata +2 -2
@@ -15,73 +15,73 @@ module Bibliothecary
15
15
  PIP_COMPILE_REGEXP = /.*require.*$/
16
16
 
17
17
  # Adapted from https://peps.python.org/pep-0508/#names
18
- PEP_508_NAME_REGEX = /^([A-Z0-9][A-Z0-9._-]*[A-Z0-9]|[A-Z0-9])/i
18
+ PEP_508_NAME_REGEXP = /^([A-Z0-9][A-Z0-9._-]*[A-Z0-9]|[A-Z0-9])/i
19
19
 
20
20
  def self.mapping
21
21
  {
22
- match_filenames('requirements-dev.txt', 'requirements/dev.txt',
23
- 'requirements-docs.txt', 'requirements/docs.txt',
24
- 'requirements-test.txt', 'requirements/test.txt',
25
- 'requirements-tools.txt', 'requirements/tools.txt') => {
26
- kind: 'manifest',
27
- parser: :parse_requirements_txt
22
+ match_filenames("requirements-dev.txt", "requirements/dev.txt",
23
+ "requirements-docs.txt", "requirements/docs.txt",
24
+ "requirements-test.txt", "requirements/test.txt",
25
+ "requirements-tools.txt", "requirements/tools.txt") => {
26
+ kind: "manifest",
27
+ parser: :parse_requirements_txt,
28
28
  },
29
29
  lambda { |p| PIP_COMPILE_REGEXP.match(p) } => {
30
30
  content_matcher: :pip_compile?,
31
- kind: 'lockfile',
32
- parser: :parse_requirements_txt
31
+ kind: "lockfile",
32
+ parser: :parse_requirements_txt,
33
33
  },
34
34
  lambda { |p| MANIFEST_REGEXP.match(p) } => {
35
- kind: 'manifest',
35
+ kind: "manifest",
36
36
  parser: :parse_requirements_txt,
37
- can_have_lockfile: false
37
+ can_have_lockfile: false,
38
38
  },
39
- match_filename('requirements.frozen') => { # pattern exists to store frozen deps in requirements.frozen
39
+ match_filename("requirements.frozen") => { # pattern exists to store frozen deps in requirements.frozen
40
40
  parser: :parse_requirements_txt,
41
- kind: 'lockfile'
41
+ kind: "lockfile",
42
42
  },
43
- match_filename('pip-resolved-dependencies.txt') => { # Inferred from pip
44
- kind: 'lockfile',
45
- parser: :parse_requirements_txt
43
+ match_filename("pip-resolved-dependencies.txt") => { # Inferred from pip
44
+ kind: "lockfile",
45
+ parser: :parse_requirements_txt,
46
46
  },
47
47
  match_filename("setup.py") => {
48
- kind: 'manifest',
48
+ kind: "manifest",
49
49
  parser: :parse_setup_py,
50
- can_have_lockfile: false
50
+ can_have_lockfile: false,
51
51
  },
52
52
  match_filename("Pipfile") => {
53
- kind: 'manifest',
54
- parser: :parse_pipfile
53
+ kind: "manifest",
54
+ parser: :parse_pipfile,
55
55
  },
56
56
  match_filename("Pipfile.lock") => {
57
- kind: 'lockfile',
58
- parser: :parse_pipfile_lock
57
+ kind: "lockfile",
58
+ parser: :parse_pipfile_lock,
59
59
  },
60
60
  match_filename("pyproject.toml") => {
61
- kind: 'manifest',
62
- parser: :parse_pyproject
61
+ kind: "manifest",
62
+ parser: :parse_pyproject,
63
63
  },
64
64
  match_filename("poetry.lock") => {
65
- kind: 'lockfile',
66
- parser: :parse_poetry_lock
65
+ kind: "lockfile",
66
+ parser: :parse_poetry_lock,
67
67
  },
68
68
  # Pip dependencies can be embedded in conda environment files
69
69
  match_filename("environment.yml") => {
70
70
  parser: :parse_conda,
71
- kind: "manifest"
71
+ kind: "manifest",
72
72
  },
73
73
  match_filename("environment.yaml") => {
74
74
  parser: :parse_conda,
75
- kind: "manifest"
75
+ kind: "manifest",
76
76
  },
77
77
  match_filename("environment.yml.lock") => {
78
78
  parser: :parse_conda,
79
- kind: "lockfile"
79
+ kind: "lockfile",
80
80
  },
81
81
  match_filename("environment.yaml.lock") => {
82
82
  parser: :parse_conda,
83
- kind: "lockfile"
84
- }
83
+ kind: "lockfile",
84
+ },
85
85
  }
86
86
  end
87
87
 
@@ -89,25 +89,33 @@ module Bibliothecary
89
89
  add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)
90
90
  add_multi_parser(Bibliothecary::MultiParsers::Spdx)
91
91
 
92
- def self.parse_pipfile(file_contents, options: {})
92
+ def self.parse_pipfile(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
93
93
  manifest = Tomlrb.parse(file_contents)
94
- map_dependencies(manifest['packages'], 'runtime') + map_dependencies(manifest['dev-packages'], 'develop')
94
+ map_dependencies(manifest["packages"], "runtime") + map_dependencies(manifest["dev-packages"], "develop")
95
95
  end
96
96
 
97
- def self.parse_pyproject(file_contents, options: {})
97
+ def self.parse_pyproject(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
98
98
  deps = []
99
99
 
100
100
  file_contents = Tomlrb.parse(file_contents)
101
101
 
102
102
  # Parse poetry [tool.poetry] deps
103
- poetry_manifest = file_contents.fetch('tool', {}).fetch('poetry', {})
104
- deps += map_dependencies(poetry_manifest['dependencies'], 'runtime')
105
- deps += map_dependencies(poetry_manifest['dev-dependencies'], 'develop')
103
+ poetry_manifest = file_contents.fetch("tool", {}).fetch("poetry", {})
104
+ deps += map_dependencies(poetry_manifest["dependencies"], "runtime")
105
+ # Poetry 1.0.0-1.2.0 way of defining dev deps
106
+ deps += map_dependencies(poetry_manifest["dev-dependencies"], "develop")
107
+ # Poetry's 1.2.0+ of defining dev deps
108
+ poetry_manifest
109
+ .fetch("group", {})
110
+ .each_pair do |group_name, obj|
111
+ group_name = "develop" if group_name == "dev"
112
+ deps += map_dependencies(obj.fetch("dependencies", {}), group_name)
113
+ end
106
114
 
107
115
  # Parse PEP621 [project] deps
108
- pep621_manifest = file_contents.fetch('project', {})
109
- pep621_deps = pep621_manifest.fetch('dependencies', []).map { |d| parse_pep_508_dep_spec(d) }
110
- deps += map_dependencies(pep621_deps, 'runtime')
116
+ pep621_manifest = file_contents.fetch("project", {})
117
+ pep621_deps = pep621_manifest.fetch("dependencies", []).map { |d| parse_pep_508_dep_spec(d) }
118
+ deps += map_dependencies(pep621_deps, "runtime")
111
119
 
112
120
  # We're combining both poetry+PEP621 deps instead of making them mutually exclusive, until we
113
121
  # find a reason not to ingest them both.
@@ -120,7 +128,7 @@ module Bibliothecary
120
128
  parse_pyproject(file_contents, options)
121
129
  end
122
130
 
123
- def self.parse_conda(file_contents, options: {})
131
+ def self.parse_conda(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
124
132
  contents = YAML.safe_load(file_contents)
125
133
  return [] unless contents
126
134
 
@@ -137,64 +145,64 @@ module Bibliothecary
137
145
  {
138
146
  name: name,
139
147
  requirement: map_requirements(info),
140
- type: type
148
+ type: type,
141
149
  }
142
150
  end
143
151
  end
144
152
 
145
153
  def self.map_requirements(info)
146
154
  if info.is_a?(Hash)
147
- if info['version']
148
- info['version']
149
- elsif info['git']
150
- info['git'] + '#' + info['ref']
155
+ if info["version"]
156
+ info["version"]
157
+ elsif info["git"]
158
+ info["git"] + "#" + info["ref"]
151
159
  else
152
- '*'
160
+ "*"
153
161
  end
154
162
  else
155
- info || '*'
163
+ info || "*"
156
164
  end
157
165
  end
158
166
 
159
- def self.parse_pipfile_lock(file_contents, options: {})
167
+ def self.parse_pipfile_lock(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
160
168
  manifest = JSON.parse(file_contents)
161
169
  deps = []
162
170
  manifest.each do |group, dependencies|
163
171
  next if group == "_meta"
164
- group = 'runtime' if group == 'default'
172
+ group = "runtime" if group == "default"
165
173
  dependencies.each do |name, info|
166
174
  deps << {
167
175
  name: name,
168
176
  requirement: map_requirements(info),
169
- type: group
177
+ type: group,
170
178
  }
171
179
  end
172
180
  end
173
181
  deps
174
182
  end
175
183
 
176
- def self.parse_poetry_lock(file_contents, options: {})
184
+ def self.parse_poetry_lock(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
177
185
  manifest = Tomlrb.parse(file_contents)
178
186
  deps = []
179
187
  manifest["package"].each do |package|
180
188
  # next if group == "_meta"
181
- group = case package['category']
182
- when 'main'
183
- 'runtime'
184
- when 'dev'
185
- 'develop'
189
+ group = case package["category"]
190
+ when "dev"
191
+ "develop"
192
+ else
193
+ "runtime"
186
194
  end
187
195
 
188
196
  deps << {
189
- name: package['name'],
197
+ name: package["name"],
190
198
  requirement: map_requirements(package),
191
- type: group
199
+ type: group,
192
200
  }
193
201
  end
194
202
  deps
195
203
  end
196
204
 
197
- def self.parse_setup_py(file_contents, options: {})
205
+ def self.parse_setup_py(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
198
206
  match = file_contents.match(INSTALL_REGEXP)
199
207
  return [] unless match
200
208
  deps = []
@@ -204,8 +212,8 @@ module Bibliothecary
204
212
  next unless match
205
213
  deps << {
206
214
  name: match[1],
207
- requirement: match[-1] || '*',
208
- type: 'runtime'
215
+ requirement: match[-1] || "*",
216
+ type: "runtime",
209
217
  }
210
218
  end
211
219
  deps
@@ -221,22 +229,22 @@ module Bibliothecary
221
229
  # https://pip.pypa.io/en/stable/cli/pip_install/#requirement-specifiers
222
230
  # and https://pip.pypa.io/en/stable/topics/vcs-support/#git.
223
231
  # Invalid lines in requirements.txt are skipped.
224
- def self.parse_requirements_txt(file_contents, options: {})
232
+ def self.parse_requirements_txt(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
225
233
  deps = []
226
234
  type = case options[:filename]
227
235
  when /dev/ || /docs/ || /tools/
228
- 'development'
236
+ "development"
229
237
  when /test/
230
- 'test'
238
+ "test"
231
239
  else
232
- 'runtime'
240
+ "runtime"
233
241
  end
234
242
 
235
243
  file_contents.split("\n").each do |line|
236
- if line['://']
244
+ if line["://"]
237
245
  begin
238
246
  result = parse_requirements_txt_url(line)
239
- rescue URI::Error, NoEggSpecified => e
247
+ rescue URI::Error, NoEggSpecified
240
248
  next
241
249
  end
242
250
 
@@ -244,13 +252,13 @@ module Bibliothecary
244
252
  type: type
245
253
  )
246
254
  else
247
- match = line.delete(' ').match(REQUIREMENTS_REGEXP)
255
+ match = line.delete(" ").match(REQUIREMENTS_REGEXP)
248
256
  next unless match
249
257
 
250
258
  deps << {
251
259
  name: match[1],
252
- requirement: match[-1] || '*',
253
- type: type
260
+ requirement: match[-1] || "*",
261
+ type: type,
254
262
  }
255
263
  end
256
264
  end
@@ -281,7 +289,7 @@ module Bibliothecary
281
289
  # Simply parses out the name of a PEP 508 Dependency specification: https://peps.python.org/pep-0508/
282
290
  # Leaves the rest as-is with any leading semicolons or spaces stripped
283
291
  def self.parse_pep_508_dep_spec(dep)
284
- name, requirement = dep.split(PEP_508_NAME_REGEX, 2).last(2).map(&:strip)
292
+ name, requirement = dep.split(PEP_508_NAME_REGEXP, 2).last(2).map(&:strip)
285
293
  requirement = requirement.sub(/^[\s;]*/, "")
286
294
  requirement = "*" if requirement == ""
287
295
  return name, requirement
@@ -1,4 +1,4 @@
1
- require 'gemnasium/parser'
1
+ require "gemnasium/parser"
2
2
 
3
3
  module Bibliothecary
4
4
  module Parsers
@@ -13,20 +13,20 @@ module Bibliothecary
13
13
  def self.mapping
14
14
  {
15
15
  match_filenames("Gemfile", "gems.rb") => {
16
- kind: 'manifest',
16
+ kind: "manifest",
17
17
  parser: :parse_gemfile,
18
- related_to: [ 'manifest', 'lockfile' ]
18
+ related_to: [ "manifest", "lockfile" ],
19
19
  },
20
20
  match_extension(".gemspec") => {
21
- kind: 'manifest',
21
+ kind: "manifest",
22
22
  parser: :parse_gemspec,
23
- related_to: [ 'manifest', 'lockfile' ]
23
+ related_to: [ "manifest", "lockfile" ],
24
24
  },
25
25
  match_filenames("Gemfile.lock", "gems.locked") => {
26
- kind: 'lockfile',
26
+ kind: "lockfile",
27
27
  parser: :parse_gemfile_lock,
28
- related_to: [ 'manifest', 'lockfile' ]
29
- }
28
+ related_to: [ "manifest", "lockfile" ],
29
+ },
30
30
  }
31
31
  end
32
32
 
@@ -34,7 +34,7 @@ module Bibliothecary
34
34
  add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)
35
35
  add_multi_parser(Bibliothecary::MultiParsers::Spdx)
36
36
 
37
- def self.parse_gemfile_lock(file_contents, options: {})
37
+ def self.parse_gemfile_lock(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
38
38
  file_contents.lines(chomp: true).map do |line|
39
39
  match = line.match(NAME_VERSION_4)
40
40
  bundler_match = line.match(BUNDLED_WITH)
@@ -42,11 +42,11 @@ module Bibliothecary
42
42
 
43
43
  if match
44
44
  name = match[1]
45
- version = match[2].gsub(/\(|\)/,'')
45
+ version = match[2].gsub(/\(|\)/,"")
46
46
  {
47
47
  name: name,
48
48
  requirement: version,
49
- type: 'runtime'
49
+ type: "runtime",
50
50
  }
51
51
  else
52
52
  parse_bundler(file_contents)
@@ -54,12 +54,12 @@ module Bibliothecary
54
54
  end.compact
55
55
  end
56
56
 
57
- def self.parse_gemfile(file_contents, options: {})
57
+ def self.parse_gemfile(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
58
58
  manifest = Gemnasium::Parser.send(:gemfile, file_contents)
59
59
  parse_ruby_manifest(manifest)
60
60
  end
61
61
 
62
- def self.parse_gemspec(file_contents, options: {})
62
+ def self.parse_gemspec(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
63
63
  manifest = Gemnasium::Parser.send(:gemspec, file_contents)
64
64
  parse_ruby_manifest(manifest)
65
65
  end
@@ -71,9 +71,9 @@ module Bibliothecary
71
71
  return nil unless version
72
72
 
73
73
  {
74
- name: 'bundler',
74
+ name: "bundler",
75
75
  requirement: version,
76
- type: 'runtime'
76
+ type: "runtime",
77
77
  }
78
78
  end
79
79
  end
@@ -1,4 +1,4 @@
1
- require 'yaml'
1
+ require "yaml"
2
2
 
3
3
  module Bibliothecary
4
4
  module Parsers
@@ -8,35 +8,35 @@ module Bibliothecary
8
8
  def self.mapping
9
9
  {
10
10
  match_filename("shard.yml", case_insensitive: true) => {
11
- kind: 'manifest',
12
- parser: :parse_yaml_manifest
11
+ kind: "manifest",
12
+ parser: :parse_yaml_manifest,
13
13
  },
14
14
  match_filename("shard.lock", case_insensitive: true) => {
15
- kind: 'lockfile',
16
- parser: :parse_yaml_lockfile
17
- }
15
+ kind: "lockfile",
16
+ parser: :parse_yaml_lockfile,
17
+ },
18
18
  }
19
19
  end
20
20
 
21
21
  add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)
22
22
 
23
- def self.parse_yaml_lockfile(file_contents, options: {})
23
+ def self.parse_yaml_lockfile(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
24
24
  manifest = YAML.load file_contents
25
- map_dependencies(manifest, 'shards', 'runtime')
25
+ map_dependencies(manifest, "shards", "runtime")
26
26
  end
27
27
 
28
- def self.parse_yaml_manifest(file_contents, options: {})
28
+ def self.parse_yaml_manifest(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
29
29
  manifest = YAML.load file_contents
30
- map_dependencies(manifest, 'dependencies', 'runtime') +
31
- map_dependencies(manifest, 'development_dependencies', 'runtime')
30
+ map_dependencies(manifest, "dependencies", "runtime") +
31
+ map_dependencies(manifest, "development_dependencies", "runtime")
32
32
  end
33
33
 
34
34
  def self.map_dependencies(hash, key, type)
35
35
  hash.fetch(key,[]).map do |name, requirement|
36
36
  {
37
37
  name: name,
38
- requirement: requirement['version'] || '*',
39
- type: type
38
+ requirement: requirement["version"] || "*",
39
+ type: type,
40
40
  }
41
41
  end
42
42
  end
@@ -6,9 +6,9 @@ module Bibliothecary
6
6
  def self.mapping
7
7
  {
8
8
  match_filename("Package.swift", case_insensitive: true) => {
9
- kind: 'manifest',
10
- parser: :parse_package_swift
11
- }
9
+ kind: "manifest",
10
+ parser: :parse_package_swift,
11
+ },
12
12
  }
13
13
  end
14
14
 
@@ -16,17 +16,17 @@ module Bibliothecary
16
16
  add_multi_parser(Bibliothecary::MultiParsers::DependenciesCSV)
17
17
  add_multi_parser(Bibliothecary::MultiParsers::Spdx)
18
18
 
19
- def self.parse_package_swift(file_contents, options: {})
19
+ def self.parse_package_swift(file_contents, options: {}) # rubocop:disable Lint/UnusedMethodArgument
20
20
  response = Typhoeus.post("#{Bibliothecary.configuration.swift_parser_host}/to-json", body: file_contents)
21
21
  raise Bibliothecary::RemoteParsingError.new("Http Error #{response.response_code} when contacting: #{Bibliothecary.configuration.swift_parser_host}/to-json", response.response_code) unless response.success?
22
22
  json = JSON.parse(response.body)
23
23
  json["dependencies"].map do |dependency|
24
- name = dependency['url'].gsub(/^https?:\/\//, '').gsub(/\.git$/,'')
24
+ name = dependency["url"].gsub(/^https?:\/\//, "").gsub(/\.git$/,"")
25
25
  version = "#{dependency['version']['lowerBound']} - #{dependency['version']['upperBound']}"
26
26
  {
27
27
  name: name,
28
28
  requirement: version,
29
- type: 'runtime'
29
+ type: "runtime",
30
30
  }
31
31
  end
32
32
  end
@@ -16,6 +16,6 @@ module Bibliothecary
16
16
  "hex" => :hex,
17
17
  "nuget" => :nuget,
18
18
  "pypi" => :pypi,
19
- "swift" => :swift_pm
19
+ "swift" => :swift_pm,
20
20
  }.freeze
21
21
  end
@@ -6,7 +6,7 @@ module Bibliothecary
6
6
  def initialize(configuration)
7
7
  @configuration = configuration
8
8
  @options = {
9
- cache: {}
9
+ cache: {},
10
10
  }
11
11
  end
12
12
 
@@ -24,8 +24,8 @@ module Bibliothecary
24
24
  analyses = analyses.flatten.compact
25
25
 
26
26
  info_list.select { |info| info.package_manager.nil? }.each do |info|
27
- analyses.push(Bibliothecary::Analyser::create_error_analysis('unknown', info.relative_path, 'unknown',
28
- 'No parser for this file type'))
27
+ analyses.push(Bibliothecary::Analyser::create_error_analysis("unknown", info.relative_path, "unknown",
28
+ "No parser for this file type"))
29
29
  end
30
30
 
31
31
  analyses
@@ -178,4 +178,4 @@ module Bibliothecary
178
178
  end
179
179
  end
180
180
 
181
- require_relative './runner/multi_manifest_filter.rb'
181
+ require_relative "./runner/multi_manifest_filter.rb"
@@ -1,3 +1,3 @@
1
1
  module Bibliothecary
2
- VERSION = "8.7.3"
2
+ VERSION = "8.7.5"
3
3
  end
data/lib/bibliothecary.rb CHANGED
@@ -9,10 +9,10 @@ require "bibliothecary/purl_util"
9
9
  require "find"
10
10
  require "tomlrb"
11
11
 
12
- Dir[File.expand_path('../bibliothecary/multi_parsers/*.rb', __FILE__)].each do |file|
12
+ Dir[File.expand_path("../bibliothecary/multi_parsers/*.rb", __FILE__)].each do |file|
13
13
  require file
14
14
  end
15
- Dir[File.expand_path('../bibliothecary/parsers/*.rb', __FILE__)].each do |file|
15
+ Dir[File.expand_path("../bibliothecary/parsers/*.rb", __FILE__)].each do |file|
16
16
  require file
17
17
  end
18
18
 
@@ -80,7 +80,7 @@ module Bibliothecary
80
80
  string
81
81
  .dup # ensure we don't have a frozen string
82
82
  .force_encoding("UTF-8") # treat all strings as utf8
83
- .sub(/^\xEF\xBB\xBF/, '') # remove any Byte Order Marks so JSON, etc don't fail while parsing them.
83
+ .sub(/^\xEF\xBB\xBF/, "") # remove any Byte Order Marks so JSON, etc don't fail while parsing them.
84
84
  end
85
85
 
86
86
  class << self
data/lib/sdl_parser.rb CHANGED
@@ -1,18 +1,18 @@
1
- require 'sdl4r'
1
+ require "sdl4r"
2
2
 
3
3
  class SdlParser
4
4
  attr_reader :contents, :type
5
5
  def initialize(type, contents)
6
6
  @contents = contents
7
- @type = type || 'runtime'
7
+ @type = type || "runtime"
8
8
  end
9
9
 
10
10
  def dependencies
11
- parse.children('dependency').inject([]) do |deps, dep|
11
+ parse.children("dependency").inject([]) do |deps, dep|
12
12
  deps.push({
13
13
  name: dep.value,
14
- requirement: dep.attribute('version') || ">= 0",
15
- type: type
14
+ requirement: dep.attribute("version") || ">= 0",
15
+ type: type,
16
16
  })
17
17
  end.uniq
18
18
  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: 8.7.3
4
+ version: 8.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Nesbitt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-12-11 00:00:00.000000000 Z
11
+ date: 2024-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tomlrb