lieu 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/CONTRIBUTING.md +34 -0
  3. data/LICENSE +20 -0
  4. data/README.md +112 -0
  5. data/Rakefile +42 -0
  6. data/lib/lieu/client/actions.rb +105 -0
  7. data/lib/lieu/client/autocomplete.rb +21 -0
  8. data/lib/lieu/client/details.rb +21 -0
  9. data/lib/lieu/client/photos.rb +23 -0
  10. data/lib/lieu/client/query_autocomplete.rb +21 -0
  11. data/lib/lieu/client/search.rb +79 -0
  12. data/lib/lieu/client.rb +36 -0
  13. data/lib/lieu/configuration.rb +45 -0
  14. data/lib/lieu/connection.rb +28 -0
  15. data/lib/lieu/error.rb +58 -0
  16. data/lib/lieu/request.rb +53 -0
  17. data/lib/lieu/response/raise_error.rb +18 -0
  18. data/lib/lieu/version.rb +5 -0
  19. data/lib/lieu.rb +25 -0
  20. data/lieu.gemspec +26 -0
  21. data/spec/cassettes/Lieu_Client_Actions/_event_details/returns_an_event_details.yml +54 -0
  22. data/spec/cassettes/Lieu_Client_Autocomplete/_autocomplete/returns_an_array_of_places.yml +203 -0
  23. data/spec/cassettes/Lieu_Client_Details/_details/returns_a_place_details.yml +220 -0
  24. data/spec/cassettes/Lieu_Client_Photos/_photo/returns_a_photo_image.yml +111 -0
  25. data/spec/cassettes/Lieu_Client_QueryAutocomplete/_query_autocomplete/returns_an_array_of_places.yml +203 -0
  26. data/spec/cassettes/Lieu_Client_Search/_nearby_search/returns_an_array_of_places.yml +517 -0
  27. data/spec/cassettes/Lieu_Client_Search/_radarsearch/returns_an_array_of_places.yml +1683 -0
  28. data/spec/cassettes/Lieu_Client_Search/_textsearch/returns_an_array_of_places.yml +560 -0
  29. data/spec/cassettes/Lieu_Request/given_a_GET_request/with_options/sets_options_as_url_parameters.yml +63 -0
  30. data/spec/cassettes/Lieu_Request/given_a_POST_request/with_options/sets_options_as_body_parameters.yml +63 -0
  31. data/spec/lib/lieu/client/actions_spec.rb +178 -0
  32. data/spec/lib/lieu/client/autocomplete_spec.rb +11 -0
  33. data/spec/lib/lieu/client/details_spec.rb +11 -0
  34. data/spec/lib/lieu/client/photo_spec.rb +17 -0
  35. data/spec/lib/lieu/client/query_autocomplete_spec.rb +11 -0
  36. data/spec/lib/lieu/client/search_spec.rb +39 -0
  37. data/spec/lib/lieu/client_spec.rb +70 -0
  38. data/spec/lib/lieu/request_spec.rb +35 -0
  39. data/spec/lib/lieu_spec.rb +32 -0
  40. data/spec/spec_helper.rb +65 -0
  41. data/spec/support/shared_examples/error.rb +33 -0
  42. metadata +120 -0
