nexmo_api_specification 0.1.1 → 0.1.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6ec1055c9ddf598eede54d3be79ed8c8aa73e74
4
- data.tar.gz: a812759f26b3d0f6e0b37b924398a1dd81e1f352
3
+ metadata.gz: ce4c29efbf7317e8bd615b119dbfebdb322a012b
4
+ data.tar.gz: e573dc3bab14927ff7df0ef9e56bcd23f0960740
5
5
  SHA512:
6
- metadata.gz: c17d227461f6f1aff9b968c7b2d0a48a8620fb3ba068dafc35973f3e40fce5f7b083b34234dd43c817e65c0b8bd6d8c67532e0f6abc0ac7a4c804132e615b3d9
7
- data.tar.gz: 1b578dd9434349dd8e605e6787996061e3d6d6fac727d4e548d56b72bb5ad607435c7722f465e9e845a20ce7852936be04b92ac365fb62389fee5d0ca2b70d41
6
+ metadata.gz: 7bffbb96880bf25cb7b5ace8be585a43c9de1c9e3a6b2e245d8a964a377b6e9d45d67c79b6acc0d835104e27f9f71f26a5b36007d8792cbcbc3006329a95d314
7
+ data.tar.gz: 165fac5f5b36286eced7bf6be50575a3847d098c1e98e468c2d32fc58be60123f3b808a7232d6b1dd4d4f0c64cebfe3b3a1a6da603711441d4a1e1714b2b571b
data/README.md CHANGED
@@ -43,6 +43,32 @@ These definitions provide a single point of truth that can be used end-to-end ca
43
43
  - [Swagger Parser](https://github.com/swagger-api/swagger-parser) - Standalone library for parsing OAS3 definitions from Java
44
44
  - [Nexmo Developer](https://github.com/Nexmo/nexmo-developer) - Nexmo Developer has it's own OAS3 definition parser and API reference UI.
45
45
 
46
+ ## Consuming
47
+
48
+ These API Specifications can be made available as packages. See below for the currently available packages and instructions on how to consume them.
49
+
50
+ ### Ruby
51
+
52
+ ##### Install the Gem
53
+
54
+ ```
55
+ $ gem install nexmo_api_specification
56
+ ```
57
+
58
+ or add it to your GemFile and run `bundle install`
59
+
60
+ ```
61
+ gem 'nexmo_api_specification', '0.1.1'
62
+ ```
63
+
64
+ ##### Usage
65
+
66
+ Get a definition file:
67
+
68
+ ```ruby
69
+ NexmoApiSpecification::Definition.load(:sms)
70
+ ```
71
+
46
72
  ## Contributing
47
73
 
48
74
  Contributions are welcome, please follow [GitHub Flow](https://guides.github.com/introduction/flow/index.html)
@@ -2,8 +2,12 @@ module NexmoApiSpecification
2
2
  module Definition
3
3
  def self.load(definition)
4
4
  path = File.join NexmoApiSpecification.root, "#{definition}.yml"
5
- raise 'Definition does not exist' unless File.exist? path
5
+ return false unless File.exist? path
6
6
  File.read path
7
7
  end
8
+
9
+ def self.load!(definition)
10
+ load(definition) || raise('Definition does not exist')
11
+ end
8
12
  end
9
13
  end
@@ -1,3 +1,3 @@
1
1
  module NexmoApiSpecification
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexmo_api_specification
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Butler