<< back to blog

.NET Gem Fun

.net ~ ruby ~ nhibernate

01 Feb, 2010

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...
.NET Gem Fun
Running FubuMVC on Mono (OSX)
Really Easy Way To Partition an ASP.NET MVC With An Admin Area
Automating .NET development (and NHibernate) with IronRuby + Rake
Get a Rails-Stylee Interactive Shell For Your NHibernate Backed Domain Model
In Memory SQLite Testing with NHibernate
NHibernate Trick
OSX MonoDevelop MVC?
NHibernate: Calling Update Unnecessarily
.NET Config for Multiple Developers

kick it on DotNetKicks.com
blog comments powered by Disqus