localwiki_client 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/History.txt +5 -0
- data/README.md +17 -9
- data/Rakefile +6 -0
- data/integration/helper.rb +1 -1
- data/integration/live_saltlake_wiki_spec.rb +2 -2
- data/integration/live_test_wiki_spec.rb +26 -11
- data/lib/localwiki/client.rb +143 -115
- data/lib/localwiki/resource.rb +76 -0
- data/lib/localwiki/version.rb +1 -1
- data/lib/localwiki_client.rb +1 -0
- data/localwiki_client.gemspec +1 -0
- data/spec/basic_crud_spec.rb +12 -5
- data/spec/basic_spec.rb +2 -2
- data/spec/fixtures/cassettes/basic.yml +21 -19
- data/spec/fixtures/cassettes/basic_crud.yml +21 -19
- data/spec/fixtures/cassettes/basic_crud_delete_fail.yml +11 -9
- data/spec/fixtures/cassettes/basic_crud_delete_success.yml +10 -8
- data/spec/fixtures/cassettes/basic_crud_page_by_name_success.yml +40 -0
- data/spec/fixtures/cassettes/basic_crud_read_fail.yml +22 -34
- data/spec/fixtures/cassettes/basic_crud_read_success.yml +11 -11
- data/spec/fixtures/cassettes/basic_crud_update_success.yml +11 -9
- data/spec/fixtures/cassettes/basic_fetch_version_success.yml +41 -37
- data/spec/fixtures/cassettes/basic_page_by_name_spaces.yml +12 -12
- data/spec/fixtures/cassettes/basic_unique_authors_success.yml +41 -37
- data/spec/fixtures/cassettes/fetch.yml +8 -8
- data/spec/fixtures/cassettes/list.yml +93 -0
- data/spec/fixtures/cassettes/list_file_success.yml +40 -0
- data/spec/fixtures/cassettes/list_limit_success.yml +124 -0
- data/spec/fixtures/cassettes/list_map_success.yml +42 -0
- data/spec/fixtures/cassettes/list_page_success.yml +1108 -0
- data/spec/fixtures/cassettes/list_page_tags_success.yml +42 -0
- data/spec/fixtures/cassettes/list_site_success.yml +46 -0
- data/spec/fixtures/cassettes/list_tag_success.yml +43 -0
- data/spec/fixtures/cassettes/list_user_success.yml +56 -0
- data/spec/fixtures/cassettes/localwiki_client.yml +121 -115
- data/spec/fixtures/cassettes/slug.yml +8 -8
- data/spec/helper.rb +7 -0
- data/spec/list_spec.rb +47 -0
- data/spec/localwiki_client_spec.rb +4 -12
- data/spec/localwiki_spec.rb +17 -0
- data/spec/map_spec.rb +135 -0
- data/spec/resource_spec.rb +60 -0
- metadata +33 -4
@@ -0,0 +1,124 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ec2-54-234-151-52.compute-1.amazonaws.com/api/page?format=json&limit=3
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.7
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 29 Mar 2013 02:07:23 GMT
|
23
|
+
Server:
|
24
|
+
- Apache/2.2.22 (Ubuntu)
|
25
|
+
Access-Control-Allow-Origin:
|
26
|
+
- '*'
|
27
|
+
Access-Control-Allow-Methods:
|
28
|
+
- POST,GET,OPTIONS,PUT,DELETE
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Content-Type:
|
32
|
+
- application/vnd.api.v1+json; charset=utf-8
|
33
|
+
body:
|
34
|
+
encoding: ASCII-8BIT
|
35
|
+
string: !binary |-
|
36
|
+
eyJtZXRhIjogeyJsaW1pdCI6IDMsICJuZXh0IjogIi9hcGkvcGFnZT9vZmZz
|
37
|
+
ZXQ9MyZsaW1pdD0zJmxpbWl0PTMmZm9ybWF0PWpzb24iLCAib2Zmc2V0Ijog
|
38
|
+
MCwgInByZXZpb3VzIjogbnVsbCwgInRvdGFsX2NvdW50IjogMTQxfSwgIm9i
|
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Gxpa2Ug
|
115
|
+
YWJvdXQgeW91cnNlbGYgaGVyZSE8L3A+XG48aDI+XG5cdENvbnRhY3QgaW5m
|
116
|
+
bzwvaDI+XG48dWw+XG5cdDxsaT5cblx0XHRUd2l0dGVyPC9saT5cblx0PGxp
|
117
|
+
PlxuXHRcdEZhY2Vib29rPC9saT5cblx0PGxpPlxuXHRcdEVtYWlsPC9saT5c
|
118
|
+
bjwvdWw+IiwgImlkIjogMywgIm1hcCI6IG51bGwsICJuYW1lIjogIlRlbXBs
|
119
|
+
YXRlcy9Vc2VyIiwgInBhZ2VfdGFncyI6IG51bGwsICJyZXNvdXJjZV91cmki
|
120
|
+
OiAiL2FwaS9wYWdlL1RlbXBsYXRlcy9Vc2VyIiwgInNsdWciOiAidGVtcGxh
|
121
|
+
dGVzL3VzZXIifV19
|
122
|
+
http_version:
|
123
|
+
recorded_at: Fri, 29 Mar 2013 02:06:38 GMT
|
124
|
+
recorded_with: VCR 2.4.0
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://ec2-54-234-151-52.compute-1.amazonaws.com/api/map?format=json&limit=0
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.8.7
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
14
|
+
Accept:
|
15
|
+
- '*/*'
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Date:
|
22
|
+
- Fri, 29 Mar 2013 02:07:22 GMT
|
23
|
+
Server:
|
24
|
+
- Apache/2.2.22 (Ubuntu)
|
25
|
+
Access-Control-Allow-Origin:
|
26
|
+
- '*'
|
27
|
+
Access-Control-Allow-Methods:
|
28
|
+
- POST,GET,OPTIONS,PUT,DELETE
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Content-Type:
|
32
|
+
- application/vnd.api.v1+json; charset=utf-8
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"meta": {"limit": 0, "offset": 0, "total_count": 1}, "objects": [{"geom":
|
36
|
+
{"geometries": [{"coordinates": [-122.450771, 37.762443], "type": "Point"}],
|
37
|
+
"type": "GeometryCollection"}, "id": 1, "length": 0.0, "lines": null, "page":
|
38
|
+
"/api/page/Front_Page", "points": {"coordinates": [[-122.450771, 37.762443]],
|
39
|
+
"type": "MultiPoint"}, "polys": null, "resource_uri": "/api/map/Front_Page"}]}'
|
40
|
+
http_version:
|
41
|
+
recorded_at: Fri, 29 Mar 2013 02:06:37 GMT
|
42
|
+
recorded_with: VCR 2.4.0
|