Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Support Ruby 2.0 #55

ffeldhaus opened this Issue · 5 comments

2 participants


rSpec tests currently fail for Ruby 2.0. There seem to be an issue with the :after hook in the client rspecs. Maybe the garbage collector removes the client object before the :after hook gets executed.

Error messages:

An error occurred in an after hook
NoMethodError: undefined method `logger' for nil:NilClass
occurred at /home/travis/build/gwdg/rOCCI/spec/occi/api/client/client_http_spec.rb:25:in `block (3 levels) in <module:Client>'
@arax arax was assigned

After a code clean-up in tests:

       comparison of String with 9 failed
     # ./lib/occiantlr/OCCIANTLRLexer.rb:1423:in `token!'
     # ./lib/occiantlr/OCCIANTLRParser.rb:135:in `initialize'
     # ./lib/occi/parser.rb:145:in `new'
     # ./lib/occi/parser.rb:145:in `block in text_categories'
     # ./lib/occi/parser.rb:144:in `each_line'
     # ./lib/occi/parser.rb:144:in `text_categories'
     # ./lib/occi/parser.rb:33:in `parse'
     # ./lib/occi/api/client/client_http.rb:736:in `get'
     # ./lib/occi/api/client/client_http.rb:959:in `set_model'
     # ./lib/occi/api/client/client_http.rb:126:in `initialize'
     # ./spec/occi/api/client/client_http_spec.rb:14:in `new'
     # ./spec/occi/api/client/client_http_spec.rb:14:in `block (3 levels) in <module:Client>'

This seems to be the real issue previously masked by a different problem.


I've changed the label on this issue to 'bug' since Ruby 2.0.0-p0 is officially out and stable.


This is caused by the autogenerated code from ANTLR Parser. It may be the right time to get rid of ANTLR Parser as it introduces lots of problems, generates ugly code and is not really maintainable. I will have a look at the parsing of text messages next weekend and check if we can replace the ANTLR Parser with regular expressions.


Good idea, I just checked and the antlr3 gem we are using hasn't been updated for almost 2 years now and seems to be abandoned. Native Ruby Regexps might be the right way forward ...

I found two other options (both based on grammars or grammar-like structures):

Both projects are active, they might give us code that's easier to maintain than complicated Regexps. Ragel's support for Ruby is native and TreeTop provides quite appealing grammar specifications using DSL in Ruby. What do you think?


fixed by pull request #75

@ffeldhaus ffeldhaus closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.