Skip to content

Commit

Permalink
Fix YARD documentation issues
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mudge committed Dec 6, 2023
1 parent 9cbc012 commit 8e94afb
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ext/re2/re2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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")
* #=> #<RE2::Scanner:0x0000000000000001>
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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\?"
Expand Down
1 change: 1 addition & 0 deletions lib/re2/regexp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/re2/scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/re2/string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions lib/re2/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8e94afb

Please sign in to comment.