Closed
Description
JMESPath 1.1.3 seems to require Ruby 2.0.0 for proper operation.
Under ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]
, I get:
RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:49:in `method_missing': unexpected token 0 (JMESPath::Errors::SyntaxError)
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:60:in `expr'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:145:in `led_comparator'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:62:in `expr'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:161:in `led_filter'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:62:in `expr'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:267:in `parse_multi_select_list'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:117:in `nud_lbracket'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:60:in `expr'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:212:in `led_pipe'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:62:in `expr'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/parser.rb:38:in `parse'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/caching_parser.rb:25:in `block in cache_expression'
from <internal:prelude>:10:in `synchronize'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/caching_parser.rb:23:in `cache_expression'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/caching_parser.rb:16:in `parse'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath/runtime.rb:51:in `search'
from RUBYROOT/ruby/gems/1.9.1/gems/jmespath-1.1.3/lib/jmespath.rb:33:in `search'
from /tmp/a.rb:8:in `<main>'
Input:
{
"failures": [],
"services": [
{
"clusterArn": "arn:aws:ecs:us-east-1:3:cluster/QA",
"deployments": [
{
"createdAt": 1446670761.244,
"desiredCount": 1,
"id": "ecs-svc/9",
"pendingCount": 0,
"runningCount": 1,
"status": "PRIMARY",
"taskDefinition": "arn:aws:ecs:us-east-1:3:task-definition/foo:15",
"updatedAt": 2.244
}
],
"desiredCount": 1,
"events": [
{
"createdAt": 1.651,
"id": "0542993e-ab0e-x-86fa-55d544103377",
"message": "(service ) has reached a steady state."
}
],
"loadBalancers": [],
"pendingCount": 0,
"runningCount": 1,
"serviceArn": "arn:aws:ecs:us-east-1:3:service/FOO",
"serviceName": "FOO",
"status": "ACTIVE",
"taskDefinition": "arn:aws:ecs:us-east-1:3:task-definition/FOO:15"
}
]
}
Script:
require 'jmespath'
require 'pp'
pp JMESPath.search('services[0] | [@[?length(deployments)!=`1`], @[?desiredCount!=runningCount]]', Pathname.new('/tmp/a'))
Under ruby 2.0.0p645 (2015-04-13 revision 50299) [x86_64-linux]
I get:
[nil, nil]
Metadata
Metadata
Assignees
Labels
No labels