summaryrefslogtreecommitdiff
path: root/lib/chef/node_map.rb
diff options
context:
space:
mode:
author007lva <007.lva@gmail.com>2020-09-24 23:08:12 +0200
committer007lva <007.lva@gmail.com>2020-09-24 23:08:52 +0200
commit6ecacec32423b116e64fdcc11be0e8e18ce94706 (patch)
treeea00b3aa4389335922f42b6e22aa6921f64ad070 /lib/chef/node_map.rb
parenta1e8747af72cf91a7b5a729db647e158f46ad01f (diff)
downloadchef-6ecacec32423b116e64fdcc11be0e8e18ce94706.tar.gz
Use Ruby 2.6 endless Range syntax
Signed-off-by: Luigi <007.lva@gmail.com>
Diffstat (limited to 'lib/chef/node_map.rb')
-rw-r--r--lib/chef/node_map.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/node_map.rb b/lib/chef/node_map.rb
index c1d621a77e..0b85dbe9df 100644
--- a/lib/chef/node_map.rb
+++ b/lib/chef/node_map.rb
@@ -225,13 +225,13 @@ class Chef
if attribute == :platform_family
# If any blocklist value matches, we don't match
- return false if blocklist.any? { |v| v[1..-1] == value || platform_family_query_helper?(node, v[1..-1]) }
+ return false if blocklist.any? { |v| v[1..] == value || platform_family_query_helper?(node, v[1..]) }
# If the allowlist is empty, or anything matches, we match.
allowlist.empty? || allowlist.any? { |v| v == :all || v == value || platform_family_query_helper?(node, v) }
else
# If any blocklist value matches, we don't match
- return false if blocklist.any? { |v| v[1..-1] == value }
+ return false if blocklist.any? { |v| v[1..] == value }
# If the allowlist is empty, or anything matches, we match.
allowlist.empty? || allowlist.any? { |v| v == :all || v == value }