summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/cookbook/metadata.rb2
-rw-r--r--lib/chef/mixin/check_helper.rb31
-rw-r--r--lib/chef/mixins.rb1
-rw-r--r--lib/chef/node.rb2
-rw-r--r--lib/chef/resource.rb8
5 files changed, 4 insertions, 40 deletions
diff --git a/lib/chef/cookbook/metadata.rb b/lib/chef/cookbook/metadata.rb
index 8398de442c..18368bd99f 100644
--- a/lib/chef/cookbook/metadata.rb
+++ b/lib/chef/cookbook/metadata.rb
@@ -21,7 +21,6 @@
require 'chef/mash'
require 'chef/mixin/from_file'
require 'chef/mixin/params_validate'
-require 'chef/mixin/check_helper'
require 'chef/log'
require 'chef/version_class'
require 'chef/version_constraint'
@@ -64,7 +63,6 @@ class Chef
:provides => PROVIDING,
:replaces => REPLACING }
- include Chef::Mixin::CheckHelper
include Chef::Mixin::ParamsValidate
include Chef::Mixin::FromFile
diff --git a/lib/chef/mixin/check_helper.rb b/lib/chef/mixin/check_helper.rb
deleted file mode 100644
index b3a7835e09..0000000000
--- a/lib/chef/mixin/check_helper.rb
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# Author:: Adam Jacob (<adam@opscode.com>)
-# Copyright:: Copyright (c) 2008 Opscode, Inc.
-# License:: Apache License, Version 2.0
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-class Chef
- module Mixin
- module CheckHelper
- def set_if_args(thing, arguments)
- raise ArgumentError, "Must call set_if_args with a block!" unless Kernel.block_given?
- if arguments != nil
- yield(arguments)
- else
- thing
- end
- end
- end
- end
-end
diff --git a/lib/chef/mixins.rb b/lib/chef/mixins.rb
index 8fa9c699e6..17be1622af 100644
--- a/lib/chef/mixins.rb
+++ b/lib/chef/mixins.rb
@@ -1,5 +1,4 @@
require 'chef/mixin/shell_out'
-require 'chef/mixin/check_helper'
require 'chef/mixin/checksum'
require 'chef/mixin/command'
require 'chef/mixin/convert_to_class_name'
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index a2bffcc172..0caf6602fe 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -22,7 +22,6 @@
require 'forwardable'
require 'chef/config'
require 'chef/nil_argument'
-require 'chef/mixin/check_helper'
require 'chef/mixin/params_validate'
require 'chef/mixin/from_file'
require 'chef/mixin/deep_merge'
@@ -57,7 +56,6 @@ class Chef
include Chef::DSL::IncludeAttribute
include Chef::DSL::PlatformIntrospection
- include Chef::Mixin::CheckHelper
include Chef::Mixin::ParamsValidate
# Create a new Chef::Node object.
diff --git a/lib/chef/resource.rb b/lib/chef/resource.rb
index f3dabc5b28..7ee61db04c 100644
--- a/lib/chef/resource.rb
+++ b/lib/chef/resource.rb
@@ -18,7 +18,6 @@
#
require 'chef/mixin/params_validate'
-require 'chef/mixin/check_helper'
require 'chef/dsl/platform_introspection'
require 'chef/dsl/registry_helper'
require 'chef/mixin/convert_to_class_name'
@@ -120,7 +119,6 @@ F
FORBIDDEN_IVARS = [:@run_context, :@node, :@not_if, :@only_if, :@enclosing_provider]
HIDDEN_IVARS = [:@allowed_actions, :@resource_name, :@source_line, :@run_context, :@name, :@node, :@not_if, :@only_if, :@elapsed_time, :@enclosing_provider]
- include Chef::Mixin::CheckHelper
include Chef::Mixin::ParamsValidate
include Chef::DSL::PlatformIntrospection
include Chef::DSL::RegistryHelper
@@ -324,17 +322,19 @@ F
end
def name(name=nil)
- set_if_args(@name, name) do
+ if !name.nil?
raise ArgumentError, "name must be a string!" unless name.kind_of?(String)
@name = name
end
+ @name
end
def noop(tf=nil)
- set_if_args(@noop, tf) do
+ if !tf.nil?
raise ArgumentError, "noop must be true or false!" unless tf == true || tf == false
@noop = tf
end
+ @noop
end
def ignore_failure(arg=nil)