We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e326763 + f891038 commit 3a83394Copy full SHA for 3a83394
.github/workflows/test.yml
@@ -12,7 +12,7 @@ jobs:
12
test:
13
strategy:
14
matrix:
15
- ruby_version: [2.5, 2.6, 2.7, '3.0', 3.1, 3.2, 3.3]
+ ruby_version: [3.1, 3.2, 3.3]
16
runs-on: ubuntu-latest
17
steps:
18
- uses: actions/checkout@v2
@@ -21,8 +21,6 @@ jobs:
21
with:
22
ruby-version: ${{ matrix.ruby_version }}
23
bundler-cache: true
24
- - name: Install dependencies
25
- run: bundle install --jobs=3 --retry=3
26
- name: Initialize submodule
27
run: git submodule update --init
28
- name: Run tests
.rubocop.yml
@@ -1,8 +1,11 @@
1
AllCops:
2
- TargetRubyVersion: 2.5
+ TargetRubyVersion: 3.1
3
NewCops: enable
4
SuggestExtensions: false
5
6
+Gemspec/DevelopmentDependencies:
7
+ EnforcedStyle: gemspec
8
+
9
Layout/LineLength:
10
Exclude:
11
- 'ruby_audit.gemspec'
@@ -11,7 +14,7 @@ Metrics/MethodLength:
Max: 15
Metrics/BlockLength:
- IgnoredMethods:
+ AllowedMethods:
- describe
19
20
Style/Documentation:
.ruby-version
@@ -1 +1 @@
-3.3.0
+3.3.1
CHANGELOG.md
@@ -5,6 +5,16 @@ This project adheres to [Semantic Versioning](http://semver.org/).
## [Unreleased]
+### Changed
+* Bumped Rubocop dependency to 1.64.0
+* Require MFA for rubygems operations
+### Removed
+* Removed support for Ruby 2.5 through 3.0
+* Removed Timecop dependency
## [2.3.1] - 2024-05-17
### Removed
@@ -108,7 +118,8 @@ Look for rubygems advisories in the correct directory of the ruby-advisory-db
108
118
109
119
* Initial Release
110
120
111
-[Unreleased]: https://github.com/civisanalytics/ruby_audit/compare/v2.3.0...HEAD
121
+[Unreleased]: https://github.com/civisanalytics/ruby_audit/compare/v2.3.1...HEAD
122
+[2.3.1]: https://github.com/civisanalytics/ruby_audit/compare/v2.3.0...v2.3.1
112
123
[2.3.0]: https://github.com/civisanalytics/ruby_audit/compare/v2.2.0...v2.3.0
113
124
[2.2.0]: https://github.com/civisanalytics/ruby_audit/compare/v2.1.0...v2.2.0
114
125
[2.1.0]: https://github.com/civisanalytics/ruby_audit/compare/v2.0.0...v2.1.0
README.md
@@ -57,7 +57,7 @@ $ ruby-audit check -n
57
58
After checking out the repo, run `bin/setup` to install dependencies.
59
You'll also want to run `git submodule update --init` to populate the ruby-advisory-db
60
-submodule in `/vendor` that is used for testing. Then, run `rake spec` to run the tests.
+submodule in `/vendor` that is used for testing. Then, run `rake` to run linting and tests.
61
You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
63
The database in `/vendor/ruby-advisory-db` is only used as a fixture for unit tests.
lib/ruby_audit/database.rb
@@ -10,12 +10,12 @@ def advisories_for(name, type)
end
- def check_ruby(ruby, &block)
- check(ruby, 'rubies', &block)
+ def check_ruby(ruby, &)
+ check(ruby, 'rubies', &)
- def check_rubygems(rubygems, &block)
- check(rubygems, 'gems', &block)
+ def check_rubygems(rubygems, &)
+ check(rubygems, 'gems', &)
def check(object, type = 'gems')
@@ -28,12 +28,12 @@ def check(object, type = 'gems')
29
protected
30
31
- def each_advisory_path(&block)
32
- Dir.glob(File.join(@path, '{gems,rubies}', '*', '*.yml'), &block)
+ def each_advisory_path(&)
+ Dir.glob(File.join(@path, '{gems,rubies}', '*', '*.yml'), &)
33
34
35
- def each_advisory_path_for(name, type = 'gems', &block)
36
- Dir.glob(File.join(@path, type, name, '*.yml'), &block)
+ def each_advisory_path_for(name, type = 'gems', &)
+ Dir.glob(File.join(@path, type, name, '*.yml'), &)
37
38
39
lib/ruby_audit/scanner.rb
@@ -25,19 +25,19 @@ def scan(options = {}, &block)
self
- def scan_ruby(options = {}, &block)
+ def scan_ruby(options = {}, &)
version = if RUBY_PATCHLEVEL < 0
ruby_version
else
"#{RUBY_VERSION}.#{RUBY_PATCHLEVEL}"
specs = [Version.new(RUBY_ENGINE, version)]
- scan_inner(specs, 'ruby', options, &block)
+ scan_inner(specs, 'ruby', options, &)
- def scan_rubygems(options = {}, &block)
+ def scan_rubygems(options = {}, &)
specs = [Version.new('rubygems-update', rubygems_version)]
40
- scan_inner(specs, 'rubygems', options, &block)
+ scan_inner(specs, 'rubygems', options, &)
41
42
43
private
@@ -61,7 +61,7 @@ def scan_inner(specs, type, options = {})
ignore += options[:ignore] if options[:ignore]
specs.each do |spec|
64
- @database.send("check_#{type}".to_sym, spec) do |advisory|
+ @database.send(:"check_#{type}", spec) do |advisory|
65
unless ignore.intersect?(advisory.identifiers.to_set)
66
yield Bundler::Audit::Results::UnpatchedGem.new(spec, advisory)
67
ruby_audit.gemspec
@@ -7,6 +7,7 @@ Gem::Specification.new do |spec|
spec.version = RubyAudit::VERSION
spec.authors = ['Jeff Cousens, Mike Saelim', 'John Zhang', 'Cristina Muñoz']
spec.email = ['opensource@civisanalytics.com']
+ spec.metadata['rubygems_mfa_required'] = 'true'
spec.summary = 'Checks Ruby and RubyGems against known vulnerabilities.'
spec.description = 'RubyAudit checks your current version of Ruby and ' \
@@ -17,7 +18,7 @@ Gem::Specification.new do |spec|
spec.homepage = 'https://github.com/civisanalytics/ruby_audit'
spec.license = 'GPL-3.0-or-later'
- spec.required_ruby_version = ['>= 2.5', '< 3.4']
+ spec.required_ruby_version = ['>= 3.1', '< 3.4']
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -27,6 +28,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'pry', '~> 0.14.1'
spec.add_development_dependency 'rake', '~> 13.0'
spec.add_development_dependency 'rspec', '~> 3.9'
- spec.add_development_dependency 'rubocop', '~> 1.9.1'
- spec.add_development_dependency 'timecop', '~> 0.9.1'
+ spec.add_development_dependency 'rubocop', '~> 1.64.0'
spec/database_spec.rb
@@ -17,7 +17,7 @@
advisory.is_a?(Bundler::Audit::Advisory)
end).to be_truthy
expect(advisories.map(&:id)).to include('CVE-2015-3900')
- expect(advisories.map(&:path).reject { |p| p =~ /rubygems-update/ })
+ expect(advisories.map(&:path).grep_v(/rubygems-update/))
.to be_empty
@@ -45,7 +45,7 @@
45
46
47
expect(advisories.map(&:id)).to include('CVE-2015-1855')
48
- expect(advisories.map(&:path).reject { |p| p =~ /rubies/ }).to be_empty
+ expect(advisories.map(&:path).grep_v(/rubies/)).to be_empty
49
50
51
spec/spec_helper.rb
@@ -1,7 +1,6 @@
$LOAD_PATH.unshift File.expand_path('../lib', __dir__)
require 'pry'
require 'ruby_audit'
-require 'timecop'
RSpec.configure do |config|
config.before(:each) do
0 commit comments