Skip to content

Instantly share code, notes, and snippets.

@richardc
Created February 19, 2014 20:28
Show Gist options
  • Save richardc/9100814 to your computer and use it in GitHub Desktop.
Save richardc/9100814 to your computer and use it in GitHub Desktop.
require 'puppetdb/connection'
puppetdb = PuppetDB::Connection.new("localhost", 42)
query = puppetdb.parse_query("Class{foo=bar-baz}")
puts query.inspect
$ ruby foo.rb
/Users/richardc/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/ruby-puppetdb-1.4.0/lib/puppetdb/lexer.rb:131:in `scan_evaluate': can not match: '-baz}' (PuppetDB::Lexer::ScanError)
from /Users/richardc/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/ruby-puppetdb-1.4.0/lib/puppetdb/lexer.rb:28:in `scan_str'
from /Users/richardc/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/ruby-puppetdb-1.4.0/lib/puppetdb/connection.rb:21:in `parse_query'
from foo.rb:3:in `<main>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment