jmespath 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of jmespath might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d10b91c9178c774ea0fe4040a63a86a52ce278c9
4
- data.tar.gz: 642fe0e4e75e96b007bf9bb4c219f11d89fbe60b
3
+ metadata.gz: 19c5b88355ab37717abe9fd6889620749d9affe2
4
+ data.tar.gz: 15d6e2545f4a90599ee6de98d3ab48362e2314f3
5
5
  SHA512:
6
- metadata.gz: 614710b62cfd448fa00967c5000d4029c05ebcb3497e084f1be34cee8b3329dfa33348448d0e05e12378bf15c059cb81357b3e51d3d4a21f087b31b1f13b1a6e
7
- data.tar.gz: ac3225baa82586c8149ab7aeb178a82870421097f05aebb812bbc535f7d91a84b251a83128d561e7790f31f8123dae5df55290ab9b2ee135981244fa847f35a8
6
+ metadata.gz: 2d29161692e5f7728f85d5d406b70519ba02a40e62d279ea8800c5ab9f6e678f33a07a0bbcf8df2c90d68d6956363d439514fc1381950a4e5521948b7d0d91e1
7
+ data.tar.gz: 299455d9553de53a802a3ce4375ed652747b8258bfcaaeca47b2a897ae2cc946d53c88ac015c2e911babea432f2b096345470b050a3dc0a21145ca8ba035be3a
@@ -19,6 +19,7 @@ module JMESPath
19
19
  end
20
20
 
21
21
  autoload :Comparator, 'jmespath/nodes/comparator'
22
+ autoload :Comparators, 'jmespath/nodes/comparator'
22
23
  autoload :Condition, 'jmespath/nodes/condition'
23
24
  autoload :Current, 'jmespath/nodes/current'
24
25
  autoload :Expression, 'jmespath/nodes/expression'
@@ -36,5 +37,6 @@ module JMESPath
36
37
  autoload :ObjectProjection, 'jmespath/nodes/projection'
37
38
  autoload :Slice, 'jmespath/nodes/slice'
38
39
  autoload :Subexpression, 'jmespath/nodes/subexpression'
40
+
39
41
  end
40
42
  end
@@ -12,12 +12,12 @@ module JMESPath
12
12
  def self.create(relation, left, right)
13
13
  type = begin
14
14
  case relation
15
- when '==' then EqComparator
16
- when '!=' then NeqComparator
17
- when '>' then GtComparator
18
- when '>=' then GteComparator
19
- when '<' then LtComparator
20
- when '<=' then LteComparator
15
+ when '==' then Comparators::Eq
16
+ when '!=' then Comparators::Neq
17
+ when '>' then Comparators::Gt
18
+ when '>=' then Comparators::Gte
19
+ when '<' then Comparators::Lt
20
+ when '<=' then Comparators::Lte
21
21
  end
22
22
  end
23
23
  type.new(left, right)
@@ -38,39 +38,42 @@ module JMESPath
38
38
  end
39
39
  end
40
40
 
41
- class EqComparator < Comparator
42
- def check(left_value, right_value)
43
- left_value == right_value
41
+ module Comparators
42
+
43
+ class Eq < Comparator
44
+ def check(left_value, right_value)
45
+ left_value == right_value
46
+ end
44
47
  end
45
- end
46
48
 
47
- class NeqComparator < Comparator
48
- def check(left_value, right_value)
49
- left_value != right_value
49
+ class Neq < Comparator
50
+ def check(left_value, right_value)
51
+ left_value != right_value
52
+ end
50
53
  end
51
- end
52
54
 
53
- class GtComparator < Comparator
54
- def check(left_value, right_value)
55
- left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value > right_value
55
+ class Gt < Comparator
56
+ def check(left_value, right_value)
57
+ left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value > right_value
58
+ end
56
59
  end
57
- end
58
60
 
59
- class GteComparator < Comparator
60
- def check(left_value, right_value)
61
- left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value >= right_value
61
+ class Gte < Comparator
62
+ def check(left_value, right_value)
63
+ left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value >= right_value
64
+ end
62
65
  end
63
- end
64
66
 
65
- class LtComparator < Comparator
66
- def check(left_value, right_value)
67
- left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value < right_value
67
+ class Lt < Comparator
68
+ def check(left_value, right_value)
69
+ left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value < right_value
70
+ end
68
71
  end
69
- end
70
72
 
71
- class LteComparator < Comparator
72
- def check(left_value, right_value)
73
- left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value <= right_value
73
+ class Lte < Comparator
74
+ def check(left_value, right_value)
75
+ left_value.is_a?(Integer) && right_value.is_a?(Integer) && left_value <= right_value
76
+ end
74
77
  end
75
78
  end
76
79
  end
@@ -40,7 +40,7 @@ module JMESPath
40
40
  end
41
41
 
42
42
  class EqCondition < ComparatorCondition
43
- COMPARATOR_TO_CONDITION[EqComparator] = self
43
+ COMPARATOR_TO_CONDITION[Comparators::Eq] = self
44
44
 
45
45
  def visit(value)
46
46
  @left.visit(value) == @right.visit(value) ? @child.visit(value) : nil
@@ -67,7 +67,7 @@ module JMESPath
67
67
  end
68
68
 
69
69
  class NeqCondition < ComparatorCondition
70
- COMPARATOR_TO_CONDITION[NeqComparator] = self
70
+ COMPARATOR_TO_CONDITION[Comparators::Neq] = self
71
71
 
72
72
  def visit(value)
73
73
  @left.visit(value) != @right.visit(value) ? @child.visit(value) : nil
@@ -94,7 +94,7 @@ module JMESPath
94
94
  end
95
95
 
96
96
  class GtCondition < ComparatorCondition
97
- COMPARATOR_TO_CONDITION[GtComparator] = self
97
+ COMPARATOR_TO_CONDITION[Comparators::Gt] = self
98
98
 
99
99
  def visit(value)
100
100
  left_value = @left.visit(value)
@@ -104,7 +104,7 @@ module JMESPath
104
104
  end
105
105
 
106
106
  class GteCondition < ComparatorCondition
107
- COMPARATOR_TO_CONDITION[GteComparator] = self
107
+ COMPARATOR_TO_CONDITION[Comparators::Gte] = self
108
108
 
109
109
  def visit(value)
110
110
  left_value = @left.visit(value)
@@ -114,7 +114,7 @@ module JMESPath
114
114
  end
115
115
 
116
116
  class LtCondition < ComparatorCondition
117
- COMPARATOR_TO_CONDITION[LtComparator] = self
117
+ COMPARATOR_TO_CONDITION[Comparators::Lt] = self
118
118
 
119
119
  def visit(value)
120
120
  left_value = @left.visit(value)
@@ -124,7 +124,7 @@ module JMESPath
124
124
  end
125
125
 
126
126
  class LteCondition < ComparatorCondition
127
- COMPARATOR_TO_CONDITION[LteComparator] = self
127
+ COMPARATOR_TO_CONDITION[Comparators::Lte] = self
128
128
 
129
129
  def visit(value)
130
130
  left_value = @left.visit(value)
@@ -1,3 +1,3 @@
1
1
  module JMESPath
2
- VERSION = '1.1.1'
2
+ VERSION = '1.1.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jmespath
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Trevor Rowe
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-16 00:00:00.000000000 Z
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json