From: Jim Weirich Date: 2004-06-25T10:18:27+09:00 Subject: Re: rubygems thoughts Sean O'Dell wrote: >>If you want a yaml file out of the process, build the spec and write out >>the results of spec.to_yaml. > > That sounds like what I need. Can I re-constitute the YAML into a native Ruby > data structure and pass it to Gem::Builder.new? Yes. > There are two parts of the build process. Gems has to create a package, and > the files and directories have to be prepared so Gems can build the package. > I like scripting the preparation part myself, and I wanted Gems to just take > meta data and create the final .gem from it. From the examples I've seen, > the .gemspec file (Ruby code) trims out CVS directories and such as part of > the package creation process. That means that the part I want to script, > preparing the files/directories, is spread out into two places: my build > script and the .gemspec script. There's nothing stopping you. The examples you have seen are building the gem from directly from CVS working directory and filter out the stuff they don't want. If you build a pristine directory with no extraneous files (which I do for tar and zip packages), then your file list in the gemspec can just be Dir["**/*"]. No need to filter out stuff in the gemspec if your scripts have done it for you. I'd prefer that .gemspec was just static > meta data and contained no code. But as I understand it, the .gemspec file > is used to create a static data structure that Gem::Builder uses, so maybe > that point is moot. I think I can load a static YAML file that I generate > myself and pass it to Gem::Builder.new. I think everything is there that you need. Have fun. -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)