Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Support Ruby 3.0 #217

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Drop Support Ruby 3.0 #217

wants to merge 10 commits into from

Conversation

Dakurei
Copy link
Contributor

@Dakurei Dakurei commented Apr 24, 2023

Summary

Pull request to drop support of Ruby 3.0 (Previously 2.7)

Base on PR #216


Changed

  • ⚠️ Drop support Ruby 3.0

Due to the fact that this version has reached the end of its life on March 31, 2024
image

  • Edit workflows github-pages, rspec, rubocop & yard

github-pages, rubocop & yard are executed on Ruby 3.1 environment
rspec is executed on Ruby 3.1, 3.2 and 3.3 environments
Drop support Ruby 3.0

  • Modification of the README

Drop support Ruby 3.0

  • Modification of gemspecs

Drop support Ruby 3.0
Constraint on Rubocop modified (from ~>1.48.0 to ~>1.64.0)
Constraint on Rspec modified (from ~>3.12.0 to ~>3.13.0)
Constraint on Rspec Junit Formatter modified (from ~>0.5.1 to ~>0.6.0)
Constraint on Simplecov modified (from ~>0.21.0 to ~>0.22.0)

  • Modification Rubocop config

Drop support Ruby 3.0
Add Rules

  • Modification of various files to fix Rubocop's warnings

examples/channel_overwrite.rb
lib/discordrb/bot.rb
lib/discordrb/commands/parser.rb
lib/discordrb/data/component.rb
lib/discordrb/data/embed.rb
lib/discordrb/data/emoji.rb
lib/discordrb/data/interaction.rb
lib/discordrb/data/member.rb
lib/discordrb/data/message.rb
lib/discordrb/data/reaction.rb
lib/discordrb/data/recipient.rb
lib/discordrb/data/server.rb
lib/discordrb/data/user.rb
lib/discordrb/light/data.rb
lib/discordrb/permissions.rb
lib/discordrb/voice/encoder.rb
spec/data/channel_spec.rb
spec/overwrite_spec.rb

@PanisSupraOmnia
Copy link
Member

If you could rebase this and update the dependencies again, I can give this a review!

@Dakurei
Copy link
Contributor Author

Dakurei commented Jun 3, 2023

Rebase done 👍

spec.add_development_dependency 'rspec-prof', '~> 0.0.7'
spec.add_development_dependency 'rubocop', '~> 1.36.0'
spec.add_development_dependency 'rubocop', '~> 1.48.0'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
spec.add_development_dependency 'rubocop', '~> 1.48.0'
spec.add_development_dependency 'rubocop', '~> 1.52.0'

Just need to update to the latest RuboCop version and apply any new changes it looks like.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though it looks like there's some false positives due to rubocop/rubocop#11915, so watch out for these.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd been on 1.36 for over 7 months, and in Rubocop's changelogs there are constant "false positives" and even "false negatives" between each version.

I just put the most recent one at a given time (when I started working on this PR), which solved the problems in Ruby 3.x

Not to mention that before this PR becomes part of "main", there'll be a certain amount of time in between. I'm not going to come back and increment the version number regularly, I'll do it if it's really necessary, but in due time.

Dakurei and others added 10 commits June 15, 2024 10:20
  + Rspec tasks (for Ruby 2.7.x, 3.0.x, 3.1.x, 3.2.x)
  + Rubocop task (with Ruby 2.7.x)
  + Yard & Github pages tasks (with Ruby 2.7.x)

  + Update rspec version constraint in discordrb.gemspec (from ~> 3.11.0 to ~> 3.12.0)
  + Update redcarpet version constraint in discordrb.gemspec (from ~> 3.5.0 to ~> 3.6.0)
  Finally, after doing my tests on the latest version of Rspec, and looking at the code, I realize that the modification was not necessary, and PixeLInc was right in his PR shardlab#199
  Contrary to what the documentation indicated, it was not possible to provide an Array<Overwrite> to Channel#permission_overwrites=

  It was necessary to provide the Hash similar to what the method Channel#permission_overwrites returns

  + Added an example file to test the overwrites (I used it as a debug)
  + Modification of a test in spec/data/channel_spec.rb following this correction
Fix typo and newlines

Co-authored-by: Adrien Smith <[email protected]>
@Dakurei Dakurei changed the title Drop Support Ruby 2.7 Drop Support Ruby 3.0 Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants