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

Update stdlib for the Ruby 3.0 #5164

Merged
merged 2 commits into from Nov 24, 2021
Merged

Update stdlib for the Ruby 3.0 #5164

merged 2 commits into from Nov 24, 2021

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Nov 24, 2021

No description provided.

@@ -1,7 +1,12 @@
# frozen_string_literal: true

version = File.foreach(File.expand_path("../lib/date.rb", __FILE__)).find do |line|
/^\s*VERSION\s*=\s*["'](.*)["']/ =~ line and break $1
Copy link
Contributor

Choose a reason for hiding this comment

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

This regular expression accepts empty versions, such as VERSION = ''.
Maybe it should only accept non-empty groups with (.+) or ([^'"]+).
The last version could be simplified to /^\s*VERSION\s*=\s*["']([^'"]+)/.

Copy link
Member Author

Choose a reason for hiding this comment

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

Can you suggest it to https://github.com/ruby/date ? Thanks.

@hsbt hsbt added the Backport label Nov 24, 2021
@nagachika nagachika merged commit d1e3dd4 into ruby:ruby_3_0 Nov 24, 2021
@hsbt hsbt deleted the update-20211124-ruby_3_0 branch November 25, 2021 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants