Hossein Safari
Hossein Safari

Reputation: 369

How to compare gems versions?

Assume we've got a gem. (e.g: gem 'bcrypt', '~> 3.1.7')
I wanna update it to the latest version of that. but I don't know what is the difference between these two versions. actually, I wanna know, what is the difference between these two versions? what is the difference between syntaxes in these two versions? so, How to compare gems versions?

Upvotes: 0

Views: 966

Answers (4)

Kishor Vyavahare
Kishor Vyavahare

Reputation: 869

First check that do you really want to update the gem? This means if your running code break due to your old version of a gem then there must be new changes that would be solved your problem. (which are the difference ;) )

Second - what is the difference between these two versions or how to compare?

1. rubygems.org

If you check the rubygems.org site and fetch any gem, then at the right bottom side there should be a 'Review Changes' link that shows the changes done during version change. enter image description here

2. Gem repo

You can also check the 'CHANGELOG' or 'README.md' files in the gem repository that contains the information regarding version changes or comparison (if the author is updating it).

3. Ruby Gem

There is a gem 'gem-compare' which shows the information of versions changes.

Upvotes: 2

spickermann
spickermann

Reputation: 106782

When the source code of a gem is managed in a public code repository, like GitHub or Gitlab, then you will often find a CHNAGELOG on these repositories. Such a changelog is written manually by the maintainers and might not be complete but it gives you a good overview of what has changed and what the maintainers think is important to know.

Another way to compare two versions is to compare the code of the two versions. Because the code of the bcrypt is public and the maintainers added tags on GitHub for each version this is very easy. Go to the page listing all releases and compare one release to another by choosing two versions. For example 3.1.13 (the lastest) to 3.1.7 (the minimum version from your Gemfile). The following page allows you to see all commits and all changed files between these two versions.

Upvotes: 1

Jörg W Mittag
Jörg W Mittag

Reputation: 369428

what is the difference between syntaxes in these two versions?

This part of the answer is easy: Ruby does not allow programmers to change the syntax, so a gem cannot possibly change the syntax, ever.

Upvotes: 0

JBallin
JBallin

Reputation: 9787

Most projects publish a changelog or a list of releases. They can usually be found on the repo or on their website. They often link specific PR’s included in each release and specify if a change was “breaking” (although the version itself should communicate if it’s a major, minor, or patch update). To compare your current version to latest, you would start at the version you’re on and review all the versions released since then.

Here’s bcrypt’s release log, for example: https://github.com/bcrypt-ruby/bcrypt-ruby/releases

Upvotes: 0

Related Questions