Skip to content

Commit

Permalink
IO#set_encoding should return self (fixes #4712)
Browse files Browse the repository at this point in the history
  • Loading branch information
MSNexploder committed Jul 11, 2017
1 parent 36e97c6 commit 4d1db6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ public IRubyObject internal_encoding(ThreadContext context) {
public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingObj) {
setEncoding(context, encodingObj, context.nil, context.nil);

return context.nil;
return this;
}

@JRubyMethod
Expand All @@ -1070,14 +1070,14 @@ public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingStrin
setEncoding(context, encodingString, internalEncoding, context.nil);
}

return context.nil;
return this;
}

@JRubyMethod
public IRubyObject set_encoding(ThreadContext context, IRubyObject encodingString, IRubyObject internalEncoding, IRubyObject options) {
setEncoding(context, encodingString, internalEncoding, options);

return context.nil;
return this;
}

// mri: io_encoding_set
Expand Down
1 change: 0 additions & 1 deletion spec/tags/ruby/core/io/set_encoding_tags.txt

This file was deleted.

0 comments on commit 4d1db6f

Please sign in to comment.