Skip to content

Commit

Permalink
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -11,3 +11,4 @@ windows:The predefined global constant STDOUT has the encodings set by #set_enco
windows:The predefined global constant STDERR has the encodings set by #set_encoding
fails:Predefined global $_ is set to the last line read by e.g. StringIO#gets
fails:Predefined global $_ is set at the method-scoped level rather than block-scoped
fails:Global variable $0 actually sets the program name
Original file line number Diff line number Diff line change
@@ -20,6 +20,7 @@
import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.RubyGC;
import org.jruby.ext.rbconfig.RbConfigLibrary;
import org.jruby.truffle.runtime.DebugOperations;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyCallStack;
@@ -600,4 +601,18 @@ public RubyString homeDirectory() {

}

@CoreMethod(names = "host_os", onSingleton = true)
public abstract static class HostOSNode extends CoreMethodNode {

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

@Specialization
public RubyString hostOS() {
return getContext().makeString(RbConfigLibrary.getOSName());
}

}

}
3 changes: 2 additions & 1 deletion truffle/src/main/ruby/core/config.rb
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@ module RbConfig
'exeext' => '',
'EXEEXT' => 'rubytruffle',
'ruby_version' => '2.2.0',
'libdir' => "#{Truffle::Primitive.home_directory}/lib/ruby/truffle"
'libdir' => "#{Truffle::Primitive.home_directory}/lib/ruby/truffle",
'host_os' => Truffle::Primitive.host_os

This comment has been minimized.

Copy link
@nirvdrum

nirvdrum May 5, 2015

Contributor

Can you delete the key you're overriding a few lines up please? I'd hate for this to get more confusing.

This comment has been minimized.

Copy link
@bjfish

bjfish May 5, 2015

Author Contributor

@nirvdrum removed

}
end

0 comments on commit df11cd5

Please sign in to comment.