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: fd87e0b21b33
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8557d9711509
Choose a head ref
  • 2 commits
  • 4 files changed
  • 1 contributor

Commits on Nov 19, 2014

  1. Copy the full SHA
    3f6e542 View commit details
  2. Copy the full SHA
    8557d97 View commit details
44 changes: 44 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/EncodingNodes.java
Original file line number Diff line number Diff line change
@@ -79,6 +79,50 @@ public RubyEncoding defaultInternal() {

}

@CoreMethod(names = "default_external=", onSingleton = true, required = 1)
public abstract static class SetDefaultExternalNode extends CoreMethodNode {

public SetDefaultExternalNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public SetDefaultExternalNode(SetDefaultExternalNode prev) {
super(prev);
}

@Specialization
public RubyEncoding defaultExternal(RubyEncoding encoding) {
notDesignedForCompilation();

getContext().getRuntime().setDefaultExternalEncoding(encoding.getEncoding());

return encoding;
}

}

@CoreMethod(names = "default_internal=", onSingleton = true, required = 1)
public abstract static class SetDefaultInternalNode extends CoreMethodNode {

public SetDefaultInternalNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public SetDefaultInternalNode(SetDefaultInternalNode prev) {
super(prev);
}

@Specialization
public RubyEncoding defaultExternal(RubyEncoding encoding) {
notDesignedForCompilation();

getContext().getRuntime().setDefaultInternalEncoding(encoding.getEncoding());

return encoding;
}

}

@CoreMethod(names = "find", onSingleton = true, required = 1)
public abstract static class FindNode extends CoreMethodNode {

Original file line number Diff line number Diff line change
@@ -291,8 +291,8 @@ public void initializeAfterMethodsAdded() {
globalVariablesObject.setInstanceVariable("$stdout", stdout);

objectClass.setConstant(null, "STDIN", new RubyBasicObject(objectClass));
objectClass.setConstant(null, "STDOUT", globalVariablesObject.getInstanceVariable("$stdout"));
objectClass.setConstant(null, "STDERR", globalVariablesObject.getInstanceVariable("$stdout"));
objectClass.setConstant(null, "STDOUT", stdout);
objectClass.setConstant(null, "STDERR", stdout);
objectClass.setConstant(null, "RUBY_RELEASE_DATE", context.makeString(Constants.COMPILE_DATE));
objectClass.setConstant(null, "RUBY_DESCRIPTION", context.makeString(OutputStrings.getVersionString()));

4 changes: 4 additions & 0 deletions core/src/main/ruby/jruby/truffle/core/kernel.rb
Original file line number Diff line number Diff line change
@@ -35,6 +35,10 @@ def puts(*args)

end

def STDOUT.internal_encoding
nil # FIXME
end

# Here temporarily while we adapt to the newly imported specs

class Channel
4 changes: 0 additions & 4 deletions spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -38,11 +38,7 @@ fails:The predefined global constants includes TOPLEVEL_BINDING
fails:The predefined global constant STDERR has nil for the external encoding despite Encoding.default_external being changed
fails:The predefined global constant STDERR has the encodings set by #set_encoding
fails:The predefined global constant ARGV contains Strings encoded in locale Encoding
fails:The predefined global constant STDERR has nil for the internal encoding despite Encoding.default_internal being changed
fails:The predefined global constant STDERR has nil for the internal encoding
fails:The predefined global constant STDERR has nil for the external encoding
fails:The predefined global constant STDOUT has nil for the internal encoding despite Encoding.default_internal being changed
fails:The predefined global constant STDOUT has nil for the internal encoding
fails:The predefined global constant STDOUT has the encodings set by #set_encoding
fails:The predefined global constant STDOUT has nil for the external encoding despite Encoding.default_external being changed
fails:The predefined global constant STDOUT has nil for the external encoding