Use ruby language constants to build version string in software version dimension (#30309)

pull/30324/head
Matt Jankowski 2024-05-16 03:43:35 -04:00 committed by GitHub
parent 60b423b3f7
commit c9ee1437c0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -25,14 +25,11 @@ class Admin::Metrics::Dimension::SoftwareVersionsDimension < Admin::Metrics::Dim
end
def ruby_version
yjit = defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?
value = "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}#{yjit ? ' +YJIT' : ''}"
{
key: 'ruby',
human_key: 'Ruby',
value: value,
human_value: value,
value: "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}",
human_value: RUBY_DESCRIPTION,
}
end