Forum: Ruby on Rails What happened to Rails::Version::STRING in Rails 1.0.0?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A41820ec1c74bfd179175d507da5159b?d=identicon&s=25 =?ISO-8859-2?Q?Rafa=B3_Komorowski?= (Guest)
on 2006-01-02 02:03
(Received via mailing list)
Hello,

Maybe it's a silly question, but I cannot find anything in Rails
changelog or google it out.
There is a Rails::Version module (since version 0.14.something) that
gives me a version number of Rails, similarily to Rails::Info module.
Apparently in Rails version 1.0 (or maybe sooner) the name of the
module was changed from 'Version' to 'VERSION' which breaks my
debugging template. Is there any reason for this change?
Of course I understand that there's no need to look behind 1.0 and
bother to keep the compatibility with anything older than 1.0, but
I'd like to widen my Ruby and Rails knowledge.

In 0.14.3 it looks like this:

	module Rails
	  module Version #:nodoc:
	    MAJOR = 0
	    MINOR = 14
	    TINY  = 3

	    STRING = [MAJOR, MINOR, TINY].join('.')
	  end
	end

and in 1.0.0 it looks like this:

	module Rails
	  module VERSION #:nodoc:
	    MAJOR = 1
	    MINOR = 0
	    TINY  = 0

	    STRING = [MAJOR, MINOR, TINY].join('.')
	  end
	end


--

Rafa³ Komorowski
komor@mac.com
GG: 4083718
<http://homepage.mac.com/komor/iblog/>
992fe8c19bbbc27f2b562a9f96efc03d?d=identicon&s=25 Jamis Buck (Guest)
on 2006-01-02 03:58
(Received via mailing list)
On Jan 1, 2006, at 6:03 PM, RafaÅ? Komorowski wrote:

> Hello,
>
> Maybe it's a silly question, but I cannot find anything in Rails
> changelog or google it out.
> There is a Rails::Version module (since version 0.14.something)
> that gives me a version number of Rails, similarily to Rails::Info
> module.
> Apparently in Rails version 1.0 (or maybe sooner) the name of the
> module was changed from 'Version' to 'VERSION' which breaks my
> debugging template. Is there any reason for this change?

Yup, there's a reason. The reason is that having Rails::Version
caused conflicts with models named Version (because of the way the
auto-loading code works). Rather than rewrite the auto-loading code
(which works well enough otherwise), the quick-n-dirty solution was
to just rename the Rails::Version module to Rails::VERSION.

This issue will be revisited in later Rails releases, though, so
please don't think this was an attempt to just sweep it under the rug.

- Jamis
A41820ec1c74bfd179175d507da5159b?d=identicon&s=25 =?ISO-8859-2?Q?Rafa=B3_Komorowski?= (Guest)
on 2006-01-03 11:22
(Received via mailing list)
On 02/01/2006, at 03:55, Jamis Buck wrote:

> Yup, there's a reason. The reason is that having Rails::Version
> caused conflicts with models named Version (because of the way the
> auto-loading code works).

Thanks for the info.

> This issue will be revisited in later Rails releases, though, so
> please don't think this was an attempt to just sweep it under the rug.

I see :-)
I hope this will be unchangeable behaviour, once set in first final
release (that is 1.0). I'm pretty sure you understand (better than
me) that version-checking is a sensitive matter, since it's the way
to make sure my application will behave properly or can be run in the
particular environment at all. For now I can just forget about
anything older that v1.0 (but not everyone can, right?) and use the
new syntax Rails::VERSION. If this breaks in next releases, then the
whole idea of version checking is broken.

Anyway, thanks for the info, thanks for the Rails :-) and happy new
year.


--

Rafa³ Komorowski
komor@mac.com
GG: 4083718
<http://homepage.mac.com/komor/iblog/>
This topic is locked and can not be replied to.