[Rubygems-developers] Stubs are done

Gavin Sinclair gsinclair at soyabean.com.au
Mon Aug 23 15:20:31 EDT 2004


I've implemented library stubs; see ChangeLog below.

    2004-08-24  Gavin Sinclair  <gsinclair at soyabean.com.au>

        * lib/rubygems/installer.rb: Library stubs are now installed as per
          'library_stubs' gemspec attribute.  A stub is (still) also installed
          for the 'autorequire' attribute.  All library stub handling
          refactored into two new classes: LibraryStubs and LibraryStub.

        * test/test_parse_commands.rb: as per 2004-08-17 below, the 'update'
          command takes --rdoc as its default now.

There's a bit of a performance drain with these things, though.  Using
extensions-0.3.9.gem (not in the repo), I got the following
consistent measurements:

A. With the library directly installed

  $ time ruby -rextensions/all -e 'puts 5.to_s.tabto(10)'
  real    0m0.349s
  user    0m0.170s
  sys     0m0.150s

B. With the library accessed through RubyGems stubs

  $ time ruby -rextensions/all -e 'puts 5.to_s.tabto(10)'
  real    0m2.859s
  user    0m1.592s
  sys     0m0.831s

'extensions/all' loads 10 other files (all via stubs) so it's a good


More information about the Rubygems-developers mailing list