summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2021-01-21 20:05:57 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2021-01-21 20:05:57 -0800
commit85183f84c15c9af8d545814882874a7484a9e77b (patch)
treeea4a1807a4002464875962e5497faa1fb23a3b92
parent510b308ddabaae22343dc12a9f04761fdb3c858e (diff)
downloadchef-85183f84c15c9af8d545814882874a7484a9e77b.tar.gz
Backport of the dev gem removal fix from chef-16/17
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--chef.gemspec9
1 files changed, 9 insertions, 0 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|