@@ -115,6 +115,7 @@ def run
115115 next if current == latest
116116
117117 update_type = classify_update ( current , latest )
118+ next unless update_type
118119 next if @options [ :major_only ] && update_type != :major
119120 next if @options [ :minor_only ] && update_type == :patch
120121
@@ -129,7 +130,7 @@ def run
129130 return
130131 end
131132
132- type_order = { major : 0 , minor : 1 , patch : 2 , unknown : 3 }
133+ type_order = { major : 0 , minor : 1 , patch : 2 }
133134 outdated . sort_by! { |o | [ type_order [ o [ :update_type ] ] , o [ :name ] ] }
134135
135136 if @options [ :format ] == "json"
@@ -173,16 +174,15 @@ def classify_update(current, latest)
173174 current_parts = parse_version ( current )
174175 latest_parts = parse_version ( latest )
175176
176- return :unknown if current_parts . nil? || latest_parts . nil?
177+ return nil if current_parts . nil? || latest_parts . nil?
178+ return nil if ( current_parts <=> latest_parts ) >= 0
177179
178180 if latest_parts [ 0 ] > current_parts [ 0 ]
179181 :major
180182 elsif latest_parts [ 1 ] > current_parts [ 1 ]
181183 :minor
182- elsif latest_parts [ 2 ] > current_parts [ 2 ]
183- :patch
184184 else
185- :unknown
185+ :patch
186186 end
187187 end
188188
0 commit comments