diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2019-08-07 17:07:40 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2019-08-07 17:07:40 -0700 |
commit | a90264ea2573173debca60e3acad92f7865d7008 (patch) | |
tree | 51b78f1566d719e961a2a82b2fedcca85a806888 /lib/chef/exceptions.rb | |
parent | 5573e06c58d9ed40aa228d43fb943e3ef2999db5 (diff) | |
download | chef-a90264ea2573173debca60e3acad92f7865d7008.tar.gz |
Consistently use NOT_PASSED over alternatives
We have four different versions of this now, and this converts to
just using the one convention in `lib/chef/constants.rb`
Interestingly `Chef::NIL_ARGUMENT` is used nowhere in the codebase, that
probably got refactored out in 12.5.1.
Node objects still use `NIL` but that is a different kind of `Object.new`
which really is semantically private to the implementation of
attributes.
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/chef/exceptions.rb')
-rw-r--r-- | lib/chef/exceptions.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/chef/exceptions.rb b/lib/chef/exceptions.rb index 2d7ac374cb..7687e7d89c 100644 --- a/lib/chef/exceptions.rb +++ b/lib/chef/exceptions.rb @@ -2,7 +2,7 @@ # Author:: Adam Jacob (<adam@chef.io>) # Author:: Seth Falcon (<seth@chef.io>) # Author:: Kyle Goodwin (<kgoodwin@primerevenue.com>) -# Copyright:: Copyright 2008-2018, Chef Software Inc. +# Copyright:: Copyright 2008-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -19,6 +19,7 @@ require "chef-config/exceptions" require_relative "dist" +require_relative "constants" class Chef # == Chef::Exceptions @@ -264,14 +265,12 @@ class Chef end class MissingRole < RuntimeError - NULL = Object.new - attr_reader :expansion - def initialize(message_or_expansion = NULL) + def initialize(message_or_expansion = NOT_PASSED) @expansion = nil case message_or_expansion - when NULL + when NOT_PASSED super() when String super |