summaryrefslogtreecommitdiff
path: root/lib/chef/resource/conditional_action_not_nothing.rb
diff options
context:
space:
mode:
authorXabier de Zuazo <xabier@zuazo.org>2013-01-23 22:32:08 +0100
committerBryan McLellan <btm@opscode.com>2013-06-19 14:18:43 -0700
commit4c29883b38c6179a8b3fead064d7095159ba5cca (patch)
treeb10193aeb0681b39c6d9237ea2eb7bffc8ebf766 /lib/chef/resource/conditional_action_not_nothing.rb
parent62b156aec03ecb1d6ece0a3dc8a277f5332d0990 (diff)
downloadchef-4c29883b38c6179a8b3fead064d7095159ba5cca.tar.gz
[CHEF-972] removed the #self.not_if method and the private constructor from ConditionalActionNothing and renamed to ConditionalActionNotNothing
Diffstat (limited to 'lib/chef/resource/conditional_action_not_nothing.rb')
-rw-r--r--lib/chef/resource/conditional_action_not_nothing.rb48
1 files changed, 48 insertions, 0 deletions
diff --git a/lib/chef/resource/conditional_action_not_nothing.rb b/lib/chef/resource/conditional_action_not_nothing.rb
new file mode 100644
index 0000000000..f6c34b20b5
--- /dev/null
+++ b/lib/chef/resource/conditional_action_not_nothing.rb
@@ -0,0 +1,48 @@
+#
+# Author:: Xabier de Zuazo (<xabier@onddo.com>)
+# Copyright:: Copyright (c) 2013 Onddo Labs, SL.
+# 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
+ class Resource
+ class ConditionalActionNotNothing
+
+ attr_reader :current_action
+
+ def initialize(current_action)
+ @current_action = current_action
+ end
+
+ def continue?
+ # @positivity == not_if
+ @current_action != :nothing
+ end
+
+ def short_description
+ description
+ end
+
+ def description
+ "action :nothing"
+ end
+
+ def to_text
+ "not_if { action == :nothing }"
+ end
+
+ end
+ end
+end