summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorNoah Kantrowitz <noah@coderanger.net>2018-05-04 17:48:29 -0700
committerNoah Kantrowitz <noah@coderanger.net>2018-06-05 20:25:12 -0700
commitdddab2275851235b68778653062de5c8cc2e7475 (patch)
treeb77d3c2757cddef635d1a4a7ed9a32e506a5d357 /lib/chef
parent733cc37b5888c6c9e324785ce85a1d3662cd3602 (diff)
downloadchef-dddab2275851235b68778653062de5c8cc2e7475.tar.gz
Feed the rubocop.
Explicitly ignoring UnderscorePrefixedVariableName because we want __core_override__ to be an obviously unusual thing. Signed-off-by: Noah Kantrowitz <noah@coderanger.net>
Diffstat (limited to 'lib/chef')
-rw-r--r--lib/chef/node_map.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index f928888b79..0884593f4c 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -56,7 +56,7 @@ class Chef
#
# @return [NodeMap] Returns self for possible chaining
#
- def set(key, klass, platform: nil, platform_version: nil, platform_family: nil, os: nil, canonical: nil, override: nil, allow_cookbook_override: false, __core_override__: false, &block)
+ def set(key, klass, platform: nil, platform_version: nil, platform_family: nil, os: nil, canonical: nil, override: nil, allow_cookbook_override: false, __core_override__: false, &block) # rubocop:disable Lint/UnderscorePrefixedVariableName
new_matcher = { klass: klass }
new_matcher[:platform] = platform if platform
new_matcher[:platform_version] = platform_version if platform_version
@@ -75,15 +75,15 @@ class Chef
# 3. At least one previous `provides` is now locked.
# 4. No previous `provides` had `allow_cookbook_override`, either set to
# true or with a string version matcher that still matches Chef::VERSION
- if !__core_override__ && map[key] && map[key].any? {|matcher| matcher[:locked] } && !map[key].any? {|matcher| matcher[:cookbook_override].is_a?(String) ? Chef::VERSION =~ matcher[:cookbook_override] : matcher[:cookbook_override] }
+ if !__core_override__ && map[key] && map[key].any? { |matcher| matcher[:locked] } && !map[key].any? { |matcher| matcher[:cookbook_override].is_a?(String) ? Chef::VERSION =~ matcher[:cookbook_override] : matcher[:cookbook_override] }
# If we ever use locked mode on things other than the resource and provider handler maps, this probably needs a tweak.
type_of_thing = if klass < Chef::Resource
- 'resource'
- elsif klass < Chef::Provider
- 'provider'
- else
- klass.superclass.to_s
- end
+ "resource"
+ elsif klass < Chef::Provider
+ "provider"
+ else
+ klass.superclass.to_s
+ end
# For now, only log the warning.
Chef.log_deprecation("Trying to register #{type_of_thing} #{key} on top of existing Chef core #{type_of_thing}. Check if a new version of the cookbook is available.")
# In 15.0, uncomment this and remove the log above.