summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEarlopain <[email protected]>2025-03-21 09:00:44 +0100
committergit <[email protected]>2025-03-21 11:18:33 +0000
commit9b5165b1d7b197befa01327f5aef2ecebed2914e (patch)
tree3e1c4dc932b1986854297dac58878288e5e20836
parentd868922ea8e68dc2292e351c8266ef3c3058bf1e (diff)
[ruby/prism] Don't use `RUBY_VERSION.to_f`
There will be a bunch of other problems should 3.10 ever exists, but I guess why not fix this one now. https://github.com/ruby/prism/commit/b385f47f8b
-rw-r--r--lib/prism/translation/parser_current.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/prism/translation/parser_current.rb b/lib/prism/translation/parser_current.rb
index b5a9484666..b44769fde7 100644
--- a/lib/prism/translation/parser_current.rb
+++ b/lib/prism/translation/parser_current.rb
@@ -13,8 +13,9 @@ module Prism
else
# Keep this in sync with released Ruby.
parser = Parser34
+ major, minor, _patch = Gem::Version.new(RUBY_VERSION).segments
warn "warning: `Prism::Translation::Current` is loading #{parser.name}, " \
- "but you are running #{RUBY_VERSION.to_f}."
+ "but you are running #{major}.#{minor}."
ParserCurrent = parser
end
end