Skip to content

Commit

Permalink
Load correct version.rb from gemspec
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nobu committed Dec 15, 2021
1 parent 0c7cc7b commit 54905d0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions reline.gemspec
@@ -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'
Expand Down

0 comments on commit 54905d0

Please sign in to comment.