lib/bundler/audit/scanner.rb in bundler-audit-0.9.0.1 vs lib/bundler/audit/scanner.rb in bundler-audit-0.9.1
- old
+ new
@@ -1,7 +1,7 @@
#
-# Copyright (c) 2013-2021 Hal Brodigan (postmodern.mod3 at gmail.com)
+# Copyright (c) 2013-2022 Hal Brodigan (postmodern.mod3 at gmail.com)
#
# bundler-audit is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@@ -34,24 +34,25 @@
#
# Scans a `Gemfile.lock` for security issues.
#
class Scanner
- # The advisory database
+ # The advisory database.
#
# @return [Database]
attr_reader :database
# Project root directory
attr_reader :root
- # The parsed `Gemfile.lock` from the project
+ # The parsed `Gemfile.lock` from the project.
#
# @return [Bundler::LockfileParser]
attr_reader :lockfile
- # The configuration loaded from the `.bundler-audit.yml` file from the project
+ # The configuration loaded from the `.bundler-audit.yml` file from the
+ # project.
#
# @return [Hash]
attr_reader :config
#
@@ -215,11 +216,13 @@
# @since 0.4.0
#
def scan_specs(options={})
return enum_for(__method__,options) unless block_given?
- ignore = if options[:ignore] then Set.new(options[:ignore])
- else config.ignore
+ ignore = if options[:ignore]
+ Set.new(options[:ignore])
+ else
+ config.ignore
end
@lockfile.specs.each do |gem|
@database.check_gem(gem) do |advisory|
is_ignored = ignore.intersect?(advisory.identifiers.to_set)