summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chef-utils/lib/chef-utils/version_string.rb2
-rw-r--r--lib/chef/cookbook_version.rb4
2 files changed, 2 insertions, 4 deletions
diff --git a/chef-utils/lib/chef-utils/version_string.rb b/chef-utils/lib/chef-utils/version_string.rb
index 345f0ab03e..425fe5b050 100644
--- a/chef-utils/lib/chef-utils/version_string.rb
+++ b/chef-utils/lib/chef-utils/version_string.rb
@@ -28,7 +28,7 @@ module ChefUtils
#
# @param val [String] Version string to parse.
def initialize(val)
- val = "" unless val
+ val ||= ""
super(val)
begin
@parsed_version = ::Gem::Version.create(self)
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index 135a5292a6..5719fa6a13 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -587,9 +587,7 @@ class Chef
end
def file_vendor
- unless @file_vendor
- @file_vendor = Chef::Cookbook::FileVendor.create_from_manifest(cookbook_manifest)
- end
+ @file_vendor ||= Chef::Cookbook::FileVendor.create_from_manifest(cookbook_manifest)
@file_vendor
end