From 49b1923c6c4f3668195f7aa3f7c3bf2d6a93c2af Mon Sep 17 00:00:00 2001 From: Henrik Hodne Date: Sat, 3 Aug 2013 15:30:29 -0700 Subject: [PATCH] Fix character literals in documentation --- enum.c | 6 +++--- numeric.c | 2 +- string.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/enum.c b/enum.c index 8dd2451..78647c4 100644 --- a/enum.c +++ b/enum.c @@ -888,7 +888,7 @@ sort_by_cmp(const void *ap, const void *bp, void *data) * * files = Dir["*"] * sorted = files.sort { |a, b| - * test(?M, a) <=> test(?M, b) + * test(??M, a) <=> test(??M, b) * } * sorted #=> ["mon", "tues", "wed", "thurs"] * @@ -901,13 +901,13 @@ sort_by_cmp(const void *ap, const void *bp, void *data) * and then extract the filename from the result. * * sorted = Dir["*"].collect { |f| - * [test(?M, f), f] + * [test(??M, f), f] * }.sort.collect { |f| f[1] } * sorted #=> ["mon", "tues", "wed", "thurs"] * * This is exactly what sort_by does internally. * - * sorted = Dir["*"].sort_by { |f| test(?M, f) } + * sorted = Dir["*"].sort_by { |f| test(??M, f) } * sorted #=> ["mon", "tues", "wed", "thurs"] */ diff --git a/numeric.c b/numeric.c index 05035b7..806df98 100644 --- a/numeric.c +++ b/numeric.c @@ -2543,7 +2543,7 @@ int_chr(int argc, VALUE *argv, VALUE num) * * Returns the +int+ itself. * - * ?a.ord #=> 97 + * ??a.ord #=> 97 * * This method is intended for compatibility to character constant in Ruby * 1.9. diff --git a/string.c b/string.c index f101a94..a694fc3 100644 --- a/string.c +++ b/string.c @@ -2599,7 +2599,7 @@ rb_str_index(VALUE str, VALUE sub, long offset) * "hello".index('e') #=> 1 * "hello".index('lo') #=> 3 * "hello".index('a') #=> nil - * "hello".index(?e) #=> 1 + * "hello".index(??e) #=> 1 * "hello".index(/[aeiou]/, -3) #=> 4 */ @@ -2713,7 +2713,7 @@ rb_str_rindex(VALUE str, VALUE sub, long pos) * "hello".rindex('e') #=> 1 * "hello".rindex('l') #=> 3 * "hello".rindex('a') #=> nil - * "hello".rindex(?e) #=> 1 + * "hello".rindex(??e) #=> 1 * "hello".rindex(/[aeiou]/, -2) #=> 1 */ @@ -4443,7 +4443,7 @@ rb_str_reverse_bang(VALUE str) * * "hello".include? "lo" #=> true * "hello".include? "ol" #=> false - * "hello".include? ?h #=> true + * "hello".include? ??h #=> true */ static VALUE -- 1.8.3.3