From: Dossy Date: 2002-06-12T04:45:37+09:00 Subject: Re: Modules and version determination On 2002.06.12, Mr. Sunblade wrote: > Hi all, > > I'm curious as to what you all think about an internal 'version()' method > for published modules. I've seen a few threads out on Google, but no > definitive consensus on the subject. > > In other words, should we always put a "version" method (or VERSION, or > _version_, or whatever) within our modules as a class method? If so, what > syntax do people prefer? > > Keep in mind that this could be used for raa.next (or will rubygems take > care of that?). > > The forum is now open. :) I think I brought this up on IRC, suggesting that a published module should have @@VERSION_MAJOR, @@VERSION_MINOR and @@VERSION_PATCHLEVEL defined. Maybe we just define a ModuleVersion class to make this easier. Have things like: @@version = ModuleVersion.new(3, 1, 4) # Version 3.1.4 @@version.to_s # => "3.1.4" @@version.to_a # => [3, 1, 4] @@version.major # => 3 @@version.minor # => 1 @@version.patchlevel # => 4 Just a thought, -- Dossy -- Dossy Shiobara mail: dossy@panoptic.com Panoptic Computer Network web: http://www.panoptic.com/ "He realized the fastest way to change is to laugh at your own folly -- then you can let go and quickly move on." (p. 70)