From 9f70c5ab74005097debd822195a9ca5984138313 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Wed, 18 Dec 2024 22:20:20 -0600 Subject: [PATCH] More backticks --- core/src/main/java/org/jruby/RubyBignum.java | 4 ++-- core/src/main/java/org/jruby/RubyClass.java | 6 +++--- core/src/main/java/org/jruby/RubyFile.java | 2 +- core/src/main/java/org/jruby/RubyNumeric.java | 4 ++-- core/src/main/java/org/jruby/api/Convert.java | 2 +- core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java | 4 ++-- core/src/main/java/org/jruby/parser/RubyParserBase.java | 2 +- core/src/main/java/org/jruby/util/IOChannel.java | 2 +- core/src/main/java/org/jruby/util/cli/OutputStrings.java | 6 +++--- .../test/java/org/jruby/exceptions/TestRaiseException.java | 2 +- 10 files changed, 17 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/org/jruby/RubyBignum.java b/core/src/main/java/org/jruby/RubyBignum.java index 09f9c9ece00..14a1253073a 100644 --- a/core/src/main/java/org/jruby/RubyBignum.java +++ b/core/src/main/java/org/jruby/RubyBignum.java @@ -198,7 +198,7 @@ public static long big2long(RubyBignum val) { BigInteger big = val.value; if (big.compareTo(LONG_MIN) < 0 || big.compareTo(LONG_MAX) > 0) { - throw val.getRuntime().newRangeError("bignum too big to convert into `long'"); + throw val.getRuntime().newRangeError("bignum too big to convert into 'long'"); } return big.longValue(); } @@ -216,7 +216,7 @@ public static long big2ulong(RubyBignum value) { public static long big2ulong(Ruby runtime, BigInteger big) { if (big.compareTo(BigInteger.ZERO) < 0 || big.compareTo(ULONG_MAX) > 0) { - throw runtime.newRangeError("bignum out of range for `ulong'"); + throw runtime.newRangeError("bignum out of range for 'ulong'"); } return big.longValue(); diff --git a/core/src/main/java/org/jruby/RubyClass.java b/core/src/main/java/org/jruby/RubyClass.java index cdd4a6b86b4..5d8edb21a60 100644 --- a/core/src/main/java/org/jruby/RubyClass.java +++ b/core/src/main/java/org/jruby/RubyClass.java @@ -2856,7 +2856,7 @@ public IRubyObject smartLoadNewUser(IRubyObject target, IRubyObject data) { target.callMethod(context, "marshal_load", data); return target; } else { - throw typeError(context, "class ", this, " needs to have method `marshal_load'"); + throw typeError(context, "class ", this, " needs to have method 'marshal_load'"); } } else if (!(cache = searchWithCache("marshal_load")).method.isUndefined()) { @@ -2906,7 +2906,7 @@ public IRubyObject smartLoadOldUser(IRubyObject data) { if (method.call(context, this, cache.sourceModule, "respond_to?", asSymbol(context, "_load")).isTrue()) { return callMethod(context, "_load", data); } else { - throw typeError(context, "class ", this, " needs to have method `_load'"); + throw typeError(context, "class ", this, " needs to have method '_load'"); } } else if (!(cache = singleton.searchWithCache("_load")).method.isUndefined()) { // real _load defined, cache and call it @@ -2915,7 +2915,7 @@ public IRubyObject smartLoadOldUser(IRubyObject data) { } else { // provide an error, since it doesn't exist - throw typeError(context, "class ", this, " needs to have method `_load'"); + throw typeError(context, "class ", this, " needs to have method '_load'"); } } diff --git a/core/src/main/java/org/jruby/RubyFile.java b/core/src/main/java/org/jruby/RubyFile.java index cbf7036bfd5..f319a104823 100644 --- a/core/src/main/java/org/jruby/RubyFile.java +++ b/core/src/main/java/org/jruby/RubyFile.java @@ -2142,7 +2142,7 @@ private static StringBuilder appendSlash(final CharSequence canonicalPath) { private static RubyString checkHome(ThreadContext context) { IRubyObject home = context.runtime.getENV().fastARef(RubyString.newStringShared(context.runtime, RubyDir.HOME)); if (home == null || home == context.nil || ((RubyString) home).size() == 0) { - throw argumentError(context, "couldn't find HOME environment -- expanding `~'"); + throw argumentError(context, "couldn't find HOME environment -- expanding '~'"); } return (RubyString) home; } diff --git a/core/src/main/java/org/jruby/RubyNumeric.java b/core/src/main/java/org/jruby/RubyNumeric.java index 477d07ed630..49ee18d4fb4 100644 --- a/core/src/main/java/org/jruby/RubyNumeric.java +++ b/core/src/main/java/org/jruby/RubyNumeric.java @@ -190,9 +190,9 @@ public static void checkInt(IRubyObject arg, long num) { private static void checkIntFail(Ruby runtime, long num) { if (num < Integer.MIN_VALUE) { - throw runtime.newRangeError("integer " + num + " too small to convert to `int'"); + throw runtime.newRangeError("integer " + num + " too small to convert to 'int'"); } else { - throw runtime.newRangeError("integer " + num + " too big to convert to `int'"); + throw runtime.newRangeError("integer " + num + " too big to convert to 'int'"); } } diff --git a/core/src/main/java/org/jruby/api/Convert.java b/core/src/main/java/org/jruby/api/Convert.java index f86136346da..e7e7f0c1988 100644 --- a/core/src/main/java/org/jruby/api/Convert.java +++ b/core/src/main/java/org/jruby/api/Convert.java @@ -368,7 +368,7 @@ public static IRubyObject checkToString(ThreadContext context, IRubyObject obj) public static int checkInt(ThreadContext context, long num) { if (((int) num) != num) { throw rangeError(context, "integer " + num + - (num < Integer.MIN_VALUE ? " too small to convert to `int'" : " too big to convert to `int'")); + (num < Integer.MIN_VALUE ? " too small to convert to 'int'" : " too big to convert to 'int'")); } return (int) num; diff --git a/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java b/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java index c216f00ff67..4251488d057 100644 --- a/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java +++ b/core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java @@ -854,7 +854,7 @@ private int hereDocumentIdentifier() { private boolean arg_ambiguous(int c) { if (warnings.isVerbose() && Options.PARSER_WARN_AMBIGUOUS_ARGUMENTS.load()) { if (c == '/') { - warning(ID.AMBIGUOUS_ARGUMENT, "ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after `/' operator"); + warning(ID.AMBIGUOUS_ARGUMENT, "ambiguity between regexp and two divisions: wrap regexp in parentheses or add a space after '/' operator"); } else { warning(ID.AMBIGUOUS_ARGUMENT, "ambiguous first argument; put parentheses or a space even after '" + (char) c + "' operator"); } @@ -1594,7 +1594,7 @@ private int identifier(int c, boolean commandState) { if (!isIdentifierChar(c)) { StringBuilder builder = new StringBuilder(); Formatter formatter = new Formatter(builder, Locale.US); - formatter.format("Invalid char `\\x%02x' in expression", c & 0xff); + formatter.format("Invalid char '\\x%02x' in expression", c & 0xff); compile_error(builder.toString()); } diff --git a/core/src/main/java/org/jruby/parser/RubyParserBase.java b/core/src/main/java/org/jruby/parser/RubyParserBase.java index a40ca03fd8f..4d6b9c2631c 100644 --- a/core/src/main/java/org/jruby/parser/RubyParserBase.java +++ b/core/src/main/java/org/jruby/parser/RubyParserBase.java @@ -931,7 +931,7 @@ private boolean checkAssignmentInCondition(Node node) { if (node instanceof MultipleAsgnNode || node instanceof LocalAsgnNode || node instanceof DAsgnNode || node instanceof GlobalAsgnNode || node instanceof InstAsgnNode) { Node valueNode = ((AssignableNode) node).getValueNode(); if (isStaticContent(valueNode)) { - warning(ID.ASSIGNMENT_IN_CONDITIONAL, lexer.getFile(), valueNode.getLine(), "found `= literal' in conditional, should be =="); + warning(ID.ASSIGNMENT_IN_CONDITIONAL, lexer.getFile(), valueNode.getLine(), "found '= literal' in conditional, should be =="); } return true; } diff --git a/core/src/main/java/org/jruby/util/IOChannel.java b/core/src/main/java/org/jruby/util/IOChannel.java index 2b08e35f020..4f33dffc009 100644 --- a/core/src/main/java/org/jruby/util/IOChannel.java +++ b/core/src/main/java/org/jruby/util/IOChannel.java @@ -178,7 +178,7 @@ protected FunctionalCachingCallSite initWriteSite() { } else if (io.respondsTo("<<")) { return new FunctionalCachingCallSite("<<"); } else { - throw new IllegalArgumentException(io.getMetaClass() + "not coercible to " + getClass().getSimpleName() + ": no `write' method"); + throw new IllegalArgumentException(io.getMetaClass() + "not coercible to " + getClass().getSimpleName() + ": no 'write' method"); } } diff --git a/core/src/main/java/org/jruby/util/cli/OutputStrings.java b/core/src/main/java/org/jruby/util/cli/OutputStrings.java index 5428e012eef..49c3849ffa6 100644 --- a/core/src/main/java/org/jruby/util/cli/OutputStrings.java +++ b/core/src/main/java/org/jruby/util/cli/OutputStrings.java @@ -131,9 +131,9 @@ public static String getPropertyHelp() { .append("# These properties can be used to alter runtime behavior for performance\n") .append("# or compatibility.\n") .append("#\n") - .append("# Specify them by passing `-X=` to the jruby command,\n") - .append("# or put `=` in .jrubyrc. If passing to the java command,\n") - .append("# use the flag `-Djruby.=`\n") + .append("# Specify them by passing '-X=' to the jruby command,\n") + .append("# or put '=' in .jrubyrc. If passing to the java command,\n") + .append("# use the flag '-Djruby.='\n") .append("#\n") .append("# This output is the current settings as a valid .jrubyrc file.\n"); diff --git a/core/src/test/java/org/jruby/exceptions/TestRaiseException.java b/core/src/test/java/org/jruby/exceptions/TestRaiseException.java index a9c36b16d2f..3563af9c328 100644 --- a/core/src/test/java/org/jruby/exceptions/TestRaiseException.java +++ b/core/src/test/java/org/jruby/exceptions/TestRaiseException.java @@ -332,7 +332,7 @@ public void testRubyExceptionUsingEmbedAdapter() { evaler.eval(context.runtime, "no_method_with_this_name"); fail("expected to throw"); } catch (RaiseException re) { - assertEquals("(NameError) undefined local variable or method `no_method_with_this_name' for main:Object", re.getMessage()); + assertEquals("(NameError) undefined local variable or method 'no_method_with_this_name' for main:Object", re.getMessage()); } }