ruby / date

A subclass of Object includes Comparable module for handling dates.
Other
70 stars 35 forks source link

Match only non-empty version string #44

Closed Maumagnaguagno closed 2 years ago

Maumagnaguagno commented 2 years ago

The current regular expression accepts empty version strings, VERSION = '', and extra characters until the final string delimiter character, even after a comment, VERSION = '3.2.1' # comment'. Currently the VERSION line is VERSION = '3.2.1' # :nodoc:, which means another string delimiter may appear in the comment in the future.

nobu commented 2 years ago

I don't think there will be the other than that rdoc directive.

Maumagnaguagno commented 2 years ago

Okay, my fear was that someone could add more comments after the directive with a quote, or even forget VERSION with an empty string. I will close the PR as this is very unlikely.