Skip to content

Commit

Permalink
Merge pull request jruby#7996 from enebo/printf_temp_fixes
Browse files Browse the repository at this point in the history
Add %aA for printf and friends
  • Loading branch information
enebo authored Nov 2, 2023
2 parents edf1eea + 917474d commit 931c4fc
Show file tree
Hide file tree
Showing 8 changed files with 307 additions and 272 deletions.
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ private static long other2long(IRubyObject arg) throws RaiseException {
if (arg.isNil()) {
throw arg.getRuntime().newTypeError("no implicit conversion from nil to integer");
}
return arg.convertToInteger().getLongValue();

return ((RubyInteger) TypeConverter.convertToType(arg, arg.getRuntime().getInteger(), "to_int")).getLongValue();
}

public static long float2long(RubyFloat flt) {
Expand Down
356 changes: 305 additions & 51 deletions core/src/main/java/org/jruby/util/Sprintf.java

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions spec/tags/ruby/core/file/printf_tags.txt

This file was deleted.

54 changes: 0 additions & 54 deletions spec/tags/ruby/core/kernel/printf_tags.txt

This file was deleted.

57 changes: 0 additions & 57 deletions spec/tags/ruby/core/kernel/sprintf_tags.txt

This file was deleted.

28 changes: 0 additions & 28 deletions spec/tags/ruby/core/string/modulo_tags.txt

This file was deleted.

27 changes: 0 additions & 27 deletions spec/tags/ruby/core/string/percent_tags.txt

This file was deleted.

Loading

0 comments on commit 931c4fc

Please sign in to comment.