nexmo-oas-renderer 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile.lock +3 -3
- data/lib/nexmo/oas/renderer/app.rb +14 -0
- data/lib/nexmo/oas/renderer/version.rb +1 -1
- data/lib/nexmo/oas/renderer/views/open_api/show.erb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52dff86075e3ce752f5c9ddb1cf70cb7923e556ccd71d22b85fbe4820fdf1c47
|
4
|
+
data.tar.gz: f8fa74c1eb3e214f380e6f60f7305fd8ca5b2ebc68319fe4388fcc66ae2f65e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 488e8ddfec00007ae8ba57179a155cb4a91d0b3fe9f5b8c05ec54aa8decb01e2cc84947bf0396af5a8456e56cf6076105e830e85b2daf5289f616ddee14849b8
|
7
|
+
data.tar.gz: dd968a15e0ff46b270486e2c5f7bbfa110342471828ab9c6cf28ba6920ba1525fbc63a702c0848cbe7123d0540b819fd11eaf5dfaf862eec064a852fe58af3b3
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nexmo-oas-renderer (0.
|
4
|
+
nexmo-oas-renderer (0.11.0)
|
5
5
|
activemodel (~> 6.0)
|
6
6
|
activesupport (~> 6.0)
|
7
7
|
banzai (~> 0.1.2)
|
@@ -109,7 +109,7 @@ GEM
|
|
109
109
|
hansi (~> 0.2.0)
|
110
110
|
mustermann (= 1.1.1)
|
111
111
|
neatjson (0.9)
|
112
|
-
nexmo_markdown_renderer (0.3.
|
112
|
+
nexmo_markdown_renderer (0.3.1)
|
113
113
|
activemodel (~> 6.0)
|
114
114
|
banzai (~> 0.1.2)
|
115
115
|
i18n (~> 1.7)
|
@@ -166,7 +166,7 @@ GEM
|
|
166
166
|
rake (>= 0.8.7)
|
167
167
|
thor (>= 0.20.3, < 2.0)
|
168
168
|
rake (13.0.1)
|
169
|
-
rb-fsevent (0.10.
|
169
|
+
rb-fsevent (0.10.4)
|
170
170
|
rb-inotify (0.10.1)
|
171
171
|
ffi (~> 1.0)
|
172
172
|
redcarpet (3.4.0)
|
@@ -32,6 +32,7 @@ module Nexmo
|
|
32
32
|
set :mustermann_opts, { type: :rails }
|
33
33
|
set :oas_path, (ENV['OAS_PATH'] || './')
|
34
34
|
set :bind, '0.0.0.0'
|
35
|
+
set :github_path, Proc.new { load_business_yaml }
|
35
36
|
|
36
37
|
helpers do
|
37
38
|
include Helpers::Render
|
@@ -58,6 +59,19 @@ module Nexmo
|
|
58
59
|
end
|
59
60
|
end
|
60
61
|
|
62
|
+
def self.load_business_yaml
|
63
|
+
if defined?(NexmoDeveloper::Application) && !File.exist?("#{Rails.configuration.docs_base_path}/config/business_info.yml")
|
64
|
+
raise "Application requires a 'config/business_info.yml' file to be defined inside the documentation path."
|
65
|
+
elsif defined?(NexmoDeveloper::Application) && File.exist?("#{Rails.configuration.docs_base_path}/config/business_info.yml")
|
66
|
+
@url ||= begin
|
67
|
+
config = YAML.load_file("#{Rails.configuration.docs_base_path}/config/business_info.yml")
|
68
|
+
"https://www.github.com/#{config['oas_repo']}/blob/master/definitions"
|
69
|
+
end
|
70
|
+
else
|
71
|
+
"https://www.github.com/nexmo/api-specification/blob/master/definitions"
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
61
75
|
def check_redirect!
|
62
76
|
if defined?(NexmoDeveloper::Application)
|
63
77
|
redirect_path = Redirector.find(request)
|
@@ -31,7 +31,7 @@
|
|
31
31
|
</a>
|
32
32
|
</div>
|
33
33
|
<div class="Vlt-col Vlt-right">
|
34
|
-
<a href="
|
34
|
+
<a href="<%= Nexmo::OAS::Renderer::API.github_path %>/<%= @specification.definition_name %>.yml" class='Vlt-btn Vlt-btn--tertiary Vlt-btn--app Vlt-right Vlt-bg-grey-lighter'>
|
35
35
|
<svg className="Vlt-icon Vlt-black">
|
36
36
|
<use xlink:href="/assets/symbol/volta-icons.svg#Vlt-icon-github" />
|
37
37
|
</svg>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nexmo-oas-renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabian Rodriguez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -378,8 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
378
378
|
- !ruby/object:Gem::Version
|
379
379
|
version: '0'
|
380
380
|
requirements: []
|
381
|
-
|
382
|
-
rubygems_version: 2.7.6.2
|
381
|
+
rubygems_version: 3.0.3
|
383
382
|
signing_key:
|
384
383
|
specification_version: 4
|
385
384
|
summary: OpenAPI Specification renderer.
|