UPnP Gem!

I have just discovered the power of the mkmf package in Ruby.
It simplify the way to build the upnp module a lot!
I just had to move the files to be compiled in a folder (called miniupnpc) and then just call this

require 'mkmf'
create_makefile("MiniUPNP","miniupnpc")

And i’ll have a makefile ready to compile the module, no matter which is you platform! With theis new knowledge and the immense usefulness of the ferret’s Rakefile i’have built and published a ruby gem that will install the UPnP module and the wrapper.

The name is simply mupnp. Installable with the gem utility. For windows the library must be precompiled, so it may not be immidiatly upated or released when needed.

There have been some API changes, to make it more ruby style, anyway it is nothing big, just check at the documentation of the methods and check for differences.
[Only addPortMapping and the initialize method had a change in the order of the arguments]

To install it just do:

gem install mupnp

And it will be downloaded and compiled on your mac/linux box. For windows version i’ll have to find someone to trust that will build it for me.

Advertisements

, , , , ,

  1. #1 by LeonB on July 12, 2008 - 12:50 am

    Thank you for your work! Would it be possible to use this gem for discovering media upnp servers?

    Thanks in advance!

  2. #2 by Dario on July 12, 2008 - 1:20 am

    This is based on the miniupnp library. If that library would support that i’ll update the code to include it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: