Ruby OData Update v0.0.8

March 14, 2011 • Damien White

OData_logo_MS_smallIt has been WAY too long since an update of ruby_odata was released.  I’m happy to announce that version 0.0.8 was released today.  The biggest change, thanks to J.D. Mullin, is support for Basic HTTP Authentication.  It’s an awesome enhancement and very easy to use.  All you need to do is pass in the username and password as constructor arguments when instantiating a service like so:

require 'lib/ruby_odata'

svc = OData::Service.new "http://127.0.0.1:8888/SampleService/Entities.svc", { :username => "bob", :password=> "12345" }

In addition to the big change by @jdmullin, the following changes are apart of the new version:

  • Support for nullable primitive types being returned from an OData service.
  • A change in ActiveSupport 3.0.x broke additions in ruby_odata when you associate a previously saved entity.  This has been corrected, and ActiveSupport 2.3.x (tested 2.3.11) and 3.0.x (tested 3.0.5) are now supported. 
  • Ruby 1.9.2 is now supported.

Other “backend” type enhancements were added:

  • Removed Jeweler for releasing gems
  • Moved to bundler
  • Updated README to reflect new changes
  • Updated DB management so that testers aren’t required to move files around
  • Fixed gemspec to list the development gems
  • Developers can just do a “bundle install” to get all the required gems

One interesting thing that I found while testing is that Ruby 1.9.2 is much faster when running Cucumber tests on Windows.  I was using Ruby 1.8.7-p330 vs 1.9.2-p180 on Windows (RubyInstaller rocks!).  Here’s a snapshot:

CucumberRubyVersionComparison

Note there is a bit of a problem using Ruby 1.9.2 w/ Cucumber on Windows.  The problem is that when using bundler or “gem install,” the json gem gets installed as the x86-mingw32 version.  Running cucumber on Windows with Ruby 1.9.2 (using the incorrectly compiled json gem) yields a msvcrt-ruby18.dll error.  The way I fixed the error was to install the RubyInstaller DevKit, and then reinstall the gem “correctly” using:

gem uninstall json
gem install json --platform=ruby -v 1.4.6

What we are doing is uninstalling the incorrect copy of the json gem and then installing v1.4.6 of json using the –platform=ruby flag which will involve the DevKit to compile the gem for us.  Note that the json gem version required by Cucumber 0.10.0 is ~> 1.4.6, and there is a new version out, so the -v 1.4.6 forces the correct one.  Found the solution on StackOverflow,  but it seems that there should be a better way to solve this, perhaps with bundle-config?

Posted in ruby, ruby_odata, wcf data services and tagged with OData, Ruby, WCF

Damien White

I am a software architect with over 16 years of experience. I simply love coding! I have a driving passion for computers and software development, and a thirst for knowledge that just cannot be quenched. I'm happy to share what I know in my quest to learn as much as possible. I focus most of my time on web development using Ruby on Rails, Ember.js, and ASP.NET MVC.

comments powered by Disqus