Skip to content

Add #to_s method to rails version#117

Merged
rafaelfranca merged 2 commits intorails:masterfrom
robertomiranda:version-to-s
Mar 24, 2013
Merged

Add #to_s method to rails version#117
rafaelfranca merged 2 commits intorails:masterfrom
robertomiranda:version-to-s

Conversation

@robertomiranda
Copy link
Contributor

now Rails.version returns an instance of Gem::Version
cc @rafaelfranca
ref rails/rails#8501, https://travis-ci.org/rails/rails/jobs/5750326

rafaelfranca added a commit that referenced this pull request Mar 24, 2013
Add #to_s method to rails version
@rafaelfranca rafaelfranca merged commit b546434 into rails:master Mar 24, 2013
@rafaelfranca
Copy link
Member

Thank you

@carlosantoniodasilva
Copy link
Member

I wonder how many gems will have to add a to_s 😄

@rafaelfranca
Copy link
Member

Good question. Maybe if we have a lot of gems relaying on this behavior we
should revert this change.
On Mar 24, 2013 12:35 AM, "Carlos Antonio da Silva" <
notifications@github.com> wrote:

I wonder how many gems will have to add a to_s [image: 😄]


Reply to this email directly or view it on GitHubhttps://github.com//pull/117#issuecomment-15350863
.

@robertomiranda robertomiranda deleted the version-to-s branch March 24, 2013 03:38
@indirect
Copy link
Member

Depends on whether the gems interpolate it or not, I guess. :\

On Mar 23, 2013, at 8:37 PM, Rafael Mendonça França notifications@github.com wrote:

Good question. Maybe if we have a lot of gems relaying on this behavior we
should revert this change.
On Mar 24, 2013 12:35 AM, "Carlos Antonio da Silva" <
notifications@github.com> wrote:

I wonder how many gems will have to add a to_s [image: 😄]


Reply to this email directly or view it on GitHubhttps://github.com//pull/117#issuecomment-15350863
.


Reply to this email directly or view it on GitHub.

@tamird
Copy link

tamird commented Mar 26, 2013

Nitpicking a bit, but this is not the right way to do it.

2.0.0p0 :020 > '4.0.0.beta1' > '4.0.0.1'
 => true
2.0.0p0 :021 > Gem::Version.new('4.0.0.beta1') > Gem::Version.new('4.0.0.1')
 => false

String comparison semantics are different from Gem::Version comparison semantics.

@indirect
Copy link
Member

It was more about getting it to not crash at the moment. Doing it right would be a Gem::Requirement:

Gem::Requirement.new(">= 4.0.0.beta").satisfied_by?(Rails.version)

@tamird
Copy link

tamird commented Mar 26, 2013

Ah, fair enough. #to_s is probably the only way to make things compatible for now, short of going to Rails::VERSION::<segment> =/

@guilleiguaran
Copy link
Member

can we get a new version of jquery-rails with this patch, please? 😁

@robertomiranda
Copy link
Contributor Author

@guilleiguaran would be nice 👍

@ai
Copy link
Contributor

ai commented Mar 28, 2013

Waiting for release with this fix.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants