Use LOAD_PATH instead of require_relative
Seeing that all the contracts library's internal requires are not relative and then freak out
This commit is contained in:
Родитель
11d0b96197
Коммит
fd51b0f3d1
|
@ -5,9 +5,9 @@ require "bundler/setup"
|
|||
|
||||
# Note that contracts.ruby has two specific ruby-version specific libraries, which we have vendored into lib/
|
||||
if (Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")) # ruby3
|
||||
require_relative "../lib/contracts-ruby3/lib/contracts"
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib/contracts-ruby3/lib"))
|
||||
else # ruby2
|
||||
require_relative "../lib/contracts-ruby2/lib/contracts"
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib/contracts-ruby2/lib"))
|
||||
end
|
||||
|
||||
# We don't need Contract outside of normal development
|
||||
|
|
|
@ -23,11 +23,12 @@ require "concurrent"
|
|||
|
||||
# Note that contracts.ruby has two specific ruby-version specific libraries, which we have vendored into lib/
|
||||
if Entitlements.ruby_version2?
|
||||
require_relative "contracts-ruby2/lib/contracts"
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib/contracts-ruby2/lib"))
|
||||
else
|
||||
require_relative "contracts-ruby3/lib/contracts"
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib/contracts-ruby3/lib"))
|
||||
end
|
||||
|
||||
require "contracts"
|
||||
require "erb"
|
||||
require "logger"
|
||||
require "ostruct"
|
||||
|
|
|
@ -4,11 +4,12 @@ require "base64"
|
|||
|
||||
# Note that contracts.ruby has two specific ruby-version specific libraries, which we have vendored into lib/
|
||||
if (Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")) # ruby3
|
||||
require_relative "../../lib/contracts-ruby3/lib/contracts"
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib/contracts-ruby3/lib"))
|
||||
else # ruby2
|
||||
require_relative "../../lib/contracts-ruby2/lib/contracts"
|
||||
$LOAD_PATH.unshift(File.expand_path("../lib/contracts-ruby2/lib"))
|
||||
end
|
||||
|
||||
require "contracts"
|
||||
require "json"
|
||||
require "rspec"
|
||||
require "rspec/support"
|
||||
|
|
Загрузка…
Ссылка в новой задаче