lib/friends/commands/update.rb in friends-0.50 vs lib/friends/commands/update.rb in friends-0.51
- old
+ new
@@ -1,17 +1,17 @@
# frozen_string_literal: true
require "friends/post_install_message"
+require "friends/sem_ver_comparator"
desc "Updates the `friends` program"
command :update do |update|
update.action do |global_options|
# rubocop:disable Lint/AssignmentInCondition
if match = `gem search friends`.match(/^friends\s\(([^\)]+)\)$/)
# rubocop:enable Lint/AssignmentInCondition
remote_version = match[1]
- if Semverse::Version.coerce(remote_version) >
- Semverse::Version.coerce(Friends::VERSION)
+ if Friends::SemVerComparator.greater?(remote_version, Friends::VERSION)
`gem update friends && gem cleanup friends`
unless global_options[:quiet]
if $?.success?
puts Paint["Updated to friends #{remote_version}", :bold, :green]