enigma_io 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +17 -0
- data/.rubocop.yml +14 -0
- data/.travis.yml +14 -0
- data/Gemfile +11 -0
- data/LICENSE.txt +22 -0
- data/README.md +64 -0
- data/Rakefile +28 -0
- data/enigma_io.gemspec +30 -0
- data/examples/data.md +94 -0
- data/examples/export.md +35 -0
- data/lib/enigma/client.rb +26 -0
- data/lib/enigma/download.rb +81 -0
- data/lib/enigma/endpoint.rb +108 -0
- data/lib/enigma/endpoints/data.rb +5 -0
- data/lib/enigma/endpoints/export.rb +22 -0
- data/lib/enigma/endpoints/meta.rb +5 -0
- data/lib/enigma/endpoints/stats.rb +5 -0
- data/lib/enigma/response.rb +17 -0
- data/lib/enigma/version.rb +6 -0
- data/lib/enigma.rb +49 -0
- data/test/client_test.rb +32 -0
- data/test/data_test.rb +81 -0
- data/test/endpoint_test.rb +55 -0
- data/test/export_test.rb +67 -0
- data/test/fixtures/download.csv +4 -0
- data/test/fixtures/download.zip +0 -0
- data/test/fixtures/vcr_cassettes/compound_average.yml +121 -0
- data/test/fixtures/vcr_cassettes/data_with_error.yml +38 -0
- data/test/fixtures/vcr_cassettes/export.yml +37 -0
- data/test/fixtures/vcr_cassettes/filtered_data.yml +6727 -0
- data/test/fixtures/vcr_cassettes/limit_data.yml +54 -0
- data/test/fixtures/vcr_cassettes/page_data.yml +53 -0
- data/test/fixtures/vcr_cassettes/selected_data.yml +541 -0
- data/test/fixtures/vcr_cassettes/simple_data.yml +6762 -0
- data/test/fixtures/vcr_cassettes/simple_metadata.yml +75 -0
- data/test/fixtures/vcr_cassettes/simple_stats.yml +48 -0
- data/test/fixtures/vcr_cassettes/sorted_data.yml +6690 -0
- data/test/fixtures/vcr_cassettes/sorted_data_descending.yml +6690 -0
- data/test/meta_test.rb +26 -0
- data/test/response_test.rb +13 -0
- data/test/stats_test.rb +27 -0
- data/test/test_helper.rb +37 -0
- metadata +223 -0
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.enigma.io/v2/data/test-key/us.gov.whitehouse.visitor-list?limit=1
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Typhoeus - https://github.com/typhoeus/typhoeus
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Server:
|
18
|
+
- nginx/1.2.9
|
19
|
+
Date:
|
20
|
+
- Sun, 26 Jan 2014 21:21:19 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
Content-Length:
|
24
|
+
- '1158'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
Access-Control-Allow-Origin:
|
30
|
+
- ! '*'
|
31
|
+
Etag:
|
32
|
+
- ! '"1671210483"'
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ! "{\n \"datapath\": \"us.gov.whitehouse.visitor-list\",\n \"success\":
|
36
|
+
true,\n \"info\": {\n \"rows_limit\": 1,\n \"total_results\": 3427529,\n
|
37
|
+
\ \"total_pages\": 3427529,\n \"current_page\": 1\n },\n \"result\":
|
38
|
+
[\n {\n \"namelast\": \"BELBAS\",\n \"namefirst\": \"TED\",\n
|
39
|
+
\ \"namemid\": null,\n \"namefull\": \"TED BELBAS\",\n \"uin\":
|
40
|
+
\"U14155\",\n \"bdgnbr\": null,\n \"type_of_access\": \"VA\",\n
|
41
|
+
\ \"toa\": null,\n \"poa\": null,\n \"tod\": null,\n \"pod\":
|
42
|
+
null,\n \"appt_made_date\": \"2010-06-15T21:23:00.000Z\",\n \"appt_start_date\":
|
43
|
+
\"2010-06-17T20:00:00.000Z\",\n \"appt_end_date\": \"2010-06-18T03:59:00.000Z\",\n
|
44
|
+
\ \"appt_cancel_date\": null,\n \"total_people\": \"466\",\n \"last_updatedby\":
|
45
|
+
\"T1\",\n \"post\": \"WIN\",\n \"lastentrydate\": \"2010-06-15T21:23:00.000Z\",\n
|
46
|
+
\ \"terminal_suffix\": \"T1\",\n \"visitee_namelast\": \"OFFICE\",\n
|
47
|
+
\ \"visitee_namefirst\": \"VISITORS\",\n \"meeting_loc\": \"WH\",\n
|
48
|
+
\ \"meeting_room\": \"RES\",\n \"caller_name_last\": \"OFFICE\",\n
|
49
|
+
\ \"caller_name_first\": \"VISITORS\",\n \"caller_room\": null,\n
|
50
|
+
\ \"description\": null,\n \"release_date\": \"2010-09-24T00:00:00.000Z\",\n
|
51
|
+
\ \"serialid\": 1\n }\n ]\n}"
|
52
|
+
http_version:
|
53
|
+
recorded_at: Sun, 26 Jan 2014 21:22:24 GMT
|
54
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,53 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.enigma.io/v2/data/test-key/us.gov.whitehouse.visitor-list?limit=1&page=2
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Typhoeus - https://github.com/typhoeus/typhoeus
|
12
|
+
response:
|
13
|
+
status:
|
14
|
+
code: 200
|
15
|
+
message: OK
|
16
|
+
headers:
|
17
|
+
Server:
|
18
|
+
- nginx/1.2.9
|
19
|
+
Date:
|
20
|
+
- Sun, 26 Jan 2014 21:21:19 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
Content-Length:
|
24
|
+
- '1158'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
Access-Control-Allow-Origin:
|
30
|
+
- ! '*'
|
31
|
+
Etag:
|
32
|
+
- ! '"-986426965"'
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ! "{\n \"datapath\": \"us.gov.whitehouse.visitor-list\",\n \"success\":
|
36
|
+
true,\n \"info\": {\n \"rows_limit\": 1,\n \"total_results\": 3427529,\n
|
37
|
+
\ \"total_pages\": 3427529,\n \"current_page\": 2\n },\n \"result\":
|
38
|
+
[\n {\n \"namelast\": \"BOUL\",\n \"namefirst\": \"DAVID\",\n
|
39
|
+
\ \"namemid\": null,\n \"namefull\": \"DAVID BOUL\",\n \"uin\":
|
40
|
+
\"U17331\",\n \"bdgnbr\": null,\n \"type_of_access\": \"VA\",\n
|
41
|
+
\ \"toa\": null,\n \"poa\": null,\n \"tod\": null,\n \"pod\":
|
42
|
+
null,\n \"appt_made_date\": \"2010-06-17T20:38:00.000Z\",\n \"appt_start_date\":
|
43
|
+
\"2010-06-22T21:00:00.000Z\",\n \"appt_end_date\": \"2010-06-23T03:59:00.000Z\",\n
|
44
|
+
\ \"appt_cancel_date\": null,\n \"total_people\": \"388\",\n \"last_updatedby\":
|
45
|
+
\"J7\",\n \"post\": \"WIN\",\n \"lastentrydate\": \"2010-06-17T20:38:00.000Z\",\n
|
46
|
+
\ \"terminal_suffix\": \"J7\",\n \"visitee_namelast\": \"POTUS\",\n
|
47
|
+
\ \"visitee_namefirst\": null,\n \"meeting_loc\": \"WH\",\n \"meeting_room\":
|
48
|
+
\"STATE FLOO\",\n \"caller_name_last\": \"GALLAGHER\",\n \"caller_name_first\":
|
49
|
+
\"CLARE\",\n \"caller_room\": null,\n \"description\": null,\n \"release_date\":
|
50
|
+
\"2010-09-24T00:00:00.000Z\",\n \"serialid\": 2\n }\n ]\n}"
|
51
|
+
http_version:
|
52
|
+
recorded_at: Sun, 26 Jan 2014 21:22:24 GMT
|
53
|
+
recorded_with: VCR 2.8.0
|