From 8e94afb1c326b8d811183f4eeca628323c23b55a Mon Sep 17 00:00:00 2001 From: Paul Mucur Date: Wed, 6 Dec 2023 20:11:02 +0000 Subject: [PATCH] Fix YARD documentation issues Specifically, ensure we use two newlines between the copyright header and any code so YARD doesn't use it as an overview and correct the `@raise` tag name. --- ext/re2/re2.cc | 8 ++++---- lib/re2/regexp.rb | 1 + lib/re2/scanner.rb | 1 + lib/re2/string.rb | 1 + lib/re2/version.rb | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ext/re2/re2.cc b/ext/re2/re2.cc index 60aedaa..7923e9b 100644 --- a/ext/re2/re2.cc +++ b/ext/re2/re2.cc @@ -1588,7 +1588,7 @@ static VALUE re2_regexp_full_match_p(const VALUE self, VALUE text) { * * @param [text] text the text to scan incrementally * @return [RE2::Scanner] an `Enumerable` {RE2::Scanner} object - * @raises [TypeError] if `text` cannot be coerced to a `String` + * @raise [TypeError] if `text` cannot be coerced to a `String` * @example * c = RE2::Regexp.new('(\w+)').scan("Foo bar baz") * #=> # @@ -1652,7 +1652,7 @@ static VALUE re2_regexp_match_has_endpos_argument_p(VALUE) { * @param [String, RE2::Regexp] pattern a regexp matching text to be replaced * @param [String] rewrite the string to replace with * @return [String] the resulting string - * @raises [TypeError] if the given rewrite or pattern (if not provided as a + * @raise [TypeError] if the given rewrite or pattern (if not provided as a * {RE2::Regexp}) cannot be coerced to `String`s * @example * RE2.Replace("hello there", "hello", "howdy") #=> "howdy there" @@ -1700,7 +1700,7 @@ static VALUE re2_Replace(VALUE, VALUE str, VALUE pattern, * @param [String] str the string to modify * @param [String, RE2::Regexp] pattern a regexp matching text to be replaced * @param [String] rewrite the string to replace with - * @raises [TypeError] if the given rewrite or pattern (if not provided as a + * @raise [TypeError] if the given rewrite or pattern (if not provided as a * {RE2::Regexp}) cannot be coerced to `String`s * @return [String] the resulting string * @example @@ -1745,7 +1745,7 @@ static VALUE re2_GlobalReplace(VALUE, VALUE str, VALUE pattern, * exactly match the original string. * * @param [String] unquoted the unquoted string - * @raises [TypeError] if the given unquoted string cannot be coerced to a `String` + * @raise [TypeError] if the given unquoted string cannot be coerced to a `String` * @return [String] the escaped string * @example * RE2::Regexp.escape("1.5-2.0?") #=> "1\.5\-2\.0\?" diff --git a/lib/re2/regexp.rb b/lib/re2/regexp.rb index eb50f43..1d328fe 100644 --- a/lib/re2/regexp.rb +++ b/lib/re2/regexp.rb @@ -6,6 +6,7 @@ # Copyright (c) 2010, Paul Mucur (https://mudge.name) # Released under the BSD Licence, please see LICENSE.txt + module RE2 class Regexp # Match the pattern against any substring of the given `text` and return a diff --git a/lib/re2/scanner.rb b/lib/re2/scanner.rb index 1ed84ef..bf76220 100644 --- a/lib/re2/scanner.rb +++ b/lib/re2/scanner.rb @@ -6,6 +6,7 @@ # Copyright (c) 2010, Paul Mucur (https://mudge.name) # Released under the BSD Licence, please see LICENSE.txt + module RE2 class Scanner include Enumerable diff --git a/lib/re2/string.rb b/lib/re2/string.rb index 6ee5308..bf9aa1c 100644 --- a/lib/re2/string.rb +++ b/lib/re2/string.rb @@ -9,6 +9,7 @@ require "re2" module RE2 + # @deprecated Use methods on {RE2} and {RE2::Regexp} instead. module String # @deprecated Use {RE2.Replace} instead. def re2_sub(*args) diff --git a/lib/re2/version.rb b/lib/re2/version.rb index 9a2edfe..a63359d 100644 --- a/lib/re2/version.rb +++ b/lib/re2/version.rb @@ -8,6 +8,7 @@ # Copyright (c) 2010, Paul Mucur (https://mudge.name) # Released under the BSD Licence, please see LICENSE.txt + module RE2 VERSION = "2.5.0" end