summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2017-05-25 18:41:19 -0500
committerNoah Kantrowitz <noah@coderanger.net>2017-05-25 18:41:19 -0500
commit3ef7e1931fa47841952a1bc9c0cc3cb8b58a3acc (patch)
tree93e6fd87caa48a8e5426d83e37140a996765f18b
parentf684c087d4ad6a9a8d76a853673a1fea1cb4d813 (diff)
downloadchef-3ef7e1931fa47841952a1bc9c0cc3cb8b58a3acc.tar.gz
Don’t use VersionString in chef-config because it doesn’t have access to that class.
Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
-rw-r--r--Rakefile1
-rw-r--r--chef-config/lib/chef-config/package_task.rb9
-rw-r--r--chef-config/lib/chef-config/version.rb4
3 files changed, 7 insertions, 7 deletions
diff --git a/Rakefile b/Rakefile
index 34d62788ea..f6e6758820 100644
--- a/Rakefile
+++ b/Rakefile
@@ -34,6 +34,7 @@ require_relative "tasks/version"
ChefConfig::PackageTask.new(File.expand_path("..", __FILE__), "Chef", "chef") do |package|
package.component_paths = ["chef-config"]
package.generate_version_class = true
+ package.use_versionstring = true
end
task :pedant, :chef_zero_spec
diff --git a/chef-config/lib/chef-config/package_task.rb b/chef-config/lib/chef-config/package_task.rb
index bb6c5ec725..424bb85eef 100644
--- a/chef-config/lib/chef-config/package_task.rb
+++ b/chef-config/lib/chef-config/package_task.rb
@@ -59,6 +59,9 @@ module ChefConfig
# Name of git remote used to push tags during a release. Default is origin.
attr_accessor :git_remote
+ # True if should use Chef::VersionString.
+ attr_accessor :use_versionstring
+
def initialize(root_path = nil, module_name = nil, gem_name = nil)
init(root_path, module_name, gem_name)
yield self if block_given?
@@ -219,12 +222,10 @@ module ChefConfig
# this repo. Do not edit this manually. Edit the VERSION file and run the rake
# task instead.
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
-require 'chef/version_string'
-
+#{"\nrequire 'chef/version_string'\n" if use_versionstring}
#{class_or_module} #{module_name}
#{module_name.upcase}_ROOT = File.expand_path("../..", __FILE__)
- VERSION = Chef::VersionString.new("#{version}")
+ VERSION = #{use_versionstring ? "Chef::VersionString.new(\"#{version}\")" : "\"#{version}\""}
end
#
diff --git a/chef-config/lib/chef-config/version.rb b/chef-config/lib/chef-config/version.rb
index d600d5285c..caa5cf1167 100644
--- a/chef-config/lib/chef-config/version.rb
+++ b/chef-config/lib/chef-config/version.rb
@@ -19,11 +19,9 @@
# task instead.
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-require 'chef/version_string'
-
module ChefConfig
CHEFCONFIG_ROOT = File.expand_path("../..", __FILE__)
- VERSION = Chef::VersionString.new("13.1.21")
+ VERSION = "13.1.21"
end
#