[ruby/reline] Load correct version.rb from gemspec

When merged to ruby/ruby, reline.gemspec file is located under
lib/reline, as the same as reline/version.rb.  That is the latter
path relative from the former differs from the ruby/reline case,
and the reline/version.rb in the default load path will be loaded.
Try `require_relative` not to load unexpected files.

https://github.com/ruby/reline/commit/54905d0e1b
This commit is contained in:
Nobuyoshi Nakada 2021-12-15 22:43:45 +09:00 коммит произвёл git
Родитель 7159af3491
Коммит a81e0600a7
1 изменённых файлов: 5 добавлений и 3 удалений

Просмотреть файл

@ -1,7 +1,9 @@
lib = File.expand_path('../lib', __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'reline/version'
begin
require_relative 'lib/reline/version'
rescue LoadError
require_relative 'version'
end
Gem::Specification.new do |spec|
spec.name = 'reline'