Ruby Bindings released on Github

2010-07-15
2012-12-11
  • David Martinez

    David Martinez - 2010-07-15

    Hello, and congratulations on mediainfo's success.

    I just released a mediainfo gem that seems to work on OSX (trying it on CentOS linux next). It's not complete but it does support full querying of all the enumeratable MediaInfo::Options. It returns them in a nice, ruby friendly map.

    Please check it out at http://github.com/hackerdude/mediainfo-ruby or just install it via rubygems and let me know what you think.

    Thanks!

     
  • Jerome Martinez

    Jerome Martinez - 2010-07-15

    Thanks!

    I would like to use it and put it in my official release after some adaptation (I try to have the same example for all bindings), what would be the license of your work?

     
  • David Martinez

    David Martinez - 2010-07-15

    LGPL just like yours since it's just the bindings. I'm going to use them on a hosted service for metachannels.com. We're doing this in order to integrate with one of our partners who I'll name once I get a go-ahead from them.

    Expect some patches from us soon. In particular right now I have some changes to the CMakeLists (is anyone maintaining that portion?) so it builds with MacPorts on the Mac (and I also need to build it on Linux (CentOS) for the production machines. Should I just post the patch on the patches section of this project?

    On the bindings thing, go ahead and include it if you want, definitely. I'm using a gem called ruby-rice that can wrap and quickly map C++ classes so the programming model is very similar since it's just direct calls to the lib through the DLL headers (just mostly lowercasing and slightly changing names of overloaded methods and whatnot). I would like to keep the gem available through gemcutter and can update it when you change libmediainfo versions if that's ok with you (since ruby people are so used to just typing gem install after installing the C library).

    I tried to use SWIG for it, alas, too much work versus the tiny 65 line .cpp I had to write with ruby-rice :-)

    There's really just two files that are important:

    ext/mediainfo_ruby/mediainfo_ruby.cpp is the rice mapping stuff. It gets your header in and maps constants and the MediaInfo class. I plan on adding to this more and more classes as we can make it richer.

    The other file, lib/mediainfo-ruby.rb itself contains some rubyisms that get added to the class as a ruby module, and it's mainly to do some mapping of ruby symbols to constants and to fill ruby-friendly maps with the options and the entire set of values. We ruby people are lazy and like our stuff ruby-style. :-)

     
  • Jerome Martinez

    Jerome Martinez - 2010-07-15

    LGPL just like yours since it's just the bindings.

    Thanks

    Expect some patches from us soon.

    Go! :)

    In particular right now I have some changes to the CMakeLists (is anyone maintaining that portion?)

    I had one known user, I (the maintainer) don't use it, I only try to not break it when I add a cpp file.
    So yes, it may be broken, nobody with paid support uses it so I don't verify it before each release.

    > Should I just post the patch on the patches section of this project?

    Yes

    > On the bindings thing, go ahead and include it if you want, definitely

    I am currently a bit busy with features, so I think the fisrt step will be a link to github in my DLL package as an unsopported binding, and I will see how I can compile later.

    >  (just mostly lowercasing and slightly changing names

    Eh! I like my uppercase names! :)

     

Log in to post a comment.