From: "Shot (Piotr Szotkowski)" Date: 2010-02-03T15:47:54+09:00 Subject: [ruby-core:28026] Re: RCR: RUBY_VERSION_INT --bg08WKrSYDhXBjb5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hugh Sasse: > On Wed, 3 Feb 2010, Shot (Piotr Szotkowski) wrote: >> I don=E2=80=99t like the =E2=80=98one digit=E2=80=99 policy, but this is= precisely why it was >> instituted =E2=80=93 to have string comparisons of version numbers =E2= =80=98just work=E2=80=99. > Having a Version class would solve this I agree =E2=80=93 I really don=E2=80=99t like artificial policies introduce= d just for side-stepping implementation details (but I also agree with Nobu that checking for features is the =E2=80=98right way=E2=80=99 in most cases =E2= =80=93 especially when such features can be added dynamically, regardless of Ruby version/implementation). > RUBY_VERSION > '1.9.0.9' > ArgumentError: comparison of Version with String failed If we were to have a Version class, there=E2=80=99d be no reason why it cou= ldn=E2=80=99t coerce Strings to Versions automagically on compare (it=E2=80=99d be the on= ly sane thing to do, IMHO, if RUBY_VERSION were to be a Version object). =E2=80=94 Shot --=20 The endless cycle of hope and disappointment has hardened cynicism. I am afraid that we have reached the point where talking is useless. [Jonathan Edwards, The Future of Programming] --bg08WKrSYDhXBjb5 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAktpHBYACgkQi/mCfdEo8Ur+PwCfffVSwV7OvR3U6oW7wRlPyg95 2msAoKieMtkUdrQFecUm04Rj6xkQ+eQP =5TJk -----END PGP SIGNATURE----- --bg08WKrSYDhXBjb5--