Skip to content

Commit

Permalink
drop support for ruby 2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mlinksva committed Dec 19, 2022
1 parent 1fdf021 commit a26a408
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.5, 2.6, 2.7, 3.0, 3.1, 3.2]
ruby: [2.6, 2.7, 3.0, 3.1, 3.2]

steps:
- uses: actions/checkout@v3
Expand Down
5 changes: 1 addition & 4 deletions .rubocop.yml
Expand Up @@ -5,7 +5,7 @@ require:
- rubocop-rspec

AllCops:
TargetRubyVersion: 2.5
TargetRubyVersion: 2.6
NewCops: enable
Exclude:
- tmp/**/*
Expand All @@ -18,7 +18,4 @@ Layout/HashAlignment:
EnforcedColonStyle: table

RSpec/FactoryBot/CreateList:
Enabled: false

Style/SafeNavigation:
Enabled: false
26 changes: 11 additions & 15 deletions .rubocop_todo.yml
@@ -1,34 +1,28 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-09-25 23:25:26 UTC using RuboCop version 1.28.2.
# on 2022-12-19 01:26:39 UTC using RuboCop version 1.40.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 8
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Max: 84

# Offense count: 67
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# IgnoredMethods: refine
Metrics/BlockLength:
Max: 424

# Offense count: 2
# Configuration parameters: CountComments, CountAsOne.
Metrics/ClassLength:
Max: 181

# Offense count: 2
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/CyclomaticComplexity:
Max: 20

# Offense count: 9
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/MethodLength:
Max: 45

Expand All @@ -38,19 +32,19 @@ Metrics/ModuleLength:
Max: 262

# Offense count: 2
# Configuration parameters: IgnoredMethods.
# Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
Metrics/PerceivedComplexity:
Max: 21

# Offense count: 3
# This cop supports safe auto-correction (--auto-correct).
# This cop supports unsafe autocorrection (--autocorrect-all).
Performance/UnfreezeString:
Exclude:
- 'spec/licensee/matchers/copyright_matcher_spec.rb'
- 'spec/licensee/project_files/license_file_spec.rb'

# Offense count: 163
# Configuration parameters: Prefixes.
# Configuration parameters: Prefixes, AllowedPatterns.
# Prefixes: when, with, without
RSpec/ContextWording:
Enabled: false
Expand Down Expand Up @@ -95,11 +89,13 @@ RSpec/MultipleMemoizedHelpers:
Max: 16

# Offense count: 286
# Configuration parameters: IgnoreSharedExamples.
# Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
# SupportedStyles: always, named_only
RSpec/NamedSubject:
Enabled: false

# Offense count: 65
# Configuration parameters: AllowedGroups.
RSpec/NestedGroups:
Max: 6

Expand All @@ -126,7 +122,7 @@ Style/Documentation:
Enabled: false

# Offense count: 3
# This cop supports safe auto-correction (--auto-correct).
# This cop supports unsafe autocorrection (--autocorrect-all).
Style/StructInheritance:
Exclude:
- 'lib/licensee/license_field.rb'
Expand Down
2 changes: 1 addition & 1 deletion lib/licensee/license.rb
Expand Up @@ -74,7 +74,7 @@ def licenses
end

def keys_licenses(options = {})
@keys_licenses[options] ||= all(options).map { |l| [l.key, l] }.to_h
@keys_licenses[options] ||= all(options).to_h { |l| [l.key, l] }
end
end

Expand Down
2 changes: 1 addition & 1 deletion licensee.gemspec
Expand Up @@ -37,7 +37,7 @@ Gem::Specification.new do |gem|
gem.add_development_dependency('simplecov', '~> 0.16')
gem.add_development_dependency('webmock', '~> 3.1')

gem.required_ruby_version = '>= 2.5'
gem.required_ruby_version = '>= 2.6'

# ensure the gem is built out of versioned files
gem.files = Dir[
Expand Down
2 changes: 1 addition & 1 deletion script/hash-licenses
Expand Up @@ -7,7 +7,7 @@ require 'json'
require_relative '../lib/licensee'

licenses = Licensee::License.all(hidden: true, pseudo: false)
hashes = licenses.map { |l| [l.key, l.content_hash] }.to_h
hashes = licenses.to_h { |l| [l.key, l.content_hash] }
content = JSON.pretty_generate(hashes)
path = File.expand_path '../spec/fixtures/license-hashes.json', __dir__

Expand Down
2 changes: 1 addition & 1 deletion spec/fixture_spec.rb
Expand Up @@ -33,7 +33,7 @@
end

it 'returns the expected hash' do
hash = license_file ? license_file.content_hash : nil
hash = license_file&.content_hash
expect(hash).to eql(expectations['hash'])
end

Expand Down

0 comments on commit a26a408

Please sign in to comment.