From: "Ara.T.Howard" Date: 2005-09-22T04:20:13+09:00 Subject: Re: What to do with the snippets of code you always use? On Thu, 22 Sep 2005, Damphyr wrote: > I have a question on maintaining code. While coding several scripts and a > couple of libraries, I developed some snippets I keep using over and over. > Things like a parseCommandline method with the standard switches I normally > use to be extended for each script, a couple of methods that I always use to > initialize Logger, stuff like that. Mostly these form part of my idiomatic > use of Ruby and I keep improving on them as I learn, so it makes sense to > keep them separate as a library and version them for my own sake, but they > do not form a releaseable library - everyone has his favorite idiom. Now, > as I said, I use these snippets everywhere, so obviously when I want to > release something I need to include the "private" library. Up until now, I > was lumping all this code in a file together with the script/library that > was the main subject. What would be the best way to maintain the snippet > code and use it all over? I tend towards the solution of grabing the latest > version of my "private" lib out of my repository and building a gem for the > actual 'product' then distribute that. Local development requires that I > install my snippet lib as a gem or in ruby/lib in my development box, but I > can live with that (it forces me to play nice with versions too). > Any other ideas? > V.- i do this http://www.codeforpeople.com/lib/ruby/alib/ note that the libs are versioned, therefore i can write require 'alib-0.1.0' in a script and install new versions as i learn/add without breaking existing scripts. for convenience i also have link installed so require 'alib' gets the latest version. cheers. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================