iglu-ruby-client 0.1.0.beta.2 → 0.1.0.beta.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -57
- data/lib/iglu-client/registries.rb +1 -1
- data/lib/iglu-client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18aa6fc1d0db3799c92b8e53fcfd48109e471072
|
4
|
+
data.tar.gz: f17131a158241a0ca6ad10fac3781a827b417c74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fbb6d3c5bb73e74f2dac0b5a5e6fc3d37387bd6d8756904e1deb9c4ab78caa70fa66859a02f3c845d0471f08a310e631f14e970b77e245dd9f252b0c77c5da7c
|
7
|
+
data.tar.gz: daaf69a5a97d31da0ab27d3cedc126869fdde601689a73c29769f4c804116c9207c631f8209353e7cd86d07f51298613d626af3654cd2d1a424b1320b32ea4a0
|
data/README.md
CHANGED
@@ -7,55 +7,6 @@
|
|
7
7
|
|
8
8
|
A Ruby client and resolver for **[Iglu schema repositories] [iglu-wiki]** from the team at **[Snowplow Analytics] [snowplow-website]**.
|
9
9
|
|
10
|
-
Iglu Ruby Client is used to validate self-describing JSONs. For a presentation on how we came to build Iglu, see **[this blog post] [snowplow-schema-post]**.
|
11
|
-
|
12
|
-
![client-img] [client-img]
|
13
|
-
|
14
|
-
## Installation
|
15
|
-
|
16
|
-
The Ruby Iglu Client is published to [RubyGems] [rubygems], the Ruby community's gem hosting service.
|
17
|
-
This makes it easy to either install the client locally, or to add it as a dependency into your own Ruby app.
|
18
|
-
|
19
|
-
To install the Iglu Ruby Client locally:
|
20
|
-
|
21
|
-
$ gem install iglu-ruby-client
|
22
|
-
|
23
|
-
To add the Iglu Client as a dependency to your own Ruby gem, edit your gemfile and add:
|
24
|
-
|
25
|
-
```ruby
|
26
|
-
gem 'iglu-ruby-client'
|
27
|
-
```
|
28
|
-
|
29
|
-
## Usage
|
30
|
-
|
31
|
-
The primary entity for working with Iglu Ruby Client is `Iglu::Client`.
|
32
|
-
Resolver static method `parse` allows you to create Resolver instance from a **[resolver configuration] [resolver-config]**.
|
33
|
-
The second working method is `lookup_schema`, receiving Schema key as String or directly `com.snowplowanalytics.iglu.SchemaKey` object,
|
34
|
-
this method traverses all configured repositories trying to find Schema by its key.
|
35
|
-
|
36
|
-
```ruby
|
37
|
-
require 'json'
|
38
|
-
require 'iglu-client'
|
39
|
-
|
40
|
-
schema_key = Iglu::SchemaKey.parse_key("iglu:com.snowplowanalytics.snowplow/mobile_context/jsonschema/1-0-0")
|
41
|
-
resolver = Iglu::Resolver.parse(JSON.parse(resolver_config, {:symbolize_names => true}))
|
42
|
-
schema = resolver.lookup_schema(schema_key)
|
43
|
-
```
|
44
|
-
|
45
|
-
Above snippet returns a mobile context JSON Schema if you provide the correct `resolver_config`.
|
46
|
-
|
47
|
-
## Developer quickstart
|
48
|
-
|
49
|
-
Assuming git, **[Vagrant] [vagrant-install]** and **[VirtualBox] [virtualbox-install]** installed:
|
50
|
-
|
51
|
-
```bash
|
52
|
-
host> git clone https://github.com/snowplow/iglu-ruby-client
|
53
|
-
host> cd iglu-ruby-client
|
54
|
-
host> vagrant up && vagrant ssh
|
55
|
-
guest> cd /vagrant
|
56
|
-
guest> rspec
|
57
|
-
```
|
58
|
-
|
59
10
|
## Find out more
|
60
11
|
|
61
12
|
| **[Technical Docs] [techdocs]** | **[Setup Guide] [setup]** | **[Roadmap] [roadmap]** | **[Contributing] [contributing]** |
|
@@ -75,18 +26,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
75
26
|
See the License for the specific language governing permissions and
|
76
27
|
limitations under the License.
|
77
28
|
|
78
|
-
[client-img]: https://github.com/snowplow/iglu/wiki/technical-documentation/images/iglu-clients.png
|
79
|
-
|
80
29
|
[iglu-wiki]: https://github.com/snowplow/iglu/wiki
|
81
|
-
[snowplow-schema-post]: http://snowplowanalytics.com/blog/2014/06/06/making-snowplow-schemas-flexible-a-technical-approach/
|
82
|
-
[resolver-config]: https://github.com/snowplow/iglu/wiki/Iglu-client-configuration
|
83
30
|
|
84
|
-
[snowplow-repo]: https://github.com/snowplow/snowplow
|
85
31
|
[snowplow-website]: http://snowplowanalytics.com
|
86
32
|
|
87
|
-
[vagrant-install]: http://docs.vagrantup.com/v2/installation/index.html
|
88
|
-
[virtualbox-install]: https://www.virtualbox.org/wiki/Downloads
|
89
|
-
|
90
33
|
[techdocs-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/techdocs.png
|
91
34
|
[setup-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/setup.png
|
92
35
|
[roadmap-image]: https://d3i6fms1cm1j0i.cloudfront.net/github/images/roadmap.png
|
@@ -107,7 +107,7 @@ module Iglu
|
|
107
107
|
class ResolverError < StandardError
|
108
108
|
attr_reader :lookups, :schema_key
|
109
109
|
|
110
|
-
def initialize(lookups)
|
110
|
+
def initialize(lookups, schema_key)
|
111
111
|
@lookups = lookups
|
112
112
|
@schema_key = schema_key
|
113
113
|
message = "Schema [#{schema_key.as_uri}] was not found with in [#{lookups.length}] registries with following attempts: [#{lookups.map { |lookup| lookup.to_s }.join('; ')}]"
|
data/lib/iglu-client/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iglu-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.beta.
|
4
|
+
version: 0.1.0.beta.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Parkhomenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|