Skip to content

Commit

Permalink
restore non-rest casemapping methods
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex committed Apr 9, 2018
1 parent b0fefa9 commit 005fc40
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
32 changes: 32 additions & 0 deletions core/src/main/java/org/jruby/RubyString.java
Expand Up @@ -1785,6 +1785,14 @@ public IRubyObject upcase_bang(ThreadContext context) {
return upcase_bang19(context, RubyObject.NULL_ARRAY);
}

public RubyString upcase19(ThreadContext context) {
return upcase19(context, RubyObject.NULL_ARRAY);
}

public IRubyObject upcase_bang19(ThreadContext context) {
return upcase_bang19(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(name = "upcase", rest = true)
public RubyString upcase19(ThreadContext context, IRubyObject[] args) {
RubyString str = strDup(context.runtime);
Expand Down Expand Up @@ -1834,6 +1842,14 @@ public IRubyObject downcase_bang19(ThreadContext context) {
return downcase_bang(context, RubyObject.NULL_ARRAY);
}

public RubyString downcase(ThreadContext context) {
return downcase(context, RubyObject.NULL_ARRAY);
}

public IRubyObject downcase_bang(ThreadContext context) {
return downcase_bang(context, RubyObject.NULL_ARRAY);
}

/** rb_str_downcase / rb_str_downcase_bang
*
*/
Expand Down Expand Up @@ -1888,6 +1904,14 @@ public IRubyObject swapcase_bang(ThreadContext context) {
return swapcase_bang19(context, RubyObject.NULL_ARRAY);
}

public RubyString swapcase19(ThreadContext context) {
return swapcase19(context, RubyObject.NULL_ARRAY);
}

public IRubyObject swapcase_bang19(ThreadContext context) {
return swapcase_bang19(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(name = "swapcase", rest = true)
public RubyString swapcase19(ThreadContext context, IRubyObject[] args) {
RubyString str = strDup(context.runtime);
Expand Down Expand Up @@ -1925,6 +1949,14 @@ public IRubyObject capitalize_bang(ThreadContext context) {
return capitalize_bang19(context, RubyObject.NULL_ARRAY);
}

public IRubyObject capitalize19(ThreadContext context) {
return capitalize19(context, RubyObject.NULL_ARRAY);
}

public IRubyObject capitalize_bang19(ThreadContext context) {
return capitalize_bang19(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(name = "capitalize", rest = true)
public IRubyObject capitalize19(ThreadContext context, IRubyObject[] args) {
RubyString str = strDup(context.runtime);
Expand Down
16 changes: 16 additions & 0 deletions core/src/main/java/org/jruby/RubySymbol.java
Expand Up @@ -457,24 +457,40 @@ public IRubyObject empty_p(ThreadContext context) {
return newShared(context.runtime).empty_p(context);
}

public IRubyObject upcase(ThreadContext context) {
return upcase(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(rest = true)
public IRubyObject upcase(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
return newSymbol(runtime, newShared(runtime).upcase19(context, args).getByteList());
}

public IRubyObject downcase(ThreadContext context) {
return downcase(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(rest = true)
public IRubyObject downcase(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
return newSymbol(runtime, newShared(runtime).downcase(context, args).getByteList());
}

public IRubyObject capitalize(ThreadContext context) {
return capitalize(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(rest = true)
public IRubyObject capitalize(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
return newSymbol(runtime, ((RubyString) newShared(runtime).capitalize19(context, args)).getByteList());
}

public IRubyObject swapcase(ThreadContext context) {
return swapcase(context, RubyObject.NULL_ARRAY);
}

@JRubyMethod(rest = true)
public IRubyObject swapcase(ThreadContext context, IRubyObject[] args) {
Ruby runtime = context.runtime;
Expand Down

0 comments on commit 005fc40

Please sign in to comment.