Skip to content

Commit

Permalink
Merge pull request #74 from JacobEvelyn/updation
Browse files Browse the repository at this point in the history
Fix bug in comparing gem versions for update
  • Loading branch information
JacobEvelyn committed Jan 13, 2016
2 parents f4e6b7c + 8134d0d commit 3dd2eb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin/friends
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require "gli"
require "paint"
require "readline"
require "semverse"

require "friends/introvert"
require "friends/version"
Expand Down Expand Up @@ -41,7 +42,8 @@ command :update do |update|
search = `gem search friends`
if match = search.match(/^friends\s\(([^\)]+)\)$/)
remote_version = match[1]
if remote_version.to_r > Friends::VERSION.to_r
if Semverse::Version.coerce(remote_version) >
Semverse::Version.coerce(Friends::VERSION)
`gem update friends && gem cleanup friends`
if $?.success?
puts Paint["Updated to friends #{remote_version}", :bold, :green]
Expand Down
1 change: 1 addition & 0 deletions friends.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
spec.add_dependency "gli", "~> 2.12"
spec.add_dependency "memoist", "~> 0.11"
spec.add_dependency "paint", "~> 1.0"
spec.add_dependency "semverse", "~> 1.2"

spec.add_development_dependency "bundler", "~> 1.6"
spec.add_development_dependency "codeclimate-test-reporter", "~> 0.4"
Expand Down

0 comments on commit 3dd2eb8

Please sign in to comment.