lib/drg/tasks/active_pinner.rb in drg-0.13.0 vs lib/drg/tasks/active_pinner.rb in drg-0.13.1
- old
+ new
@@ -1,8 +1,8 @@
module DRG
module Tasks
- class ActivePinnner
+ class ActivePinner
include Log
attr_reader :gemfile, :type
attr_writer :versions
@@ -64,12 +64,12 @@
# @param [String] current_version of the gem
def latest_patch_version(name, current_version)
new_versions(name, current_version).select { |version|
segments = version.scan(/\d+/)
major = segments[0].to_i
- patch = segments[-1].to_i
minor = segments[1].to_i
+ patch = segments[-1].to_i
patch > current_version.segments[-1] && minor == current_version.segments[1] && major == current_version.segments[0]
}.first
end
# @param [String] name of the gem
@@ -99,10 +99,10 @@
end
# @param [Array] list of a gem version's segments
# @param [Array] other_list of another gem version's segments
def higher?(list, other_list)
- list[0].to_i > other_list[0].to_i || list[1].to_i > other_list[1].to_i || list[2].to_i > other_list[2].to_i
+ (0..2).to_a.any? { |i| list[i].to_i > other_list[i].to_i }
end
end
end
end