sober_swag 0.18.0 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +15 -0
- data/CHANGELOG.md +4 -0
- data/example/Gemfile +2 -2
- data/lib/sober_swag/server.rb +22 -10
- data/lib/sober_swag/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ab4c5db5ca2e6fe63713b7416d127b3bdc730e82562d4ca13b477eaf362460
|
4
|
+
data.tar.gz: ce6351db33dc3506be6baa66e228532bd8e3830c9e7b67b27c2c6b899a77677c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bab9a59d19cef6552f33555a5cac081c750df97f0364d06fb39fbd5ad4973262f43ca233d52be1f0544815830345a59574dd4913ca2ec6cb2ef7f9e465502f35
|
7
|
+
data.tar.gz: f0e3db070ac4b30457d309d68a88c81b2cb090478553a622f9463e8cff9f3f67bb128f120ebcd9ce73164f21fb2e83b4a8befa02e87779e241fae96188ccc077
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# To get started with Dependabot version updates, you'll need to specify which
|
2
|
+
# package ecosystems to update and where the package manifests are located.
|
3
|
+
# Please see the documentation for all configuration options:
|
4
|
+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
5
|
+
|
6
|
+
version: 2
|
7
|
+
updates:
|
8
|
+
- package-ecosystem: "bundler"
|
9
|
+
directory: "/"
|
10
|
+
schedule:
|
11
|
+
interval: "daily"
|
12
|
+
- package-ecosystem: "bundler"
|
13
|
+
directory: "/example"
|
14
|
+
schedule:
|
15
|
+
interval: "daily"
|
data/CHANGELOG.md
CHANGED
data/example/Gemfile
CHANGED
@@ -8,7 +8,7 @@ gem 'actionpack', '>= 6.0.3.2'
|
|
8
8
|
# Use sqlite3 as the database for Active Record
|
9
9
|
gem 'sqlite3', '~> 1.4'
|
10
10
|
# Use Puma as the app server
|
11
|
-
gem 'puma', '~>
|
11
|
+
gem 'puma', '~> 5.2'
|
12
12
|
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
|
13
13
|
# gem 'jbuilder', '~> 2.7'
|
14
14
|
# Use Active Model has_secure_password
|
@@ -34,7 +34,7 @@ group :development, :test do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
group :development do
|
37
|
-
gem 'listen', '>= 3.0.5', '< 3.
|
37
|
+
gem 'listen', '>= 3.0.5', '< 3.5'
|
38
38
|
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
|
39
39
|
gem 'spring'
|
40
40
|
gem 'spring-watcher-listen', '~> 2.0.0'
|
data/lib/sober_swag/server.rb
CHANGED
@@ -22,28 +22,40 @@ module SoberSwag
|
|
22
22
|
#
|
23
23
|
# @param controller_proc [Proc] a proc that, when called, gives a list of {SoberSwag::Controller}s to document
|
24
24
|
# @param cache [Bool | Proc] if we should cache our defintions (default false)
|
25
|
+
# @param redoc_version [String] what version of the redoc library to use to display UI (default 'next', the latest version).
|
25
26
|
def initialize(
|
26
27
|
controller_proc: RAILS_CONTROLLER_PROC,
|
27
|
-
cache: false
|
28
|
+
cache: false,
|
29
|
+
redoc_version: 'next'
|
28
30
|
)
|
29
31
|
@controller_proc = controller_proc
|
30
32
|
@cache = cache
|
33
|
+
@html = EFFECT_HTML.gsub(/REDOC_VERSION/, redoc_version)
|
31
34
|
end
|
32
35
|
|
33
36
|
EFFECT_HTML = <<~HTML.freeze
|
34
37
|
<!DOCTYPE html>
|
35
38
|
<html>
|
36
39
|
<head>
|
37
|
-
<title>
|
38
|
-
|
39
|
-
<
|
40
|
+
<title>ReDoc</title>
|
41
|
+
<!-- needed for adaptive design -->
|
42
|
+
<meta charset="utf-8"/>
|
43
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
44
|
+
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
|
45
|
+
|
46
|
+
<!--
|
47
|
+
ReDoc doesn't change outer page styles
|
48
|
+
-->
|
49
|
+
<style>
|
50
|
+
body {
|
51
|
+
margin: 0;
|
52
|
+
padding: 0;
|
53
|
+
}
|
54
|
+
</style>
|
40
55
|
</head>
|
41
56
|
<body>
|
42
|
-
<
|
43
|
-
</
|
44
|
-
<script>
|
45
|
-
SwaggerUIBundle({url: 'SCRIPT_NAME', dom_id: '#swagger'})
|
46
|
-
</script>
|
57
|
+
<redoc spec-url='SCRIPT_NAME'></redoc>
|
58
|
+
<script src="https://cdn.jsdelivr.net/npm/redoc@REDOC_VERSION/bundles/redoc.standalone.js"> </script>
|
47
59
|
</body>
|
48
60
|
</html>
|
49
61
|
HTML
|
@@ -53,7 +65,7 @@ module SoberSwag
|
|
53
65
|
if req.path_info&.match?(/json/si) || req.get_header('Accept')&.match?(/json/si)
|
54
66
|
[200, { 'Content-Type' => 'application/json' }, [generate_json_string]]
|
55
67
|
else
|
56
|
-
[200, { 'Content-Type' => 'text/html' }, [
|
68
|
+
[200, { 'Content-Type' => 'text/html' }, [@html.gsub(/SCRIPT_NAME/, "#{env['SCRIPT_NAME']}.json")]]
|
57
69
|
end
|
58
70
|
end
|
59
71
|
|
data/lib/sober_swag/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sober_swag
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Super
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -172,6 +172,7 @@ extensions: []
|
|
172
172
|
extra_rdoc_files: []
|
173
173
|
files:
|
174
174
|
- ".github/config/rubocop_linter_action.yml"
|
175
|
+
- ".github/dependabot.yml"
|
175
176
|
- ".github/workflows/lint.yml"
|
176
177
|
- ".github/workflows/ruby.yml"
|
177
178
|
- ".gitignore"
|