-
Notifications
You must be signed in to change notification settings - Fork 530
RUBY-3714 Client metadata capture for TruffleRuby #2971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
8f46d9a
a1b6fe0
99bca35
119f370
8b796dc
13259de
f505430
d6cc4e6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,21 +34,21 @@ def initialize(metadata) | |||||
| @metadata = metadata | ||||||
| end | ||||||
|
|
||||||
| # Queries whether the current runtime is JRuby or not. | ||||||
| # Queries whether the current runtime is Ruby or not. | ||||||
| # | ||||||
| # @return [ true | false ] whether the runtime is JRuby or not. | ||||||
| def jruby? | ||||||
| BSON::Environment.jruby? | ||||||
| # @return [ Boolean ] whether the current runtime is Ruby | ||||||
|
||||||
| def ruby? | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "mri" ("matz's ruby implementation") is how the canonical implementation is usually called. It might be better to name this predicate
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed! |
||||||
| RUBY_ENGINE == 'ruby' | ||||||
| end | ||||||
|
|
||||||
| # Returns the list of Ruby versions that identify this runtime. | ||||||
| # | ||||||
| # @return [ Array<String> ] the list of ruby versions | ||||||
| def ruby_versions | ||||||
| if jruby? | ||||||
| [ "JRuby #{JRUBY_VERSION}", "like Ruby #{RUBY_VERSION}" ] | ||||||
| else | ||||||
| if ruby? | ||||||
| [ "Ruby #{RUBY_VERSION}" ] | ||||||
| else | ||||||
| [ "#{RUBY_ENGINE} #{RUBY_ENGINE_VERSION}", "like Ruby #{RUBY_VERSION}" ] | ||||||
| end | ||||||
| end | ||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment is unclear. Since this method is always called within a Ruby runtime, it should clarify that it checks for standard Ruby/MRI specifically, not whether Ruby is running. Consider: 'Queries whether the current runtime is standard Ruby (MRI).'