summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@opscode.com>2021-01-21 20:38:23 -0800
committerGitHub <noreply@github.com>2021-01-21 20:38:23 -0800
commit625db34cb609002c7a2d215b344bca6cb89d95ea (patch)
tree37b60005e17d4f5982b07ac494a5722e83a40ad9
parentba79bcd396b4a370e4e84cce16afbad703fd610d (diff)
parent722528ba9d30abf7e6c116b650dad4319b0df8ea (diff)
downloadchef-625db34cb609002c7a2d215b344bca6cb89d95ea.tar.gz
Merge pull request #10920 from chef/lcg/fix-chef-15
-rw-r--r--chef.gemspec9
-rw-r--r--lib/chef/version_string.rb2
2 files changed, 10 insertions, 1 deletions
diff --git a/chef.gemspec b/chef.gemspec
index 2764571dff..c6d2c1c0ab 100644
--- a/chef.gemspec
+++ b/chef.gemspec
@@ -1,4 +1,13 @@
$:.unshift(File.dirname(__FILE__) + "/lib")
+vs_path = File.expand_path("chef-utils/lib/chef-utils/version_string.rb", __dir__)
+
+if File.exist?(vs_path)
+ # this is the moral equivalent of a require_relative since bundler makes require_relative here fail hard
+ eval(IO.read(vs_path))
+else
+ # if the path doesn't exist then we're just in the wild gem and not in the git repo
+ require "chef-utils/version_string"
+end
require "chef/version"
Gem::Specification.new do |s|
diff --git a/lib/chef/version_string.rb b/lib/chef/version_string.rb
index 8da5df570a..c98d4c9a75 100644
--- a/lib/chef/version_string.rb
+++ b/lib/chef/version_string.rb
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-require "chef-utils/version_string"
+require "chef-utils/version_string" unless defined?(ChefUtils::VersionString)
class Chef
VersionString = ChefUtils::VersionString