summaryrefslogtreecommitdiff
path: root/lib/chef/resource
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/resource
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/resource')
-rw-r--r--lib/chef/resource/apt_repository.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb
index e4569561fc..ac15486d97 100644
--- a/lib/chef/resource/apt_repository.rb
+++ b/lib/chef/resource/apt_repository.rb
@@ -168,7 +168,7 @@ class Chef
# is the provided ID a key ID from a keyserver. Looks at length and HEX only values
# @param [String] id the key value passed by the user that *may* be an ID
def is_key_id?(id)
- id = id[2..-1] if id.start_with?("0x")
+ id = id[2..] if id.start_with?("0x")
id =~ /^\h+$/ && [8, 16, 40].include?(id.length)
end