enigma_io 0.0.1
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.
- 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,75 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.enigma.io/v2/meta/test-key/us.gov.whitehouse.salaries
|
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 18:58:51 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
Content-Length:
|
24
|
+
- '2805'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
Access-Control-Allow-Origin:
|
30
|
+
- ! '*'
|
31
|
+
Etag:
|
32
|
+
- ! '"1839071709"'
|
33
|
+
body:
|
34
|
+
encoding: US-ASCII
|
35
|
+
string: ! "{\n \"datapath\": \"us.gov.whitehouse.salaries\",\n \"success\":
|
36
|
+
true,\n \"info\": {\n \"result_type\": \"parent\",\n \"children_tables_limit\":
|
37
|
+
50,\n \"children_tables_total\": 4,\n \"current_page\": 1,\n \"total_pages\":
|
38
|
+
1\n },\n \"result\": {\n \"path\": [\n {\n \"level\": \"us\",\n
|
39
|
+
\ \"label\": \"United States\",\n \"description\": \"United States\"\n
|
40
|
+
\ },\n {\n \"level\": \"gov\",\n \"label\": \"U.S.
|
41
|
+
Federal Government\",\n \"description\": \"Government comprising the
|
42
|
+
Legislative, Executive, and Judicial branches of the United States of America.\"\n
|
43
|
+
\ },\n {\n \"level\": \"whitehouse\",\n \"label\":
|
44
|
+
\"The White House\",\n \"description\": \"Located at 1600 Pennsylvania
|
45
|
+
Avenue in Washington D.C., the White House has served as the home and office
|
46
|
+
for every U.S. president since John Adams.\"\n },\n {\n \"level\":
|
47
|
+
\"White House Salaries\",\n \"label\": \"White House Salaries\",\n
|
48
|
+
\ \"description\": \"The White House has been required to deliver a
|
49
|
+
report to Congress listing the title and salary of every White House Office
|
50
|
+
employee since 1995. Consistent with President Obama's commitment to transparency,
|
51
|
+
this report is being publicly disclosed on our website as it is transmitted
|
52
|
+
to Congress. In addition, this report also contains the title and salary
|
53
|
+
details of administration officials who work at the Office of Policy Development,
|
54
|
+
including the Domestic Policy Council and the National Economic Council --
|
55
|
+
along with White House Office employees.\"\n }\n ],\n \"immediate_nodes\":
|
56
|
+
[],\n \"children_tables\": [\n {\n \"datapath\": \"us.gov.whitehouse.salaries.2009\",\n
|
57
|
+
\ \"label\": \"2009\",\n \"description\": \"Information regarding
|
58
|
+
White House Office employee salaries for 2009.\",\n \"db_boundary_datapath\":
|
59
|
+
\"us.gov.whitehouse.salaries\",\n \"db_boundary_label\": \"White House
|
60
|
+
Salaries\"\n },\n {\n \"datapath\": \"us.gov.whitehouse.salaries.2010\",\n
|
61
|
+
\ \"label\": \"2010\",\n \"description\": \"Information regarding
|
62
|
+
White House Office employee salaries for 2010.\",\n \"db_boundary_datapath\":
|
63
|
+
\"us.gov.whitehouse.salaries\",\n \"db_boundary_label\": \"White House
|
64
|
+
Salaries\"\n },\n {\n \"datapath\": \"us.gov.whitehouse.salaries.2011\",\n
|
65
|
+
\ \"label\": \"2011\",\n \"description\": \"Information regarding
|
66
|
+
White House Office employee salaries for 2011.\",\n \"db_boundary_datapath\":
|
67
|
+
\"us.gov.whitehouse.salaries\",\n \"db_boundary_label\": \"White House
|
68
|
+
Salaries\"\n },\n {\n \"datapath\": \"us.gov.whitehouse.salaries.2012\",\n
|
69
|
+
\ \"label\": \"2012\",\n \"description\": \"Information regarding
|
70
|
+
White House Office employee salaries for 2012.\",\n \"db_boundary_datapath\":
|
71
|
+
\"us.gov.whitehouse.salaries\",\n \"db_boundary_label\": \"White House
|
72
|
+
Salaries\"\n }\n ]\n }\n}"
|
73
|
+
http_version:
|
74
|
+
recorded_at: Sun, 26 Jan 2014 18:59:55 GMT
|
75
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,48 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: https://api.enigma.io/v2/stats/test-key/us.gov.whitehouse.visitor-list?select=type_of_access
|
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:28:01 GMT
|
21
|
+
Content-Type:
|
22
|
+
- application/json; charset=utf-8
|
23
|
+
Content-Length:
|
24
|
+
- '835'
|
25
|
+
Connection:
|
26
|
+
- keep-alive
|
27
|
+
Vary:
|
28
|
+
- Accept-Encoding
|
29
|
+
Access-Control-Allow-Origin:
|
30
|
+
- ! '*'
|
31
|
+
body:
|
32
|
+
encoding: US-ASCII
|
33
|
+
string: ! "{\n \"datapath\": \"us.gov.whitehouse.visitor-list\",\n \"success\":
|
34
|
+
true,\n \"info\": {\n \"column\": {\n \"id\": \"type_of_access\",\n
|
35
|
+
\ \"label\": \"Type Of Access\",\n \"description\": \"Type of access
|
36
|
+
to the complex (VA = Visitor Access)\",\n \"type\": \"type_varchar\",\n
|
37
|
+
\ \"index\": 6\n },\n \"operations\": [\n \"frequency\"\n ],\n
|
38
|
+
\ \"rows_limit\": 500,\n \"total_results\": 5,\n \"total_pages\":
|
39
|
+
1,\n \"current_page\": 1\n },\n \"result\": {\n \"frequency\": [\n
|
40
|
+
\ {\n \"type_of_access\": \"VA\",\n \"count\": \"3383388\"\n
|
41
|
+
\ },\n {\n \"type_of_access\": \"AL\",\n \"count\":
|
42
|
+
\"28384\"\n },\n {\n \"type_of_access\": \"PE\",\n \"count\":
|
43
|
+
\"12\"\n },\n {\n \"type_of_access\": \"WO\",\n \"count\":
|
44
|
+
\"8\"\n },\n {\n \"type_of_access\": null,\n \"count\":
|
45
|
+
\"0\"\n }\n ]\n }\n}"
|
46
|
+
http_version:
|
47
|
+
recorded_at: Sun, 26 Jan 2014 21:29:06 GMT
|
48
|
+
recorded_with: VCR 2.8.0
|