mruby/mruby — pull request #479 by bovi (2012-09-23 18:06:19+00:00)
Title: mrbgems

**mrbgems is a library manager to integrate C and Ruby extensions in an easy and standardised way into mruby.**

This is a follow up to #470

After talking shortly to matz on the RubyKaigi in Sapporo I have worked over the last week to bring this implementation up to an usable state. The current implementation can integrate extensions build in C or Ruby.

## Documentation

I have written a documentation for mrbgems (located under doc/mrbgems) and prepared two example Gems (one pure Ruby extension and one pure C extension).

## Test

### Test of gems

A Gem can have tests which will be automatically integrated by the build process into mrbtest.

### Test of mrbgems

I have tested C and Ruby Extension on:

Mac OS X (10.8.2)
Darwin 12.2.0 Darwin Kernel Version 12.2.0; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64

Ubuntu 64bit
Linux 3.2.0-23-generic Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

## Overhead

I have check the overhead of the implementation. In case no Gem exists the impact to the size of the mruby binary is:

### before:
550452 (538K) mirb
534828 (522K) mrbc
550224 (537K) mruby

### after:
550788 (538K) mirb
534956 (522K) mrbc
550560 (538K) mruby

These binaries were compiled on Mac OS X (10.8.2) with "-g -O3". **The overhead is only 336 bytes.**