From 095b3bfdc8d91d96154d954ec34faef4e6b8841d Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Thu, 4 Oct 2018 22:13:01 +0200 Subject: [PATCH] Make IRB::VERSION available for library users Always require `irb/version' to provide IRB::VERSION at any time, not only when IRB.version is called previously. --- lib/irb.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/irb.rb b/lib/irb.rb index a7ab9d7bc..85953346a 100644 --- a/lib/irb.rb +++ b/lib/irb.rb @@ -19,6 +19,8 @@ require "irb/input-method" require "irb/locale" +require "irb/version" + # IRB stands for "interactive Ruby" and is a tool to interactively execute Ruby # expressions read from the standard input. # @@ -354,7 +356,6 @@ def IRB.conf def IRB.version if v = @CONF[:VERSION] then return v end - require "irb/version" rv = @RELEASE_VERSION.sub(/\.0/, "") @CONF[:VERSION] = format("irb %s(%s)", rv, @LAST_UPDATE_DATE) end