lib/reek/smells.rb in reek-0.1.1 vs lib/reek/smells.rb in reek-0.2.0
- old
+ new
@@ -1,8 +1,9 @@
$:.unshift File.dirname(__FILE__)
require 'reek/printer'
+require 'reek/options'
module Reek
class Smell
include Comparable
@@ -23,22 +24,24 @@
def hash # :nodoc:
report.hash
end
def <=>(other) # :nodoc:
- self.report <=> other.report
+ Options[:sort_order].compare(self, other)
end
- def eql?(other) # :nodoc:
- self.report.eql?(other.report)
- end
+ alias eql? <=>
def name
self.class.convert_camel_case(self.class.name.split(/::/)[1])
end
def report
"[#{name}] #{detailed_report}"
+ end
+
+ def to_s
+ report
end
end
class LongParameterList < Smell
MAX_ALLOWED = 3