tupl-tufts / rdl

Types, type checking, and contracts for Ruby
BSD 3-Clause "New" or "Revised" License
602 stars 38 forks source link

rdl_query and RDL.query cannot parse complex class name #69

Closed baban closed 5 years ago

baban commented 6 years ago

I encount error like a below. When class name include '::', query dump error.

rdl_query 'ActiveRecord::Base#logger'
/home/baban/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/query.rb:98:in `block in query': Don't know how to handle query (RuntimeError)
        from /home/baban/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/switch.rb:13:in `off'
        from /home/baban/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/lib/rdl/query.rb:73:in `query'
        from /home/baban/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/rdl-2.1.0/bin/rdl_query:24:in `<top (required)>'
        from /home/baban/.rbenv/versions/2.4.1/bin/rdl_query:22:in `load'
        from /home/baban/.rbenv/versions/2.4.1/bin/rdl_query:22:in `<main>'
RDL.query 'ActiveRecord::Base#logger'
RuntimeError: Don't know how to handle query
        from (irb):3
mckaz commented 5 years ago

This is fixed in the dev branch, which will be merged with master shortly.