kronk 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/README.rdoc +21 -21
- data/lib/kronk/test/helper_methods.rb +3 -3
- data/lib/kronk.rb +1 -1
- data/test/test_helper_methods.rb +15 -15
- metadata +43 -6
- data/.gemtest +0 -0
data/History.rdoc
CHANGED
data/README.rdoc
CHANGED
@@ -163,11 +163,11 @@ The previous example will narrow down the parsed data returned to
|
|
163
163
|
something like:
|
164
164
|
|
165
165
|
{
|
166
|
-
"data"
|
167
|
-
"path1"
|
168
|
-
"path2"
|
166
|
+
"data": {
|
167
|
+
"path1": "value1",
|
168
|
+
"path2": [
|
169
169
|
{
|
170
|
-
"child"
|
170
|
+
"child": "child value"
|
171
171
|
}
|
172
172
|
]
|
173
173
|
}
|
@@ -179,10 +179,10 @@ flag it to remove data:
|
|
179
179
|
$ kronk http://host.com -- -data/path2
|
180
180
|
|
181
181
|
{
|
182
|
-
"data"
|
183
|
-
"path1"
|
184
|
-
"path3"
|
185
|
-
"path4"
|
182
|
+
"data": {
|
183
|
+
"path1": "value1",
|
184
|
+
"path3": "value3",
|
185
|
+
"path4": "value4"
|
186
186
|
}
|
187
187
|
}
|
188
188
|
|
@@ -192,12 +192,12 @@ attribute, you can do so by appending "/.." to the path.
|
|
192
192
|
$ kronk http://host.com -- data/path2/1/child/..
|
193
193
|
|
194
194
|
{
|
195
|
-
"data"
|
196
|
-
"path2"
|
195
|
+
"data": {
|
196
|
+
"path2": [
|
197
197
|
{
|
198
|
-
"first_child"
|
199
|
-
"child"
|
200
|
-
"last_child"
|
198
|
+
"first_child": "first value",
|
199
|
+
"child": "child value",
|
200
|
+
"last_child": "last value"
|
201
201
|
},
|
202
202
|
]
|
203
203
|
}
|
@@ -210,16 +210,16 @@ end of the path in the following fashion:
|
|
210
210
|
$ kronk host.com -- data/path2/1//i
|
211
211
|
|
212
212
|
{
|
213
|
-
"data"
|
214
|
-
"PATH2"
|
213
|
+
"data": {
|
214
|
+
"PATH2": [
|
215
215
|
"item at index 1"
|
216
216
|
],
|
217
217
|
|
218
|
-
"path2"
|
218
|
+
"path2": [
|
219
219
|
{
|
220
|
-
"first_child"
|
221
|
-
"child"
|
222
|
-
"last_child"
|
220
|
+
"first_child": "first value",
|
221
|
+
"child": "child value",
|
222
|
+
"last_child": "last value"
|
223
223
|
}
|
224
224
|
]
|
225
225
|
}
|
@@ -229,8 +229,8 @@ end of the path in the following fashion:
|
|
229
229
|
$ kronk host.com -- data/**=*foobar*//im
|
230
230
|
|
231
231
|
{
|
232
|
-
"data"
|
233
|
-
"subdata"
|
232
|
+
"data": {
|
233
|
+
"subdata": "test for\nFOOBAR\nmultiline"
|
234
234
|
}
|
235
235
|
}
|
236
236
|
|
@@ -50,8 +50,8 @@ class Kronk
|
|
50
50
|
uri2, options = nil, uri2.merge(options) if Hash === uri2
|
51
51
|
|
52
52
|
if uri2
|
53
|
-
@responses = [
|
54
|
-
|
53
|
+
@responses = [Kronk.retrieve(uri1, options),
|
54
|
+
Kronk.retrieve(uri2, options)]
|
55
55
|
@response = @responses.last
|
56
56
|
|
57
57
|
@datas = @responses.map do |r|
|
@@ -67,7 +67,7 @@ class Kronk
|
|
67
67
|
@diff = Diff.new_from_data(*@datas)
|
68
68
|
|
69
69
|
else
|
70
|
-
@response =
|
70
|
+
@response = Kronk.retrieve uri1, options
|
71
71
|
@responses = [@response]
|
72
72
|
|
73
73
|
@data = begin
|
data/lib/kronk.rb
CHANGED
data/test/test_helper_methods.rb
CHANGED
@@ -11,12 +11,12 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
11
11
|
@mock_resp2 = Kronk::Response.new \
|
12
12
|
StringIO.new mock_resp("200_response.json")
|
13
13
|
|
14
|
-
Kronk
|
14
|
+
Kronk.stubs(:retrieve).returns @mock_resp
|
15
15
|
end
|
16
16
|
|
17
17
|
|
18
18
|
def test_get
|
19
|
-
Kronk
|
19
|
+
Kronk.expects(:retrieve).
|
20
20
|
with("host.com", :foo => "bar", :http_method => :get).
|
21
21
|
returns @mock_resp
|
22
22
|
|
@@ -25,7 +25,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
25
25
|
|
26
26
|
|
27
27
|
def test_get_two
|
28
|
-
Kronk
|
28
|
+
Kronk.expects(:retrieve).times(2).
|
29
29
|
with("host.com", :foo => "bar", :http_method => :get).
|
30
30
|
returns @mock_resp
|
31
31
|
|
@@ -34,7 +34,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
34
34
|
|
35
35
|
|
36
36
|
def test_post
|
37
|
-
Kronk
|
37
|
+
Kronk.expects(:retrieve).
|
38
38
|
with("host.com", :foo => "bar", :http_method => :post).
|
39
39
|
returns @mock_resp
|
40
40
|
|
@@ -43,7 +43,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
43
43
|
|
44
44
|
|
45
45
|
def test_post_two
|
46
|
-
Kronk
|
46
|
+
Kronk.expects(:retrieve).times(2).
|
47
47
|
with("host.com", :foo => "bar", :http_method => :post).
|
48
48
|
returns @mock_resp
|
49
49
|
|
@@ -52,7 +52,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
52
52
|
|
53
53
|
|
54
54
|
def test_put
|
55
|
-
Kronk
|
55
|
+
Kronk.expects(:retrieve).
|
56
56
|
with("host.com", :foo => "bar", :http_method => :put).
|
57
57
|
returns @mock_resp
|
58
58
|
|
@@ -61,7 +61,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
61
61
|
|
62
62
|
|
63
63
|
def test_put_two
|
64
|
-
Kronk
|
64
|
+
Kronk.expects(:retrieve).times(2).
|
65
65
|
with("host.com", :foo => "bar", :http_method => :put).
|
66
66
|
returns @mock_resp
|
67
67
|
|
@@ -71,7 +71,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
71
71
|
|
72
72
|
|
73
73
|
def test_delete
|
74
|
-
Kronk
|
74
|
+
Kronk.expects(:retrieve).
|
75
75
|
with("host.com", :foo => "bar", :http_method => :delete).
|
76
76
|
returns @mock_resp
|
77
77
|
|
@@ -80,7 +80,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
80
80
|
|
81
81
|
|
82
82
|
def test_delete_two
|
83
|
-
Kronk
|
83
|
+
Kronk.expects(:retrieve).times(2).
|
84
84
|
with("host.com", :foo => "bar", :http_method => :delete).
|
85
85
|
returns @mock_resp
|
86
86
|
|
@@ -89,7 +89,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
89
89
|
|
90
90
|
|
91
91
|
def test_retrieve_one
|
92
|
-
Kronk
|
92
|
+
Kronk.expects(:retrieve).
|
93
93
|
with("host.com", :foo => "bar", :test => "thing").returns @mock_resp
|
94
94
|
|
95
95
|
@mock_resp.expects(:selective_data).with(:foo => "bar", :test => "thing").
|
@@ -108,10 +108,10 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
108
108
|
|
109
109
|
|
110
110
|
def test_retrieve_two
|
111
|
-
Kronk
|
111
|
+
Kronk.expects(:retrieve).
|
112
112
|
with("host1.com", :foo => "bar").returns @mock_resp
|
113
113
|
|
114
|
-
Kronk
|
114
|
+
Kronk.expects(:retrieve).
|
115
115
|
with("host2.com", :foo => "bar").returns @mock_resp2
|
116
116
|
|
117
117
|
@mock_resp.expects(:selective_data).with(:foo => "bar").returns @json
|
@@ -136,7 +136,7 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
136
136
|
def test_retrieve_unparsable
|
137
137
|
mock_resp = Kronk::Response.new StringIO.new(mock_200_response)
|
138
138
|
|
139
|
-
Kronk
|
139
|
+
Kronk.expects(:retrieve).
|
140
140
|
with("host.com", :foo => "bar").returns mock_resp
|
141
141
|
|
142
142
|
retrieve "host.com", :foo => "bar"
|
@@ -154,10 +154,10 @@ class TestHelperMethods < Test::Unit::TestCase
|
|
154
154
|
def test_retrieve_two_unparsable
|
155
155
|
mock_resp = Kronk::Response.new StringIO.new(mock_200_response)
|
156
156
|
|
157
|
-
Kronk
|
157
|
+
Kronk.expects(:retrieve).
|
158
158
|
with("host1.com", :foo => "bar").returns mock_resp
|
159
159
|
|
160
|
-
Kronk
|
160
|
+
Kronk.expects(:retrieve).
|
161
161
|
with("host2.com", :foo => "bar").returns mock_resp
|
162
162
|
|
163
163
|
|
metadata
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kronk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 5
|
9
|
+
- 1
|
10
|
+
version: 1.5.1
|
6
11
|
platform: ruby
|
7
12
|
authors:
|
8
13
|
- Jeremie Castagna
|
@@ -10,7 +15,8 @@ autorequire:
|
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
17
|
|
13
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-12 00:00:00 -07:00
|
19
|
+
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: json
|
@@ -20,6 +26,10 @@ dependencies:
|
|
20
26
|
requirements:
|
21
27
|
- - ~>
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 5
|
30
|
+
segments:
|
31
|
+
- 1
|
32
|
+
- 5
|
23
33
|
version: "1.5"
|
24
34
|
type: :runtime
|
25
35
|
version_requirements: *id001
|
@@ -31,6 +41,11 @@ dependencies:
|
|
31
41
|
requirements:
|
32
42
|
- - ~>
|
33
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 19
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 3
|
48
|
+
- 0
|
34
49
|
version: 0.3.0
|
35
50
|
type: :runtime
|
36
51
|
version_requirements: *id002
|
@@ -42,6 +57,11 @@ dependencies:
|
|
42
57
|
requirements:
|
43
58
|
- - ~>
|
44
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 3
|
63
|
+
- 1
|
64
|
+
- 0
|
45
65
|
version: 3.1.0
|
46
66
|
type: :development
|
47
67
|
version_requirements: *id003
|
@@ -53,6 +73,10 @@ dependencies:
|
|
53
73
|
requirements:
|
54
74
|
- - ~>
|
55
75
|
- !ruby/object:Gem::Version
|
76
|
+
hash: 7
|
77
|
+
segments:
|
78
|
+
- 1
|
79
|
+
- 4
|
56
80
|
version: "1.4"
|
57
81
|
type: :development
|
58
82
|
version_requirements: *id004
|
@@ -64,6 +88,11 @@ dependencies:
|
|
64
88
|
requirements:
|
65
89
|
- - ~>
|
66
90
|
- !ruby/object:Gem::Version
|
91
|
+
hash: 35
|
92
|
+
segments:
|
93
|
+
- 0
|
94
|
+
- 9
|
95
|
+
- 12
|
67
96
|
version: 0.9.12
|
68
97
|
type: :development
|
69
98
|
version_requirements: *id005
|
@@ -75,7 +104,12 @@ dependencies:
|
|
75
104
|
requirements:
|
76
105
|
- - ">="
|
77
106
|
- !ruby/object:Gem::Version
|
78
|
-
|
107
|
+
hash: 47
|
108
|
+
segments:
|
109
|
+
- 2
|
110
|
+
- 8
|
111
|
+
- 0
|
112
|
+
version: 2.8.0
|
79
113
|
type: :development
|
80
114
|
version_requirements: *id006
|
81
115
|
description: |-
|
@@ -146,7 +180,7 @@ files:
|
|
146
180
|
- test/test_response.rb
|
147
181
|
- test/test_transaction.rb
|
148
182
|
- test/test_xml_parser.rb
|
149
|
-
|
183
|
+
has_rdoc: true
|
150
184
|
homepage: https://github.com/yaksnrainbows/kronk
|
151
185
|
licenses: []
|
152
186
|
|
@@ -161,7 +195,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
161
195
|
requirements:
|
162
196
|
- - ">="
|
163
197
|
- !ruby/object:Gem::Version
|
164
|
-
hash:
|
198
|
+
hash: 3
|
165
199
|
segments:
|
166
200
|
- 0
|
167
201
|
version: "0"
|
@@ -170,11 +204,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
170
204
|
requirements:
|
171
205
|
- - ">="
|
172
206
|
- !ruby/object:Gem::Version
|
207
|
+
hash: 3
|
208
|
+
segments:
|
209
|
+
- 0
|
173
210
|
version: "0"
|
174
211
|
requirements: []
|
175
212
|
|
176
213
|
rubyforge_project: kronk
|
177
|
-
rubygems_version: 1.
|
214
|
+
rubygems_version: 1.5.2
|
178
215
|
signing_key:
|
179
216
|
specification_version: 3
|
180
217
|
summary: Kronk runs diffs against data from live and cached http responses
|
data/.gemtest
DELETED
File without changes
|