ons_openapi 0.1.0 → 0.1.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.
- checksums.yaml +4 -4
- data/README.md +34 -35
- data/lib/ons_openapi.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7478d7a40489fbc9f28fb75fff66c252dafdecc4
|
4
|
+
data.tar.gz: 6635ce15b7e02d542703ec04265d77486dd44d6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a50990151e4ce9c4312bad08388caf5031c712f2dafff8ad4c823eadc4bb67e138010bcb2996f650ff9c3edb0e4e36652c8738573fb125a0223b3ba72aabe95
|
7
|
+
data.tar.gz: d4c57a354e13b6674527d8eaf16b42204447eb1ba4e95fa12195b2dbe78c08a38f9e8cda98af8eb550d87e2c72b895eefe199d3d38eb28e7d75ffe789abdae8e
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
ons_openapi gem
|
2
|
+
===============
|
3
3
|
|
4
4
|
Ruby wrapper around the [ONS OpenAPI](https://www.ons.gov.uk/ons/apiservice/web/apiservice/home) - the UK Office of National Statistics's data API. The intention is to make it easy to quickly retrieve data. It may not expose the full functionality of the ONS OpenAPI.
|
5
5
|
|
@@ -7,39 +7,7 @@ This gem was partially written at [Accountability Hack 2014](https://twitter.com
|
|
7
7
|
|
8
8
|
Please provide feedback via [GitHub issues](https://github.com/robmckinnon/ons-openapi/issues).
|
9
9
|
|
10
|
-
#
|
11
|
-
|
12
|
-
```
|
13
|
-
gem install ons_openapi
|
14
|
-
```
|
15
|
-
|
16
|
-
then in Ruby code
|
17
|
-
|
18
|
-
```
|
19
|
-
require 'ons_openapi'
|
20
|
-
```
|
21
|
-
|
22
|
-
or if using bundler (as with Rails), add to the Gemfile
|
23
|
-
|
24
|
-
```
|
25
|
-
gem 'ons_openapi'
|
26
|
-
```
|
27
|
-
|
28
|
-
You must have an ExecJS supported runtime when running this gem. If you are using Mac OS X or Windows, you already have a JavaScript runtime installed in your operating system. Check [ExecJS documentation](https://github.com/sstephenson/execjs#readme) to know all supported JavaScript runtimes.
|
29
|
-
|
30
|
-
The gem includes code from the [JSON-stat Javascript Toolkit](https://github.com/badosa/JSON-stat) to parse JSON-stat formatted results from the ONS OpenAPI. ExecJS is used to run JSON-stat JavaScript code from within Ruby.
|
31
|
-
|
32
|
-
# Register for API key
|
33
|
-
|
34
|
-
The ONS OpenAPI requires you [register for an API key](https://www.ons.gov.uk/ons/apiservice/web/apiservice/home#reg-main-content).
|
35
|
-
|
36
|
-
When using the gem, set an environment variable named `ONS_APIKEY` with your API key value.
|
37
|
-
|
38
|
-
```
|
39
|
-
$ ONS_APIKEY=<your_ons_openapi_key>
|
40
|
-
```
|
41
|
-
|
42
|
-
# Getting started
|
10
|
+
# Example usage
|
43
11
|
|
44
12
|
Running in irb:
|
45
13
|
|
@@ -92,6 +60,37 @@ Running in irb:
|
|
92
60
|
#
|
93
61
|
# data_for('E05004981 Woodlands') or data_for('E05004981') see http://statistics.data.gov.uk/doc/statistical-geography/E05004981
|
94
62
|
|
63
|
+
# Installation
|
64
|
+
|
65
|
+
```
|
66
|
+
gem install ons_openapi
|
67
|
+
```
|
68
|
+
|
69
|
+
then in Ruby code
|
70
|
+
|
71
|
+
```
|
72
|
+
require 'ons_openapi'
|
73
|
+
```
|
74
|
+
|
75
|
+
or if using bundler (as with Rails), add to the Gemfile
|
76
|
+
|
77
|
+
```
|
78
|
+
gem 'ons_openapi'
|
79
|
+
```
|
80
|
+
|
81
|
+
You must have an ExecJS supported runtime when running this gem. If you are using Mac OS X or Windows, you already have a JavaScript runtime installed in your operating system. Check [ExecJS documentation](https://github.com/sstephenson/execjs#readme) to know all supported JavaScript runtimes.
|
82
|
+
|
83
|
+
The gem includes code from the [JSON-stat Javascript Toolkit](https://github.com/badosa/JSON-stat) to parse JSON-stat formatted results from the ONS OpenAPI. ExecJS is used to run JSON-stat JavaScript code from within Ruby.
|
84
|
+
|
85
|
+
# Register for API key
|
86
|
+
|
87
|
+
The ONS OpenAPI requires you [register for an API key](https://www.ons.gov.uk/ons/apiservice/web/apiservice/home#reg-main-content).
|
88
|
+
|
89
|
+
When using the gem, set an environment variable named `ONS_APIKEY` with your API key value.
|
90
|
+
|
91
|
+
```
|
92
|
+
$ ONS_APIKEY=<your_ons_openapi_key>
|
93
|
+
```
|
95
94
|
|
96
95
|
# Contexts
|
97
96
|
|
data/lib/ons_openapi.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ons_openapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rob McKinnon
|
@@ -100,6 +100,7 @@ rdoc_options:
|
|
100
100
|
- README.md
|
101
101
|
require_paths:
|
102
102
|
- lib
|
103
|
+
- vendor
|
103
104
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
105
|
requirements:
|
105
106
|
- - ">="
|