summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-03-14 10:34:33 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-03-14 10:34:33 -0700
commit6705acbd7f301d1b04388043a3dfa0308655f120 (patch)
tree1e8a43b35ef1684a4b90578f1a6374758aa7e3c7 /lib/chef/mixin
parent365064280c93d519fdacbf032c0c21057e5549c9 (diff)
downloadchef-6705acbd7f301d1b04388043a3dfa0308655f120.tar.gz
chefstyle Style/AndOr fixes
this is part of our informal style guide, lets make it formal since clearly its not getting followed very well.
Diffstat (limited to 'lib/chef/mixin')
-rw-r--r--lib/chef/mixin/template.rb2
-rw-r--r--lib/chef/mixin/why_run.rb2
-rw-r--r--lib/chef/mixin/wide_string.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/mixin/template.rb b/lib/chef/mixin/template.rb
index c423ccaa42..b10e036c4e 100644
--- a/lib/chef/mixin/template.rb
+++ b/lib/chef/mixin/template.rb
@@ -186,7 +186,7 @@ class Chef
module_names.each do |mod|
context_methods = [:node, :render, :render_template, :render_template_from_string]
context_methods.each do |core_method|
- if mod.method_defined?(core_method) or mod.private_method_defined?(core_method)
+ if mod.method_defined?(core_method) || mod.private_method_defined?(core_method)
Chef::Log.warn("Core template method `#{core_method}' overridden by extension module #{mod}")
end
end
diff --git a/lib/chef/mixin/why_run.rb b/lib/chef/mixin/why_run.rb
index 69fee58e31..ea62527bdd 100644
--- a/lib/chef/mixin/why_run.rb
+++ b/lib/chef/mixin/why_run.rb
@@ -319,7 +319,7 @@ class Chef
def run(action)
@assertions[action.to_sym].each do |a|
a.run(action, events, @resource)
- if a.assertion_failed? and a.block_action?
+ if a.assertion_failed? && a.block_action?
@blocked_actions << action
break
end
diff --git a/lib/chef/mixin/wide_string.rb b/lib/chef/mixin/wide_string.rb
index 4566bdd382..4342ef1650 100644
--- a/lib/chef/mixin/wide_string.rb
+++ b/lib/chef/mixin/wide_string.rb
@@ -34,7 +34,7 @@ class Chef
ustring = (ustring + "").force_encoding("UTF-8") if ustring.respond_to?(:force_encoding) && ustring.encoding.name != "UTF-8"
# ensure we have the double-null termination Windows Wide likes
- ustring = ustring + "\000\000" if ustring.length == 0 or ustring[-1].chr != "\000"
+ ustring = ustring + "\000\000" if ustring.length == 0 || ustring[-1].chr != "\000"
# encode it all as UTF-16LE AKA Windows Wide Character AKA Windows Unicode
ustring = begin