summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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
#