From: Intransition Date: 2011-11-13T07:31:18+09:00 Subject: Re: referring to version numbers in a gem ------=_Part_2338_23590036.1321137075503 Content-Type: multipart/alternative; boundary="----=_Part_2339_31637231.1321137075503" ------=_Part_2339_31637231.1321137075503 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Keep the data where ever you want, Rubygems has tossed the FHS out the window so it doesn't really matter. The common way that has sprouted up, popularized by Bundler, is rather ass backwards from the developers point of view. So flip it: module MyShit VERSION = File.read(File.dirname(__FILE__)+'/../VERSION').strip end Now that's a rather simplistic approach, I can show you much better, but it conveys the idea. Of course, it all sort of begs the question of why Ruby itself isn't version aware and could just tell us the version of a library, without developer's having to manually insert it. ------=_Part_2339_31637231.1321137075503 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Keep the data where ever you want, Rubygems has tossed the FHS out the window so it doesn't really matter. 

The common way that has sprouted up, popularized by Bundler, is rather ass backwards from the developers point of view. So flip it:

    module MyShit
      VERSION = File.read(File.dirname(__FILE__)+'/../VERSION').strip
    end

Now that's a rather simplistic approach, I can show you much better, but it conveys the idea.

Of course, it all sort of begs the question of why Ruby itself isn't version aware and could just tell us the version of a library, without developer's having to manually insert it.

------=_Part_2339_31637231.1321137075503-- ------=_Part_2338_23590036.1321137075503--