Skip to content

Commit

Permalink
Drop support for Ruby 3.0 (EOL) (#175)
Browse files Browse the repository at this point in the history
* Drop support for Ruby 3.0 (EOL)

* Adopt Ruby 3.1+ Array#intersect?

* Adopt Ruby 3.1+ implicit hash syntax
  • Loading branch information
mattbrictson committed Apr 28, 2024
1 parent 93fa39f commit 67b6817
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3", "head"]
ruby: ["3.1", "3.2", "3.3", "head"]
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
NewCops: enable
TargetRubyVersion: 3.0
TargetRubyVersion: 3.1
Exclude:
- "tmp/**/*"
- "vendor/**/*"
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Example Owner
Copyright (c) 2024 Example Owner

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion example.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
spec.summary = ""
spec.homepage = "https://github.com/mattbrictson/gem"
spec.license = "MIT"
spec.required_ruby_version = ">= 3.0"
spec.required_ruby_version = ">= 3.1"

spec.metadata = {
"bug_tracker_uri" => "https://github.com/mattbrictson/gem/issues",
Expand Down
2 changes: 1 addition & 1 deletion lib/example/thor_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def handle_help_switches(given_args)

if given_args.first == "help"
retry_with_args = ["help"] if given_args.length > 1
elsif (e.unknown & %w[-h --help]).any?
elsif e.unknown.intersect?(%w[-h --help])
retry_with_args = ["help", (given_args - e.unknown).first]
end
raise unless retry_with_args.any?
Expand Down
4 changes: 2 additions & 2 deletions rename_template.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def ask(question, default: nil, echo: true)

def ask_yes_or_no(question, default: "N")
default = default == "Y" ? "Y/n" : "y/N"
answer = ask(question, default: default)
answer = ask(question, default:)

answer != "y/N" && answer.match?(/^y/i)
end
Expand All @@ -194,7 +194,7 @@ def read_git_data

{
origin_repo_name: origin_repo_path&.split("/")&.last,
origin_repo_path: origin_repo_path,
origin_repo_path:,
user_email: git("config", "user.email").chomp,
user_name: git("config", "user.name").chomp
}
Expand Down

0 comments on commit 67b6817

Please sign in to comment.