summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2016-08-12 11:14:17 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2016-08-16 18:41:25 -0700
commit43da5b5de2618290c09e5775063f7ec21ec5b667 (patch)
tree5327f70506c264a6f1545423fc383c2d2c76bf03
parent8069ed78dc8ed361f81064bca4da4b63c72559a4 (diff)
downloadchef-43da5b5de2618290c09e5775063f7ec21ec5b667.tar.gz
fixes Style/OpMethod cop
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--lib/chef/cookbook_version.rb6
-rw-r--r--lib/chef/node.rb4
-rw-r--r--lib/chef/provider/package/yum/rpm_utils.rb16
-rw-r--r--lib/chef/version_class.rb4
-rw-r--r--lib/chef/version_constraint.rb4
5 files changed, 17 insertions, 17 deletions
diff --git a/lib/chef/cookbook_version.rb b/lib/chef/cookbook_version.rb
index 63b39abdb7..bf9e755f3f 100644
--- a/lib/chef/cookbook_version.rb
+++ b/lib/chef/cookbook_version.rb
@@ -599,12 +599,12 @@ class Chef
end
end
- def <=>(o)
- raise Chef::Exceptions::CookbookVersionNameMismatch if self.name != o.name
+ def <=>(other)
+ raise Chef::Exceptions::CookbookVersionNameMismatch if self.name != other.name
# FIXME: can we change the interface to the Metadata class such
# that metadata.version returns a Chef::Version instance instead
# of a string?
- Chef::Version.new(self.version) <=> Chef::Version.new(o.version)
+ Chef::Version.new(self.version) <=> Chef::Version.new(other.version)
end
private
diff --git a/lib/chef/node.rb b/lib/chef/node.rb
index 54faab6d3e..212b1ced14 100644
--- a/lib/chef/node.rb
+++ b/lib/chef/node.rb
@@ -642,8 +642,8 @@ class Chef
end
end
- def <=>(other_node)
- self.name <=> other_node.name
+ def <=>(other)
+ self.name <=> other.name
end
private
diff --git a/lib/chef/provider/package/yum/rpm_utils.rb b/lib/chef/provider/package/yum/rpm_utils.rb
index a748c664a9..032597d047 100644
--- a/lib/chef/provider/package/yum/rpm_utils.rb
+++ b/lib/chef/provider/package/yum/rpm_utils.rb
@@ -243,16 +243,16 @@ class Chef
self.new(*args)
end
- def <=>(y)
- compare_versions(y)
+ def <=>(other)
+ compare_versions(other)
end
- def compare(y)
- compare_versions(y, false)
+ def compare(other)
+ compare_versions(other, false)
end
- def partial_compare(y)
- compare_versions(y, true)
+ def partial_compare(other)
+ compare_versions(other, true)
end
# RPM::Version rpm_version_to_s equivalent
@@ -352,8 +352,8 @@ class Chef
alias :name :n
alias :arch :a
- def <=>(y)
- compare(y)
+ def <=>(other)
+ compare(other)
end
def compare(y)
diff --git a/lib/chef/version_class.rb b/lib/chef/version_class.rb
index f018833717..f26368902d 100644
--- a/lib/chef/version_class.rb
+++ b/lib/chef/version_class.rb
@@ -32,11 +32,11 @@ class Chef
"#{@major}.#{@minor}.#{@patch}"
end
- def <=>(v)
+ def <=>(other)
[:major, :minor, :patch].each do |method|
version = self.send(method)
begin
- ans = (version <=> v.send(method))
+ ans = (version <=> other.send(method))
rescue NoMethodError # if the other thing isn't a version object, return nil
return nil
end
diff --git a/lib/chef/version_constraint.rb b/lib/chef/version_constraint.rb
index d4fa5df775..f10325f946 100644
--- a/lib/chef/version_constraint.rb
+++ b/lib/chef/version_constraint.rb
@@ -57,8 +57,8 @@ class Chef
"#{@op} #{@raw_version}"
end
- def eql?(o)
- o.class == self.class && @op == o.op && @version == o.version
+ def eql?(other)
+ other.class == self.class && @op == other.op && @version == other.version
end
alias_method :==, :eql?