From 6dedddc545e2f1930bdc2256784eb1551bd4231d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 1 Feb 2026 00:49:15 +0900 Subject: feat(nuldoc): rewrite nuldoc in Ruby --- .../ruby-detect-running-implementation/index.html | 43 ++++++++++++---------- 1 file changed, 23 insertions(+), 20 deletions(-) (limited to 'services/nuldoc/public/blog/posts/2021-10-02/ruby-detect-running-implementation/index.html') diff --git a/services/nuldoc/public/blog/posts/2021-10-02/ruby-detect-running-implementation/index.html b/services/nuldoc/public/blog/posts/2021-10-02/ruby-detect-running-implementation/index.html index b2e7a02a..db82851d 100644 --- a/services/nuldoc/public/blog/posts/2021-10-02/ruby-detect-running-implementation/index.html +++ b/services/nuldoc/public/blog/posts/2021-10-02/ruby-detect-running-implementation/index.html @@ -81,12 +81,13 @@ 上記ページの例から引用する:

-
$ ruby-1.9.1 -ve 'p RUBY_ENGINE'
-ruby 1.9.1p0 (2009-03-04 revision 22762) [x86_64-linux]
-"ruby"
-$ jruby -ve 'p RUBY_ENGINE'
-jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java]
-"jruby"
+
$ ruby-1.9.1 -ve 'p RUBY_ENGINE'
+ruby 1.9.1p0 (2009-03-04 revision 22762) [x86_64-linux]
+"ruby"
+$ jruby -ve 'p RUBY_ENGINE'
+jruby 1.2.0 (ruby 1.8.6 patchlevel 287) (2009-03-16 rev 9419) [i386-java]
+"jruby"
+

それぞれの処理系がどのような値を返すかだが、stack overflow に良い質問と回答があった。 @@ -96,16 +97,17 @@

-
| RUBY_ENGINE | Implementation    |
-|:-----------:|:------------------|
-| <undefined> | MRI < 1.9         |
-| 'ruby'      | MRI >= 1.9 or REE |
-| 'jruby'     | JRuby             |
-| 'macruby'   | MacRuby           |
-| 'rbx'       | Rubinius          |
-| 'maglev'    | MagLev            |
-| 'ironruby'  | IronRuby          |
-| 'cardinal'  | Cardinal          |
+
| RUBY_ENGINE | Implementation    |
+|:-----------:|:------------------|
+| <undefined> | MRI < 1.9         |
+| 'ruby'      | MRI >= 1.9 or REE |
+| 'jruby'     | JRuby             |
+| 'macruby'   | MacRuby           |
+| 'rbx'       | Rubinius          |
+| 'maglev'    | MagLev            |
+| 'ironruby'  | IronRuby          |
+| 'cardinal'  | Cardinal          |
+

@@ -121,10 +123,11 @@

version.h
-
/*
- * Ruby engine.
- */
-#define MRUBY_RUBY_ENGINE  "mruby"
+
/*
+ * Ruby engine.
+ */
+#define MRUBY_RUBY_ENGINE  "mruby"
+
-- cgit v1.3-1-g0d28