Skip to content

Commit

Permalink
Add RUBY_ENGINE constant per last night's design discussion.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.codehaus.org/jruby/trunk/jruby@6607 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information
headius committed May 1, 2008
1 parent e170711 commit 64867ce
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/org/jruby/RubyGlobal.java
Expand Up @@ -128,11 +128,13 @@ public static void createGlobals(Ruby runtime) {
IRubyObject version = runtime.newString(Constants.RUBY_VERSION).freeze();
IRubyObject release = runtime.newString(Constants.COMPILE_DATE).freeze();
IRubyObject platform = runtime.newString(Constants.PLATFORM).freeze();
IRubyObject engine = runtime.newString(Constants.ENGINE).freeze();

runtime.defineGlobalConstant("RUBY_VERSION", version);
runtime.defineGlobalConstant("RUBY_PATCHLEVEL", runtime.newString(Constants.RUBY_PATCHLEVEL).freeze());
runtime.defineGlobalConstant("RUBY_RELEASE_DATE", release);
runtime.defineGlobalConstant("RUBY_PLATFORM", platform);
runtime.defineGlobalConstant("RUBY_ENGINE", engine);

runtime.defineGlobalConstant("VERSION", version);
runtime.defineGlobalConstant("RELEASE_DATE", release);
Expand Down
1 change: 1 addition & 0 deletions src/org/jruby/runtime/Constants.java
Expand Up @@ -54,6 +54,7 @@ public final class Constants {
public static final String BUILD;
public static final String TARGET;
public static final String REVISION;
public static final String ENGINE = "jruby";

static {
InputStream stream = null;
Expand Down
1 change: 1 addition & 0 deletions test/jruby_index
Expand Up @@ -19,6 +19,7 @@ test_core_arities
test_crazy_blocks
test_date_time
test_defined
test_default_constants
test_dir
#test_digest2
test_dup_clone_taint_freeze
Expand Down
7 changes: 7 additions & 0 deletions test/test_default_constants.rb
@@ -0,0 +1,7 @@
require 'test/unit'

class TestDefaultConstants < Test::Unit::TestCase
def test_values
assert_equal('jruby', RUBY_ENGINE)
end
end

0 comments on commit 64867ce

Please sign in to comment.