poller-json 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,17 @@
|
|
1
1
|
module Matchers
|
2
2
|
module JSON
|
3
|
-
class JSONPathHasArray
|
3
|
+
class JSONPathHasArray
|
4
|
+
include JSONPath
|
4
5
|
|
5
|
-
def initialize(json_path,
|
6
|
+
def initialize(json_path, json_array)
|
6
7
|
@json_path = json_path
|
7
|
-
@
|
8
|
+
@json_array = json_array.is_a?(Array) ? json_array : ::JSON.parse(json_array)
|
8
9
|
end
|
9
10
|
|
11
|
+
def matches?(document_s)
|
12
|
+
json_hash = ::JSON.parse(document_s)
|
13
|
+
value_on_path(json_hash, @json_path) == @json_array
|
14
|
+
end
|
10
15
|
end
|
11
16
|
end
|
12
17
|
end
|
@@ -1,12 +1,17 @@
|
|
1
1
|
module Matchers
|
2
2
|
module JSON
|
3
|
-
class JSONPathHasObject
|
3
|
+
class JSONPathHasObject
|
4
|
+
include JSONPath
|
4
5
|
|
5
|
-
def initialize(json_path,
|
6
|
+
def initialize(json_path, json_object)
|
6
7
|
@json_path = json_path
|
7
|
-
@
|
8
|
+
@json_object = json_object.is_a?(Hash) ? json_object : ::JSON.parse(json_object)
|
8
9
|
end
|
9
10
|
|
11
|
+
def matches?(document_s)
|
12
|
+
json_hash = ::JSON.parse(document_s)
|
13
|
+
value_on_path(json_hash, @json_path) == @json_object
|
14
|
+
end
|
10
15
|
end
|
11
16
|
end
|
12
17
|
end
|
@@ -3,16 +3,15 @@ module Matchers
|
|
3
3
|
class JSONPathHasValue
|
4
4
|
include JSONPath
|
5
5
|
|
6
|
-
def initialize(json_path,
|
6
|
+
def initialize(json_path, json_value)
|
7
7
|
@json_path = json_path
|
8
|
-
@
|
8
|
+
@json_value = json_value
|
9
9
|
end
|
10
10
|
|
11
11
|
def matches?(document_s)
|
12
12
|
json_hash = ::JSON.parse(document_s)
|
13
|
-
value_on_path(json_hash, @json_path) == @
|
13
|
+
value_on_path(json_hash, @json_path) == @json_value
|
14
14
|
end
|
15
|
-
|
16
15
|
end
|
17
16
|
end
|
18
17
|
end
|
data/lib/poller/json/version.rb
CHANGED
metadata
CHANGED
@@ -1,151 +1,117 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: poller-json
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.5
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
- 4
|
10
|
-
version: 0.1.4
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Markus Krogemann
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-06-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: poller
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
hash: 13
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 4
|
32
|
-
- 1
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
33
21
|
version: 0.4.1
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: multi_json
|
38
23
|
prerelease: false
|
39
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.4.1
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: multi_json
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
40
33
|
none: false
|
41
|
-
requirements:
|
34
|
+
requirements:
|
42
35
|
- - ~>
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 15
|
45
|
-
segments:
|
46
|
-
- 1
|
47
|
-
- 7
|
48
|
-
- 2
|
36
|
+
- !ruby/object:Gem::Version
|
49
37
|
version: 1.7.2
|
50
38
|
type: :runtime
|
51
|
-
version_requirements: *id002
|
52
|
-
- !ruby/object:Gem::Dependency
|
53
|
-
name: json
|
54
39
|
prerelease: false
|
55
|
-
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
56
41
|
none: false
|
57
|
-
requirements:
|
42
|
+
requirements:
|
58
43
|
- - ~>
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
|
61
|
-
|
62
|
-
- 1
|
63
|
-
- 7
|
64
|
-
- 7
|
65
|
-
version: 1.7.7
|
66
|
-
type: :runtime
|
67
|
-
version_requirements: *id003
|
68
|
-
- !ruby/object:Gem::Dependency
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 1.7.2
|
46
|
+
- !ruby/object:Gem::Dependency
|
69
47
|
name: rspec
|
70
|
-
|
71
|
-
requirement: &id004 !ruby/object:Gem::Requirement
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
72
49
|
none: false
|
73
|
-
requirements:
|
50
|
+
requirements:
|
74
51
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
hash: 59
|
77
|
-
segments:
|
78
|
-
- 2
|
79
|
-
- 13
|
80
|
-
- 0
|
52
|
+
- !ruby/object:Gem::Version
|
81
53
|
version: 2.13.0
|
82
54
|
type: :development
|
83
|
-
version_requirements: *id004
|
84
|
-
- !ruby/object:Gem::Dependency
|
85
|
-
name: simplecov
|
86
55
|
prerelease: false
|
87
|
-
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
57
|
none: false
|
89
|
-
requirements:
|
58
|
+
requirements:
|
90
59
|
- - ~>
|
91
|
-
- !ruby/object:Gem::Version
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.13.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: simplecov
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
97
69
|
version: 0.7.1
|
98
70
|
type: :development
|
99
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.7.1
|
100
78
|
description: JSON matchers that can be used on top of the 'poller' gem
|
101
|
-
email:
|
79
|
+
email:
|
102
80
|
- markus@krogemann.de
|
103
81
|
executables: []
|
104
|
-
|
105
82
|
extensions: []
|
106
|
-
|
107
83
|
extra_rdoc_files: []
|
108
|
-
|
109
|
-
|
84
|
+
files:
|
85
|
+
- lib/matchers/json/json_path_has_array.rb
|
86
|
+
- lib/matchers/json/json_path_has_value.rb
|
110
87
|
- lib/matchers/json/document_contains_json_path.rb
|
111
88
|
- lib/matchers/json/json_path.rb
|
112
|
-
- lib/matchers/json/json_path_has_array.rb
|
113
89
|
- lib/matchers/json/json_path_has_object.rb
|
114
|
-
- lib/matchers/json/json_path_has_value.rb
|
115
|
-
- lib/poller/json/version.rb
|
116
90
|
- lib/poller/poller_json.rb
|
91
|
+
- lib/poller/json/version.rb
|
117
92
|
homepage: https://github.com/mkrogemann/poller-json
|
118
|
-
licenses:
|
93
|
+
licenses:
|
119
94
|
- MIT
|
120
95
|
post_install_message:
|
121
96
|
rdoc_options: []
|
122
|
-
|
123
|
-
require_paths:
|
97
|
+
require_paths:
|
124
98
|
- lib
|
125
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
126
100
|
none: false
|
127
|
-
requirements:
|
128
|
-
- -
|
129
|
-
- !ruby/object:Gem::Version
|
130
|
-
|
131
|
-
|
132
|
-
- 0
|
133
|
-
version: "0"
|
134
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
106
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
140
|
-
segments:
|
141
|
-
- 0
|
142
|
-
version: "0"
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
143
111
|
requirements: []
|
144
|
-
|
145
112
|
rubyforge_project:
|
146
113
|
rubygems_version: 1.8.25
|
147
114
|
signing_key:
|
148
115
|
specification_version: 3
|
149
116
|
summary: JSON matchers
|
150
117
|
test_files: []
|
151
|
-
|