lib/jsonpath.rb in jsonpath-0.9.0 vs lib/jsonpath.rb in jsonpath-0.9.1
- old
+ new
@@ -12,10 +12,10 @@
attr_accessor :path
def initialize(path, opts = nil)
@opts = opts
- scanner = StringScanner.new(path)
+ scanner = StringScanner.new(path.strip)
@path = []
until scanner.eos?
if token = scanner.scan(/\$\B|@\B|\*|\.\./)
@path << token
elsif token = scanner.scan(/[\$@a-zA-Z0-9:_-]+/)