@@ -0,0 +1,111 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://maps.googleapis.com/maps/api/place/photo?key=<API_KEY>&maxheight=10&photoreference=CnRtAAAAqCdOEgCrPQY3kaulN3Ywx0CMfg_W97Vfyp5M2tr_qd9HRcodoKvZZhsT_glcV_xJQDM7br-tI2eb9u1cqkyNYEiMvkVLbky4FvheFSvfoqHUDnnJhjzPMxQfFf3GDGnbBmh6aDlgSOdd2LNHCm5SNBIQBT5s3kRxjhR0oAnzhINbcxoUyvD_Ce1R79aAormNMM5LhcwFU5w&sensor=false
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.8
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: 302
19
+ message: Found
20
+ headers:
21
+ Date:
22
+ - Wed, 25 Sep 2013 16:11:01 GMT
23
+ Pragma:
24
+ - no-cache
25
+ Expires:
26
+ - Fri, 01 Jan 1990 00:00:00 GMT
27
+ Cache-Control:
28
+ - no-cache, must-revalidate
29
+ Location:
30
+ - https://lh4.googleusercontent.com/-1wzlVdxiW14/USSFZnhNqxI/AAAAAAAABGw/YpdANqaoGh4/s1600-h10/Google%2BSydney
31
+ Access-Control-Allow-Origin:
32
+ - '*'
33
+ Content-Type:
34
+ - text/html; charset=UTF-8
35
+ Server:
36
+ - mafe
37
+ Content-Length:
38
+ - '305'
39
+ X-Xss-Protection:
40
+ - 1; mode=block
41
+ X-Frame-Options:
42
+ - SAMEORIGIN
43
+ Alternate-Protocol:
44
+ - 443:quic
45
+ body:
46
+ encoding: UTF-8
47
+ string: "<HTML><HEAD><meta http-equiv=\"content-type\" content=\"text/html;charset=utf-8\">\n<TITLE>302
48
+ Moved</TITLE></HEAD><BODY>\n<H1>302 Moved</H1>\nThe document has moved\n<A
49
+ HREF=\"https://lh4.googleusercontent.com/-1wzlVdxiW14/USSFZnhNqxI/AAAAAAAABGw/YpdANqaoGh4/s1600-h10/Google%2BSydney\">here</A>.\r\n</BODY></HTML>\r\n"
50
+ http_version:
51
+ recorded_at: Wed, 25 Sep 2013 16:11:01 GMT
52
+ - request:
53
+ method: get
54
+ uri: https://lh4.googleusercontent.com/-1wzlVdxiW14/USSFZnhNqxI/AAAAAAAABGw/YpdANqaoGh4/s1600-h10/Google+Sydney
55
+ body:
56
+ encoding: US-ASCII
57
+ string: ''
58
+ headers:
59
+ User-Agent:
60
+ - Faraday v0.8.8
61
+ Accept-Encoding:
62
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
63
+ Accept:
64
+ - '*/*'
65
+ response:
66
+ status:
67
+ code: 200
68
+ message: OK
69
+ headers:
70
+ Access-Control-Allow-Origin:
71
+ - '*'
72
+ Etag:
73
+ - '"v46c"'
74
+ Expires:
75
+ - Thu, 26 Sep 2013 14:59:51 GMT
76
+ Content-Disposition:
77
+ - inline;filename="Google Sydney.jpg"
78
+ Content-Type:
79
+ - image/jpeg
80
+ X-Content-Type-Options:
81
+ - nosniff
82
+ Date:
83
+ - Wed, 25 Sep 2013 16:11:02 GMT
84
+ Server:
85
+ - fife
86
+ Content-Length:
87
+ - '437'
88
+ X-Xss-Protection:
89
+ - 1; mode=block
90
+ Cache-Control:
91
+ - public, max-age=86400, no-transform
92
+ Age:
93
+ - '0'
94
+ Alternate-Protocol:
95
+ - 443:quic
96
+ body:
97
+ encoding: ASCII-8BIT
98
+ string: !binary |-
99
+ /9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAMCAgECAgMDAwMBAwMEBQgFBQQE
100
+ BQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRQB
101
+ AwQEBQQFCQUFCRQNCw0UFBQUFBQUFBQUFA4UFBQUFBQUFBQUDBQUFBQUFBQU
102
+ FBQUFBQUFBQUFBQUFBQUFBQOFP/AABEIAAoADQMBIgACEQEDEQH/xAAWAAEB
103
+ AQAAAAAAAAAAAAAAAAAHCAb/xAAjEAACAQMEAQUAAAAAAAAAAAABAgQDBhEF
104
+ BxIhIgAJJEFh/8QAFQEBAQAAAAAAAAAAAAAAAAAABAP/xAAcEQACAQUBAAAA
105
+ AAAAAAAAAAABAgMAERMhQQT/2gAMAwEAAhEDEQA/AB2dZXtLTJiVDI3+qxKd
106
+ R3eWAlLlS4UXDcTR66Zh+nljOBmb91ra2bk3EsqxdO3RkaLUQr8mmWcOGPfi
107
+ vWVK+LAEYyQCcDeXRc+5Ol3XrcaHq18RI6SyFpUJLoijA6ABx6MdxdZu6tc7
108
+ PUnXG7tGolmaqxJPH779Ah84iQOpOx01GNcb2bdq/9k=
109
+ http_version:
110
+ recorded_at: Wed, 25 Sep 2013 16:11:02 GMT
111
+ recorded_with: VCR 2.5.0
@@ -0,0 +1,203 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://maps.googleapis.com/maps/api/place/queryautocomplete/json?input=Google%20Sydney&key=<API_KEY>&sensor=false
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Faraday v0.8.8
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
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Wed, 25 Sep 2013 13:20:26 GMT
25
+ Expires:
26
+ - Wed, 25 Sep 2013 13:25:26 GMT
27
+ Cache-Control:
28
+ - public, max-age=300
29
+ Vary:
30
+ - Accept-Language
31
+ Server:
32
+ - mafe
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ Alternate-Protocol:
38
+ - 443:quic
39
+ Transfer-Encoding:
40
+ - chunked
41
+ body:
42
+ encoding: UTF-8
43
+ string: |
44
+ {
45
+ "predictions" : [
46
+ {
47
+ "description" : "Google Sydney, Pirrama Road, Sydney, New South Wales, Australia",
48
+ "id" : "4f89212bf76dde31f092cfc14d7506555d85b5c7",
49
+ "matched_substrings" : [
50
+ {
51
+ "length" : 6,
52
+ "offset" : 0
53
+ },
54
+ {
55
+ "length" : 6,
56
+ "offset" : 29
57
+ }
58
+ ],
59
+ "reference" : "ClROAAAAtXlZQ0sj8JPnebMvyg6toUJO73rTXMaDdLeCuOGVpCfysUKXIXmwEctwqC30A6TQFEK3xH-K-NpMgFC0SZmCzhFg3ioD31mFFDPdwMe4Yx4SEM6MJCDu8SCT7ydWK9LOjZcaFHQyMZZ-TKhzRkVIXOyefdoBysra",
60
+ "terms" : [
61
+ {
62
+ "offset" : 0,
63
+ "value" : "Google Sydney"
64
+ },
65
+ {
66
+ "offset" : 15,
67
+ "value" : "Pirrama Road"
68
+ },
69
+ {
70
+ "offset" : 29,
71
+ "value" : "Sydney"
72
+ },
73
+ {
74
+ "offset" : 37,
75
+ "value" : "New South Wales"
76
+ },
77
+ {
78
+ "offset" : 54,
79
+ "value" : "Australia"
80
+ }
81
+ ],
82
+ "types" : [ "establishment" ]
83
+ },
84
+ {
85
+ "description" : "Get On Google, Macquarie Street, Sydney, New South Wales, Australia",
86
+ "id" : "42224ed8c9da910b16d7c028543134e033c3d987",
87
+ "matched_substrings" : [
88
+ {
89
+ "length" : 13,
90
+ "offset" : 0
91
+ },
92
+ {
93
+ "length" : 6,
94
+ "offset" : 33
95
+ }
96
+ ],
97
+ "reference" : "CmRRAAAAZX1g9S2Z4QVRd4mWdz7Xo7AFFT62RtdoOaZ1ig2pxVlDU4zAwNb1DRteVgESqXuWdZ-Bgl-QYF3FHbNCJU43qcwDC9tGV-xOtQ4DsLdb_zWxTKqjnsH4mwkbjMyf9kaZEhBb-KT9A0SqXEIUrYS20--sGhRbvOudNY_zukEjCJmml2bBOxrLRg",
98
+ "terms" : [
99
+ {
100
+ "offset" : 0,
101
+ "value" : "Get On Google"
102
+ },
103
+ {
104
+ "offset" : 15,
105
+ "value" : "Macquarie Street"
106
+ },
107
+ {
108
+ "offset" : 33,
109
+ "value" : "Sydney"
110
+ },
111
+ {
112
+ "offset" : 41,
113
+ "value" : "New South Wales"
114
+ },
115
+ {
116
+ "offset" : 58,
117
+ "value" : "Australia"
118
+ }
119
+ ],
120
+ "types" : [ "establishment" ]
121
+ },
122
+ {
123
+ "description" : "Google Advertising, Macquarie Street, Sydney, New South Wales, Australia",
124
+ "id" : "5623d36f6db1e4bfe015033c13c0168f6429ce61",
125
+ "matched_substrings" : [
126
+ {
127
+ "length" : 6,
128
+ "offset" : 0
129
+ },
130
+ {
131
+ "length" : 6,
132
+ "offset" : 38
133
+ }
134
+ ],
135
+ "reference" : "CmRXAAAA1ZlbsOIN6t7qgj4q8BMxnRmnsOI9d8SRjrv8xSAQ4rN7iUqghC910kDm7AIF1vXFT073-xBu-ZKR6vtSWQ3ndYYJeudPOxASE8UsL64uf0hf00mwuJr557Osq_naRx6HEhBUPtVvOF2I-rWmHXhdXde3GhQ0eDjjR7CBO4Co_ByOIjSJxjk5yA",
136
+ "terms" : [
137
+ {
138
+ "offset" : 0,
139
+ "value" : "Google Advertising"
140
+ },
141
+ {
142
+ "offset" : 20,
143
+ "value" : "Macquarie Street"
144
+ },
145
+ {
146
+ "offset" : 38,
147
+ "value" : "Sydney"
148
+ },
149
+ {
150
+ "offset" : 46,
151
+ "value" : "New South Wales"
152
+ },
153
+ {
154
+ "offset" : 63,
155
+ "value" : "Australia"
156
+ }
157
+ ],
158
+ "types" : [ "establishment" ]
159
+ },
160
+ {
161
+ "description" : "Up On Google, Rickard Street, Sydney, New South Wales, Australia",
162
+ "id" : "897512576d7aad77cc1e60df218870a7eaa96a7b",
163
+ "matched_substrings" : [
164
+ {
165
+ "length" : 12,
166
+ "offset" : 0
167
+ },
168
+ {
169
+ "length" : 6,
170
+ "offset" : 30
171
+ }
172
+ ],
173
+ "reference" : "ClRPAAAA9EjcUlcXfPVEIenmdeoFoyQTaEHwsHSUiIEY6BxERbxIt5L3l5UYCzy8JN3IlgW_U5DPxIC89xfPg2jz41-zstUa3ZjwphvdWd6lkw0FHd8SEFjh7aM2P2bKEtqGei-yTQMaFDGDrdo0Q52ITlcdGL-qloTGuwxw",
174
+ "terms" : [
175
+ {
176
+ "offset" : 0,
177
+ "value" : "Up On Google"
178
+ },
179
+ {
180
+ "offset" : 14,
181
+ "value" : "Rickard Street"
182
+ },
183
+ {
184
+ "offset" : 30,
185
+ "value" : "Sydney"
186
+ },
187
+ {
188
+ "offset" : 38,
189
+ "value" : "New South Wales"
190
+ },
191
+ {
192
+ "offset" : 55,
193
+ "value" : "Australia"
194
+ }
195
+ ],
196
+ "types" : [ "establishment" ]
197
+ }
198
+ ],
199
+ "status" : "OK"
200
+ }
201
+ http_version:
202
+ recorded_at: Wed, 25 Sep 2013 13:20:26 GMT
203
+ recorded_with: VCR 2.5.0