From: Chad Perrin Date: 2011-11-12T13:20:24+09:00 Subject: Re: referring to version numbers in a gem --AqsLC8rIMeq19msA Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 12, 2011 at 09:09:32AM +0900, Ryan Davis wrote: > On Nov 11, 2011, at 14:04 , Chad Perrin wrote: > >=20 > > module GemName > > @version =3D Gem::Version.new 'N.N.N' >=20 > Just use a plain string here. No reason to drag in Gem::Version at this > point (rubygems is still pretty heavy). Also, a constant would be a > better fit. Using a constant could prove problematic. As I said in an earlier response: I'm using the Gem::Version thing for now in part because I've seen cases where for some reason a VERSION constant conflicts with something else in the Ruby environment. I haven't seen it in quite a while, but I don't want to have to deal with that kind of issue. > > > > def self.version; @version; end >=20 > There's no need for a class method here. Since the version string > really is constant (for a given install), and there isn't any morphing > you're going to do, stick with a const. See above. (et cetera) --=20 Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ] --AqsLC8rIMeq19msA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk6983AACgkQ9mn/Pj01uKV5UACgyzrz0XTRTbrawymQxdcwIKQB ZX8Ani/7RYxiGUX+k/JAt4jZfWP7LhBN =D6du -----END PGP SIGNATURE----- --AqsLC8rIMeq19msA--