summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/provider/package.rb2
-rw-r--r--lib/chef/resource_reporter.rb2
-rw-r--r--lib/chef/run_lock.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/package.rb b/lib/chef/provider/package.rb
index daf46c502e..a49a97ea7e 100644
--- a/lib/chef/provider/package.rb
+++ b/lib/chef/provider/package.rb
@@ -658,7 +658,7 @@ class Chef
end
def allow_downgrade
- if new_resource.respond_to?("allow_downgrade")
+ if new_resource.respond_to?(:allow_downgrade)
new_resource.allow_downgrade
else
true
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb
index 242a6e9f0f..16d90baf4f 100644
--- a/lib/chef/resource_reporter.rb
+++ b/lib/chef/resource_reporter.rb
@@ -34,7 +34,7 @@ class Chef
as_hash["after"] = new_resource.state_for_resource_reporter
as_hash["before"] = current_resource ? current_resource.state_for_resource_reporter : {}
as_hash["duration"] = ( action_record.elapsed_time * 1000 ).to_i.to_s
- as_hash["delta"] = new_resource.diff if new_resource.respond_to?("diff")
+ as_hash["delta"] = new_resource.diff if new_resource.respond_to?(:diff)
as_hash["delta"] = "" if as_hash["delta"].nil?
# TODO: rename as "action"
diff --git a/lib/chef/run_lock.rb b/lib/chef/run_lock.rb
index 8382983ca0..b70a936aab 100644
--- a/lib/chef/run_lock.rb
+++ b/lib/chef/run_lock.rb
@@ -144,7 +144,7 @@ class Chef
# If we support FD_CLOEXEC, then use it.
# NB: ruby-2.0.0-p195 sets FD_CLOEXEC by default, but not
# ruby-1.8.7/1.9.3
- if Fcntl.const_defined?("F_SETFD") && Fcntl.const_defined?("FD_CLOEXEC")
+ if Fcntl.const_defined?(:F_SETFD) && Fcntl.const_defined?(:FD_CLOEXEC)
runlock.fcntl(Fcntl::F_SETFD, runlock.fcntl(Fcntl::F_GETFD, 0) | Fcntl::FD_CLOEXEC)
end
# Flock will return 0 if it can acquire the lock otherwise it