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

Commits on Jan 28, 2015

  1. Copy the full SHA
    5fc0fd5 View commit details
  2. [Truffle] Some updates to RbConfig::CONFIG.

    The keys must be Strings, not Symbols.  I've also added some common keys used by other implementations.  Finally, the OS will identify as Win32 on Windows, which activates a bunch of Windows-specific logic in RubySpec.
    nirvdrum committed Jan 28, 2015
    Copy the full SHA
    c73f8e2 View commit details
Showing with 26 additions and 10 deletions.
  1. +11 −7 core/src/main/ruby/jruby/truffle/core/config.rb
  2. +15 −3 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
18 changes: 11 additions & 7 deletions core/src/main/ruby/jruby/truffle/core/config.rb
Original file line number Diff line number Diff line change
@@ -7,11 +7,15 @@
# GNU Lesser General Public License version 2.1

module RbConfig
CONFIG = {
:ruby_install_name => "rubytruffle",
:RUBY_INSTALL_NAME => "rubytruffle",
:host_os => "unknown",
:exeext => "",
:EXEEXT => "rubytruffle",
}
CONFIG = {
'MAJOR' => RUBY_VERSION.split('.')[0],
'MINOR' => RUBY_VERSION.split('.')[1],
'TEENY' => RUBY_VERSION.split('.')[2],
'ruby_version' => "#{RUBY_VERSION.split('.')[0]}.#{RUBY_VERSION.split('.')[1]}.0",
'ruby_install_name' => 'rubytruffle',
'RUBY_INSTALL_NAME' => 'rubytruffle',
'host_os' => File::ALT_SEPARATOR.nil? ? 'unknown' : 'mswin32',
'exeext' => '',
'EXEEXT' => 'rubytruffle',
}
end
Original file line number Diff line number Diff line change
@@ -364,9 +364,21 @@ public void initialize() {
argv = new RubyArray(arrayClass);
objectClass.setConstant(null, "ARGV", argv);

fileClass.setConstant(null, "SEPARATOR", RubyString.fromJavaString(stringClass, File.separator));
fileClass.setConstant(null, "Separator", RubyString.fromJavaString(stringClass, File.separator));
fileClass.setConstant(null, "ALT_SEPARATOR", nilObject);
final RubyString separator = RubyString.fromJavaString(stringClass, "/");
separator.freeze();

fileClass.setConstant(null, "SEPARATOR", separator);
fileClass.setConstant(null, "Separator", separator);

if (File.separatorChar == '\\') {
final RubyString altSeparator = RubyString.fromJavaString(stringClass, "\\");
altSeparator.freeze();

fileClass.setConstant(null, "ALT_SEPARATOR", altSeparator);
} else {
fileClass.setConstant(null, "ALT_SEPARATOR", nilObject);
}

fileClass.setConstant(null, "PATH_SEPARATOR", RubyString.fromJavaString(stringClass, File.pathSeparator));
fileClass.setConstant(null, "FNM_SYSCASE", 0);