[Rubygems-developers] Gem-Spec Meta Information

Chad Fowler chad at chadfowler.com
Mon Jul 26 10:24:20 EDT 2004


It's amazine, Assaph.  The last two things you've posted about are things
that Rich and I have *just* talked about yesterday whle working on
RubyGems here at OSCON.  Specifically in this case, we were talking about
adding a generic "metadata" attribute to the gemspec to support a hash as
you suggest.  We'll probably do that this week.

As for you questions about the best route to take, I'm not sure (too early
yet, I think...need more coffee).  You mention wanting to extract the gem
spec, which you can do with:

require 'rubygems'
Gem::manage_gem
Gem.cache.search(/rake/, "> 0.4.0").last  # => Gem::Specification for rake

Chad
On Mon, 26 Jul 2004, Mehr, Assaph (Assaph) wrote:

# Hi Guys,
#
# Am now working on making app-gems installable as a regular application,
# i.e. with start-menu shortcuts, file-type associations etc. This is
# somewhat windows specific, but I think you can do similar stuff on
# linux. One of the nice things about it is that you can get many things
# easily from what's already included with ruby-gems. E.g. an
# update-product link.
#
# I plan to tell my users to install ruby (hopefully 1.8.2 will have gems
# built-in). Possibly install extensions that aren't gems right now (e.g.
# wxRuby) and then install my app. Thereafter they do not need to monkey
# with the command line to launch the app, the help file is more visible,
# i can bind file-types to my app, etc.
#
# My envisioned course of action is as follows:
# * Add some meta information in the gemspec file.
# * Have something else (see below) run after the regular gem is
# installed.
# * Have that something else extract the information and a
# Gem::Specification object and query it.
#
# I am thinking of adding a generic hash property on the
# Gem::Specification called 'meta'. My app-gem-installer will query for
# specific keys. Does something like this sound reasonable? :
#
# require 'rubygems'
# require 'app-gem-installer'
#
# spec = Gem::Specification.new do |s|
#   # open .aaa files with my app:
#   s.meta[AppGemInst::FTYPE]         = '.aaa'
#   # create a start-menu link to the help file:
#   s.meta[AppGemInst::HELP_FILE]     = 'doc/help.html'
#   # my app distribution server:
#   s.meta[AppGemInst::UPDATE_SERVER] = 'http://fox.mycompany.com:8808'
#   ...
# end
#
# I will then need to extract the spec from the .gem file and run
# something like: AppGemInst.new(spec).install
# (This is also why the post-install script mentioned sounds good.).
#
#
# Now for the AppGemInst implementation. I see two options, detailed
# below:
#
# 1. As a ruby script that generates an NSIS script
# + Has GUI
# + Knows how to install stuff on windows
# + Can bundle other stuff (like dependant extensions)
# - Windows only
#
# 2. Inside ruby-gems.
# + It is part of ruby gems distribution systems.
# + Easily extensible by pluggin-in a platform-installer. Each one will
# take only the relevant parts of the info.
# - No nice GUI to display license, errors etc.
# - No easy way to bundle non-gem extensions.
#
#
# Thoughts?
#
#
# Cheers,
# Assaph
#
#   _____
#
# Assaph Mehr
# Email: assaph at avaya.com
# Phone: +61-2-9352 9247
# Fax: +61-2-9352 9247 	Auslabs (Avaya Labs Australia)
# Level 3, 123 Epping Rd, North Ryde, NSW 2113
# Web: http://www.avaya.com <http://www.avaya.com/>
#
#   _____
#
#
#


More information about the Rubygems-developers mailing list