New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce `Rails.gem_version` #14103

Merged
merged 1 commit into from Mar 5, 2014

Conversation

Projects
None yet
2 participants
@sikachu
Member

sikachu commented Feb 18, 2014

This method returns a Gem::Version object, which is useful when
performing a comparison between versions. This was originally
introduced as .version by @charliesome in #8501, but got reverted in
#10002 since it was not backward compatible.

Also, updating template for rake update_versions.


This is the same as #14101, but for 4-1-stable.

Introduce `Rails.gem_version`
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.

Example:

    Rails.version #=> "4.1.2"
    Rails.gem_version #=> #<Gem::Version "4.1.2">

    Rails.version > "4.1.10" #=> false
    Rails.gem_version > Gem::Version.new("4.1.10") #=> true
    Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true

This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.

Also, updating template for `rake update_versions`.

jeremy added a commit that referenced this pull request Mar 5, 2014

@jeremy jeremy merged commit ea8aba8 into rails:4-1-stable Mar 5, 2014

@sikachu sikachu deleted the sikachu:4-1-stable-fix-versioning-task branch Mar 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment