summaryrefslogtreecommitdiff
path: root/lib/chef/mixin
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-03-15 09:21:40 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-03-15 09:21:40 -0700
commit09df2d39c20eef68980af5551da72db533fdc047 (patch)
treea7648e378684c45c207898b9eaec0c7fede23490 /lib/chef/mixin
parent3f07943715c31dd328dd104bba90d103b744323b (diff)
parent2b45395f1720a0746a3dd57878d0959628af5835 (diff)
downloadchef-09df2d39c20eef68980af5551da72db533fdc047.tar.gz
Merge pull request #4706 from chef/lcg/chefstyle-andor
chefstyle Style/AndOr fixes
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