Feb 01, 2010 / .net ~ ruby ~ nhibernate
.NET Gem Fun

RubyGems is great for sharing Ruby code libraries.

Just for fun, I thought I'd play with the idea of using rubygems for packaging up .NET libraries. After a few hours of messing about, I finally have this.

$ gem search nhib -d

*** LOCAL GEMS ***

dotnet-nhibernate (2.1.2)
    Authors: ayenderahien, fabiomaulo, karlchu, sbohlen
    Homepage: http://nhforge.org
    Installed at: /Users/apple/.gem/ruby/1.8

    .NET port of the excellent Java Hibernate which provides
    Object/Relational mapping to persist objects in a relational
    database.

My dotnet-nhibernate gem is really simple; all it does is download the correct nhibernate zip from sourceforge and unpack it somewhere sensible.

Despite being in Ruby (not great for .NET lovers), the beauty of gems is:

  • You can list them
  • You can search them
  • You can install different versions
  • Dependencies can be automatically installed
  • You can write gems where custom installation code is executed after install
  • You can set up several mirrored gem repos
  • There's great tooling out there for creating gems, such as jeweller.

I quite like the idea of having a personal gem repo for fast installation of common libraries I use. Ideally, I'd have something like this:

$ gem list dotnet --remote --source http://gems.engineroomapps.com

*** LOCAL GEMS ***

dotnet-nhibernate (2.1.2, 2.1.0, 1.2.0)
dotnet-linfu (0.1)
dotnet-nunit (2.0)
dotnet-subsonic (0.2)
dotnet-sharparchitecture (1.0)
dotnet-fubumvc (1.0)
dotnet-mvccontrib (1.0)
dotnet-nhsearch (1.0)
dotnet-nhvalidator (1.0)
dotnet-burrow (1.0)

Not got that far yet.

And of course, now that we have Horn, this might be a pointless exercise?


You may also like...