From: Jim Weirich Date: 2004-06-25T06:01:52+09:00 Subject: Re: rubygems thoughts Sean O'Dell said: > Use YAML as the control file instead of native Ruby. I think it would > make automating builds easier. Ruby is okay when you're hand-crafting, > but it makes automated build creation a little dicey. Not terribly, but > a little. Actually, the .gemspec file is optional, and I never build one for my projects. I just use Rake to control the building of the Gem::Specification object directly and then generate the gem from the spec object. Details can be found here: http://rubygems.rubyforge.org/wiki/wiki.pl?CreateAGemUsingRake If you want to build the spec automatically, but don't want to use Rake (shame on you), just create the Gem::Specification object in your code (as you would in a gemspec file). To create the gem from the Gem::Spcification, just use: builder = Gem::Builder.new(spec).build If you want a yaml file out of the process, build the spec and write out the results of spec.to_yaml. > Also, it would make it easier for third-parties to display information > about Gems. The spec is actually encoded in the gem as a Yaml structure. Extracting that yaml structure is about 5 lines of code, but it would be nice if there was library support for that (and there might be, I'm not sure). I'll look into that. > I think Gems right now handles a little of the build process, but I have > to tell you from experience, it doesn't handle everything, so my Gems > build process is a hodge-podge of me partially creating the directory > structure with some scripts, and then Gems seems to do some work of its > own, adding directories according to the delete_if call. Perhaps Gems > shouldn't do any building at all; perhaps it should be more like Debian > apt where all it does is bundle what you tell it to using a control file > with meta information. > > Leaving the build process to the developers seems natural to me, and it > would make your (Gems developers) job easier and more clear. All you > would have to do it install what the control file tells you to. Let the > developers create their directories in the way they want, and generate the > control file, Gems could just bundle it all up and handle the > distribution tasks (download, install, uninstall, etc.). > > I hope that made sense. It seems like a lot to ask for, but it should > eliminate a whole lot of code surrounding the gem build process. If what > I'm thinking came out right, it should amount to more control to the > developers, less work for you guys and good meta information for everyone. I will confess that I've read the above several times and am a bit confused. Are you refering to the process of bundling up the package files in to a gemfile, or the process where a gem file is installed onto a system. I think it is the former, but then I'm not sure what part of the build process you think gem performs. I am not aware of any directories added by the "gem -b" command. Could you give an example? And again, thanks for the feedback. -- -- 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)