Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8a6cc24650dd
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e6150c68bb76
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 15, 2014

  1. added String#b method

    jkutner committed Dec 15, 2014
    Copy the full SHA
    facb858 View commit details

Commits on Dec 16, 2014

  1. Merge pull request #2327 from jkutner/jruby-1_7-missing-methods

    added String#b method
    headius committed Dec 16, 2014
    Copy the full SHA
    e6150c6 View commit details
Showing with 9 additions and 0 deletions.
  1. +9 −0 core/src/main/java/org/jruby/RubyString.java
9 changes: 9 additions & 0 deletions core/src/main/java/org/jruby/RubyString.java
Original file line number Diff line number Diff line change
@@ -7765,4 +7765,13 @@ public final int cat(byte[]bytes, int p, int len, Encoding enc, int ptr_cr) {

return cr2;
}

@JRubyMethod(name ="b", compat = RUBY2_0)
public IRubyObject b(ThreadContext context) {
Encoding encoding = ASCIIEncoding.INSTANCE;
RubyString dup = (RubyString)dup();
dup.associateEncoding(encoding);
dup.clearCodeRange();
return dup;
}
}