diff options
author | Gavin Reynolds <g.reynolds@src.gla.ac.uk> | 2017-09-01 09:17:56 +0100 |
---|---|---|
committer | Gavin Reynolds <g.reynolds@src.gla.ac.uk> | 2017-09-01 09:18:39 +0100 |
commit | 8a399ee8b2f9f4c3336e91b0da22c9f5fa67318f (patch) | |
tree | 2c3eabc95ddd80a25034c7d4567ad79004137356 /lib/chef | |
parent | f74cade60ded63f26248a38447824a732d581588 (diff) | |
download | chef-8a399ee8b2f9f4c3336e91b0da22c9f5fa67318f.tar.gz |
[x].flatten is better written as Array(x)
Signed-off-by: Gavin Reynolds <g.reynolds@src.gla.ac.uk>
Diffstat (limited to 'lib/chef')
-rw-r--r-- | lib/chef/resource/apt_repository.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource/apt_repository.rb b/lib/chef/resource/apt_repository.rb index 293d6b6414..3a2d30be2c 100644 --- a/lib/chef/resource/apt_repository.rb +++ b/lib/chef/resource/apt_repository.rb @@ -33,7 +33,7 @@ class Chef # whether or not to add the repository as a source repo, too property :deb_src, [TrueClass, FalseClass], default: false property :keyserver, [String, nil, false], default: "keyserver.ubuntu.com", nillable: true, coerce: proc { |x| x ? x : nil } - property :key, [String, Array, nil, false], default: [], coerce: proc { |x| x ? [x].flatten : nil } + property :key, [String, Array, nil, false], default: [], coerce: proc { |x| x ? Array(x) : nil } property :key_proxy, [String, nil, false], default: nil, nillable: true, coerce: proc { |x| x ? x : nil } property :cookbook, [String, nil, false], default: nil, desired_state: false, nillable: true, coerce: proc { |x| x ? x : nil } |