nearinfinity/blur — Issue #167: ruby thrift binding are broken
Author: wanderview
Created: 2012-02-09 02:59:39+00:00
State: open

The ruby thrift bindings are currently broken. For example:

```ruby
#!/usr/bin/env ruby

$LOAD_PATH.unshift '../blur/interface/gen-rb'

require 'blur'
```

Produces the following:

```
/Users/bkelly/devel/git/blur/interface/gen-rb/blur.rb:660:in `': uninitialized constant Blur::Blur::BlurException (NameError)
from /Users/bkelly/devel/git/blur/interface/gen-rb/blur.rb:653:in `'
from /Users/bkelly/devel/git/blur/interface/gen-rb/blur.rb:11:in `'
from /Users/bkelly/devel/git/blur/interface/gen-rb/blur.rb:10:in `'
from /Users/bkelly/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/bkelly/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from ./boom.rb:5:in `

'
```

It appears this is a known issue with nested modules in thrift:

https://issues.apache.org/jira/browse/THRIFT-556

I tried regenerating the bindings with thrift 0.8.0 and the problem persists.

As a heavy-handed work around the file can be corrected with something like this:

```bash
sed -i -e 's/ Blur::/ ::Blur::/g' blur.rb
```