nexmo-oas-renderer 0.10.0 → 0.11.0

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
  SHA256:
3
- metadata.gz: 691cea5c58db9e4302f16eeb56da4d2b8acc182d7849394b55e540d25cbef01e
4
- data.tar.gz: f83955f0c99f81b184551666c82d4825ed6651801c2a485f482125191c9b7bcf
3
+ metadata.gz: 52dff86075e3ce752f5c9ddb1cf70cb7923e556ccd71d22b85fbe4820fdf1c47
4
+ data.tar.gz: f8fa74c1eb3e214f380e6f60f7305fd8ca5b2ebc68319fe4388fcc66ae2f65e0
5
5
  SHA512:
6
- metadata.gz: aaa967c7b0c411b2da091ad3ad1e4916c198bb545417b453ebd16646fa57db88d7b29b94a2907349fa077d6108438e775a3e8c41644150fa5e187c130a64d7f7
7
- data.tar.gz: 5b952135e2310ef7dcebf6de690df94aae5d7c86ec2ee190792a225ed566495c86d19a4677ec2eee353b24bd741d86e2c5f557b8e3c20905475c80a0e11144a1
6
+ metadata.gz: 488e8ddfec00007ae8ba57179a155cb4a91d0b3fe9f5b8c05ec54aa8decb01e2cc84947bf0396af5a8456e56cf6076105e830e85b2daf5289f616ddee14849b8
7
+ data.tar.gz: dd968a15e0ff46b270486e2c5f7bbfa110342471828ab9c6cf28ba6920ba1525fbc63a702c0848cbe7123d0540b819fd11eaf5dfaf862eec064a852fe58af3b3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.11.0
2
+ * Add ability to customize OAS github's repo
3
+
1
4
  # 0.9.0
2
5
  * Use volta2 styles
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nexmo-oas-renderer (0.10.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.0)
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.3)
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)
@@ -1,7 +1,7 @@
1
1
  module Nexmo
2
2
  module OAS
3
3
  module Renderer
4
- VERSION = "0.10.0"
4
+ VERSION = "0.11.0"
5
5
  end
6
6
  end
7
7
  end
@@ -31,7 +31,7 @@
31
31
  </a>
32
32
  </div>
33
33
  <div class="Vlt-col Vlt-right">
34
- <a href="https://github.com/Nexmo/api-specification/blob/master/definitions/<%= @specification.definition_name %>.yml" class='Vlt-btn Vlt-btn--tertiary Vlt-btn--app Vlt-right Vlt-bg-grey-lighter'>
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.10.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-04-20 00:00:00.000000000 Z
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
- rubyforge_project:
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.