dpn_swagger_engine 2.0.0.rc → 2.0.1.rc
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 +4 -4
- data/app/assets/fonts/{swagger_engine → dpn_swagger_engine}/DroidSans-Bold.ttf +0 -0
- data/app/assets/fonts/{swagger_engine → dpn_swagger_engine}/DroidSans.ttf +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/collapse.gif +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/expand.gif +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/explorer_icons.png +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/favicon-16x16.png +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/favicon-32x32.png +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/favicon.ico +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/logo_small.png +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/pet_store_api.png +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/throbber.gif +0 -0
- data/app/assets/images/{swagger_engine → dpn_swagger_engine}/wordnik_api.png +0 -0
- data/app/assets/javascripts/dpn_swagger_engine/application.js +24 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/ca.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/en.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/es.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/fr.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/geo.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/it.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/ja.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/ko-kr.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/pl.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/pt.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/ru.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/tr.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/translator.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lang/zh-cn.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/backbone-min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/es5-shim.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/handlebars-4.0.5.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/highlight.9.1.0.pack.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/highlight.9.1.0.pack_extended.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/jquery-1.8.0.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/jquery.ba-bbq.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/jquery.slideto.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/jquery.wiggle.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/js-yaml.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/jsoneditor.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/lodash.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/marked.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/object-assign-pollyfill.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/sanitize-html.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/swagger-oauth.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/o2c.html +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/swagger-ui.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/swagger-ui.min.js +0 -0
- data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/swagger.json +1 -1
- data/app/assets/stylesheets/{swagger_engine → dpn_swagger_engine}/application.css +1 -1
- data/app/assets/stylesheets/{swagger_engine → dpn_swagger_engine}/print.css +0 -0
- data/app/assets/stylesheets/{swagger_engine → dpn_swagger_engine}/reset.css +0 -0
- data/app/assets/stylesheets/{swagger_engine → dpn_swagger_engine}/screen.css +0 -0
- data/app/assets/stylesheets/{swagger_engine → dpn_swagger_engine}/style.css +0 -0
- data/app/assets/stylesheets/{swagger_engine → dpn_swagger_engine}/typography.css +0 -0
- data/app/controllers/{swagger_engine → dpn_swagger_engine}/application_controller.rb +5 -4
- data/app/controllers/dpn_swagger_engine/swaggers_controller.rb +31 -0
- data/app/helpers/{swagger_engine → dpn_swagger_engine}/application_helper.rb +1 -1
- data/app/helpers/{swagger_engine → dpn_swagger_engine}/swagger_helper.rb +1 -1
- data/app/views/{swagger_engine → dpn_swagger_engine}/swaggers/index.html.erb +0 -0
- data/app/views/{swagger_engine → dpn_swagger_engine}/swaggers/o2c.html +0 -0
- data/app/views/dpn_swagger_engine/swaggers/show.html.erb +121 -0
- data/app/views/layouts/dpn_swagger_engine/application.html.erb +14 -0
- data/app/views/swagger_engine/swaggers/show.html.erb +4 -4
- data/config/routes.rb +1 -1
- data/dpn_swagger_engine.gemspec +2 -5
- data/lib/{swagger_engine → dpn_swagger_engine}/engine.rb +12 -7
- data/lib/{swagger_engine → dpn_swagger_engine}/version.rb +2 -2
- data/lib/{swagger_engine.rb → dpn_swagger_engine.rb} +3 -3
- data/lib/tasks/{swagger_engine_tasks.rake → dpn_swagger_engine_tasks.rake} +1 -1
- metadata +66 -65
- data/app/assets/javascripts/swagger_engine/application.js +0 -24
- data/app/controllers/swagger_engine/swaggers_controller.rb +0 -29
- data/app/views/layouts/swagger_engine/application.html.erb +0 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c6ee542ba2ba105deadabea8d63c3c694c29302c
|
|
4
|
+
data.tar.gz: f44597f58fa3651eaa6e172076c467008e38b52e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b877472e20dac2119807f6f1514e34d2eb2a7e2dd587532e4fda286d5490c51a65ccb77906f768d6320ad5609977ef2341d6abe8f69b57b9c439d85f3e33d8d
|
|
7
|
+
data.tar.gz: 541c4dd19990096a39990b107839cdc674e45ae908bb73c220d93bfb1f879fdd5abb63a0297090e27f5caad80140f217958954c719e2f3fb5ecaec27f9833062
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// the order matches swagger-ui dist/index.html
|
|
2
|
+
|
|
3
|
+
//= require 'dpn_swagger_engine/lib/object-assign-polyfill.js'
|
|
4
|
+
//= require 'dpn_swagger_engine/lib/jquery-1.8.0.min.js'
|
|
5
|
+
//= require 'dpn_swagger_engine/lib/jquery.slideto.min.js'
|
|
6
|
+
//= require 'dpn_swagger_engine/lib/jquery.wiggle.min.js'
|
|
7
|
+
//= require 'dpn_swagger_engine/lib/jquery.ba-bbq.min.js'
|
|
8
|
+
//= require 'dpn_swagger_engine/lib/handlebars-4.0.5.js'
|
|
9
|
+
//= require 'dpn_swagger_engine/lib/lodash.min.js'
|
|
10
|
+
//= require 'dpn_swagger_engine/lib/backbone-min.js'
|
|
11
|
+
//= require 'dpn_swagger_engine/swagger-ui.js'
|
|
12
|
+
|
|
13
|
+
//= require 'dpn_swagger_engine/lib/highlight.9.1.0.pack.js'
|
|
14
|
+
//= require 'dpn_swagger_engine/lib/highlight.9.1.0.pack_extended.js'
|
|
15
|
+
//= require 'dpn_swagger_engine/lib/jsoneditor.min.js'
|
|
16
|
+
//= require 'dpn_swagger_engine/lib/marked.js'
|
|
17
|
+
//= require 'dpn_swagger_engine/lib/swagger-oauth.js'
|
|
18
|
+
|
|
19
|
+
//= require 'dpn_swagger_engine/lib/es5-shim.js'
|
|
20
|
+
//= require 'dpn_swagger_engine/lib/sanitize-html.min.js'
|
|
21
|
+
|
|
22
|
+
// Some basic translations
|
|
23
|
+
//= require 'dpn_swagger_engine/lang/translator.js'
|
|
24
|
+
//= require 'dpn_swagger_engine/lang/en.js'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/highlight.9.1.0.pack.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/app/assets/javascripts/{swagger_engine → dpn_swagger_engine}/lib/object-assign-pollyfill.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
module
|
|
1
|
+
module DpnSwaggerEngine
|
|
2
2
|
class ApplicationController < ActionController::Base
|
|
3
3
|
|
|
4
4
|
before_filter :authenticate
|
|
5
5
|
|
|
6
6
|
protected
|
|
7
|
+
|
|
7
8
|
def authenticate
|
|
8
|
-
|
|
9
|
+
config = DpnSwaggerEngine.configuration
|
|
10
|
+
if config.admin_username
|
|
9
11
|
authenticate_or_request_with_http_basic do |username, password|
|
|
10
|
-
username ==
|
|
12
|
+
username == config.admin_username && password == config.admin_password
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
15
|
end
|
|
14
|
-
|
|
15
16
|
end
|
|
16
17
|
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
require_relative 'application_controller'
|
|
2
|
+
|
|
3
|
+
module DpnSwaggerEngine
|
|
4
|
+
class SwaggersController < ApplicationController
|
|
5
|
+
layout false
|
|
6
|
+
|
|
7
|
+
before_filter :load_json_files
|
|
8
|
+
|
|
9
|
+
def index
|
|
10
|
+
redirect_to swagger_path(@json_files.first[0]) if @json_files.size == 1
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
def show
|
|
14
|
+
respond_to do |format|
|
|
15
|
+
api_id = params[:id]
|
|
16
|
+
format.html do
|
|
17
|
+
@swagger_json_url = swagger_path(api_id, format: :json)
|
|
18
|
+
end
|
|
19
|
+
format.json do
|
|
20
|
+
send_file @json_files[api_id.to_sym], type: 'application/json', disposition: 'inline'
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def load_json_files
|
|
28
|
+
@json_files ||= DpnSwaggerEngine.configuration.json_files || { default: "#{Rails.root}/lib/dpn_swagger_engine/swagger.json" }
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<title>DPN REST API</title>
|
|
6
|
+
|
|
7
|
+
<!-- Content in this file is derived from swagger-ui:dist/index.html -->
|
|
8
|
+
|
|
9
|
+
<%#= favicon_link_tag 'favicon-32x32.png', rel: 'icon', type: 'image/png', sizes: '32x32' %>
|
|
10
|
+
<%#= favicon_link_tag 'favicon-16x16.png', rel: 'icon', type: 'image/png', sizes: '16x16' %>
|
|
11
|
+
|
|
12
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/application" %>
|
|
13
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/reset", media: "print" %>
|
|
14
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/print", media: "print" %>
|
|
15
|
+
|
|
16
|
+
<%= javascript_include_tag "dpn_swagger_engine/application" %>
|
|
17
|
+
|
|
18
|
+
<%= csrf_meta_tags %>
|
|
19
|
+
|
|
20
|
+
<script type="text/javascript">
|
|
21
|
+
$(function () {
|
|
22
|
+
var url = window.location.search.match(/url=([^&]+)/);
|
|
23
|
+
if (url && url.length > 1) {
|
|
24
|
+
url = decodeURIComponent(url[1]);
|
|
25
|
+
} else {
|
|
26
|
+
url = '<%= @swagger_json_url %>';
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
hljs.configure({
|
|
30
|
+
highlightSizeThreshold: 5000
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
// Pre load translate...
|
|
34
|
+
if(window.SwaggerTranslator) {
|
|
35
|
+
window.SwaggerTranslator.translate();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
window.swaggerUi = new SwaggerUi({
|
|
39
|
+
url: url,
|
|
40
|
+
dom_id: "swagger-ui-container",
|
|
41
|
+
supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'],
|
|
42
|
+
onComplete: function(swaggerApi, swaggerUi){
|
|
43
|
+
if(typeof initOAuth == "function") {
|
|
44
|
+
initOAuth({
|
|
45
|
+
clientId: "your-client-id",
|
|
46
|
+
clientSecret: "your-client-secret-if-required",
|
|
47
|
+
realm: "your-realms",
|
|
48
|
+
appName: "your-app-name",
|
|
49
|
+
scopeSeparator: ",",
|
|
50
|
+
additionalQueryStringParams: {}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if(window.SwaggerTranslator) {
|
|
55
|
+
window.SwaggerTranslator.translate();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
headerTokenAuthorization();
|
|
59
|
+
},
|
|
60
|
+
onFailure: function(data) {
|
|
61
|
+
log("Unable to Load SwaggerUI");
|
|
62
|
+
},
|
|
63
|
+
docExpansion: "none",
|
|
64
|
+
jsonEditor: true,
|
|
65
|
+
// apisSorter: "alpha",
|
|
66
|
+
defaultModelRendering: 'schema',
|
|
67
|
+
showRequestHeaders: false
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Custom code for DPN authorization token
|
|
71
|
+
function headerTokenAuthorization(){
|
|
72
|
+
var token = encodeURIComponent($('#input_apiKey')[0].value);
|
|
73
|
+
if(token && token.trim() != "") {
|
|
74
|
+
var tokenAuth = new SwaggerClient.ApiKeyAuthorization("Authorization", "Token token=" + token, "header"));
|
|
75
|
+
window.swaggerUi.api.clientAuthorizations.add("api_key", tokenAuth);
|
|
76
|
+
// var tokenAuth = new ApiKeyAuthorization("Authorization", "Token token=" + token, "header"));
|
|
77
|
+
// window.authorizations.add("api_key", tokenAuth);
|
|
78
|
+
log("added token " + token);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
$('#input_apiKey').change(headerTokenAuthorization);
|
|
83
|
+
|
|
84
|
+
// A DPN authorization token that should work in development
|
|
85
|
+
var dpnToken = "hathi_token";
|
|
86
|
+
$('#input_apiKey').val(dpnToken);
|
|
87
|
+
|
|
88
|
+
window.swaggerUi.load();
|
|
89
|
+
|
|
90
|
+
function log() {
|
|
91
|
+
if ('console' in window) {
|
|
92
|
+
console.log.apply(console, arguments);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
</script>
|
|
97
|
+
</head>
|
|
98
|
+
|
|
99
|
+
<body class="swagger-section">
|
|
100
|
+
<div id='header'>
|
|
101
|
+
<div class="swagger-ui-wrap">
|
|
102
|
+
<a id="logo" href="http://swagger.io">
|
|
103
|
+
<img class="logo__img" alt="swagger" height="30" width="30" src="images/logo_small.png" />
|
|
104
|
+
<span class="logo__title">swagger</span>
|
|
105
|
+
</a>
|
|
106
|
+
<form id='api_selector'>
|
|
107
|
+
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
|
|
108
|
+
<!--
|
|
109
|
+
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
|
|
110
|
+
<div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
|
|
111
|
+
-->
|
|
112
|
+
<div id='auth_container'></div>
|
|
113
|
+
<div class='input'><a id="explore" class="header__btn" href="#" data-sw-translate>Explore</a></div>
|
|
114
|
+
</form>
|
|
115
|
+
</div>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
|
|
119
|
+
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
|
|
120
|
+
</body>
|
|
121
|
+
</html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<title>DPN REST API</title>
|
|
5
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/application", media: "all" %>
|
|
6
|
+
<%= javascript_include_tag "dpn_swagger_engine/application" %>
|
|
7
|
+
<%= csrf_meta_tags %>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
|
|
11
|
+
<%= yield %>
|
|
12
|
+
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
<%#= favicon_link_tag 'favicon-32x32.png', rel: 'icon', type: 'image/png', sizes: '32x32' %>
|
|
10
10
|
<%#= favicon_link_tag 'favicon-16x16.png', rel: 'icon', type: 'image/png', sizes: '16x16' %>
|
|
11
11
|
|
|
12
|
-
<%= stylesheet_link_tag "
|
|
13
|
-
<%= stylesheet_link_tag "
|
|
14
|
-
<%= stylesheet_link_tag "
|
|
12
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/application" %>
|
|
13
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/reset", media: "print" %>
|
|
14
|
+
<%= stylesheet_link_tag "dpn_swagger_engine/print", media: "print" %>
|
|
15
15
|
|
|
16
|
-
<%= javascript_include_tag "
|
|
16
|
+
<%= javascript_include_tag "dpn_swagger_engine/application" %>
|
|
17
17
|
|
|
18
18
|
<%= csrf_meta_tags %>
|
|
19
19
|
|
data/config/routes.rb
CHANGED
data/dpn_swagger_engine.gemspec
CHANGED
|
@@ -4,12 +4,12 @@ lib = File.expand_path('../lib', __FILE__)
|
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
5
|
|
|
6
6
|
# Maintain your gem's version:
|
|
7
|
-
require '
|
|
7
|
+
require 'dpn_swagger_engine/version'
|
|
8
8
|
|
|
9
9
|
# Describe your gem and declare its dependencies:
|
|
10
10
|
Gem::Specification.new do |spec|
|
|
11
11
|
spec.name = 'dpn_swagger_engine'
|
|
12
|
-
spec.version =
|
|
12
|
+
spec.version = DpnSwaggerEngine::VERSION
|
|
13
13
|
spec.authors = ['batdevis', 'Darren Weber']
|
|
14
14
|
spec.email = ['batdevis@gmail.com', 'dweber.consulting@gmail.com']
|
|
15
15
|
spec.homepage = 'https://github.com/dpn-admin/dpn_swagger_engine'
|
|
@@ -17,9 +17,6 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.description = 'API docs for dpn-server.'
|
|
18
18
|
spec.license = 'MIT'
|
|
19
19
|
|
|
20
|
-
# spec.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.rdoc"]
|
|
21
|
-
# spec.test_files = Dir["test/**/*"]
|
|
22
|
-
|
|
23
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
24
21
|
spec.bindir = 'exe'
|
|
25
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
module
|
|
1
|
+
module DpnSwaggerEngine
|
|
2
2
|
class Engine < ::Rails::Engine
|
|
3
|
-
isolate_namespace
|
|
3
|
+
isolate_namespace DpnSwaggerEngine
|
|
4
4
|
|
|
5
5
|
#https://gist.github.com/parndt/11381872
|
|
6
6
|
=begin
|
|
7
|
-
initializer "
|
|
8
|
-
app.config.assets.precompile += [
|
|
7
|
+
initializer "dpn_swagger_engine.assets.precompile", group: :all do |app|
|
|
8
|
+
app.config.assets.precompile += [
|
|
9
|
+
'dpn_swagger_engine/print.css',
|
|
10
|
+
'dpn_swagger_engine/reset.css'
|
|
11
|
+
]
|
|
9
12
|
end
|
|
10
13
|
=end
|
|
11
14
|
config.to_prepare do
|
|
12
|
-
Rails.application.config.assets.precompile += [
|
|
15
|
+
Rails.application.config.assets.precompile += [
|
|
16
|
+
'dpn_swagger_engine/print.css',
|
|
17
|
+
'dpn_swagger_engine/reset.css'
|
|
18
|
+
]
|
|
13
19
|
end
|
|
14
|
-
|
|
15
20
|
end
|
|
16
21
|
|
|
17
22
|
class Configuration
|
|
18
|
-
#[{ default: "swagger.json" }]
|
|
23
|
+
# [{ default: "swagger.json" }]
|
|
19
24
|
attr_accessor :json_files
|
|
20
25
|
attr_accessor :admin_username
|
|
21
26
|
attr_accessor :admin_password
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
require '
|
|
2
|
-
require '
|
|
1
|
+
require 'dpn_swagger_engine/engine'
|
|
2
|
+
require 'dpn_swagger_engine/version'
|
|
3
3
|
|
|
4
4
|
# Mount swagger-ui as a rails engine to document and explore the
|
|
5
5
|
# DPN REST API within the dpn-server project.
|
|
6
|
-
module
|
|
6
|
+
module DpnSwaggerEngine
|
|
7
7
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dpn_swagger_engine
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0.
|
|
4
|
+
version: 2.0.1.rc
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- batdevis
|
|
@@ -137,75 +137,76 @@ files:
|
|
|
137
137
|
- LICENSE.txt
|
|
138
138
|
- README.md
|
|
139
139
|
- Rakefile
|
|
140
|
-
- app/assets/fonts/
|
|
141
|
-
- app/assets/fonts/
|
|
142
|
-
- app/assets/images/
|
|
143
|
-
- app/assets/images/
|
|
144
|
-
- app/assets/images/
|
|
145
|
-
- app/assets/images/
|
|
146
|
-
- app/assets/images/
|
|
147
|
-
- app/assets/images/
|
|
148
|
-
- app/assets/images/
|
|
149
|
-
- app/assets/images/
|
|
150
|
-
- app/assets/images/
|
|
151
|
-
- app/assets/images/
|
|
152
|
-
- app/assets/javascripts/
|
|
153
|
-
- app/assets/javascripts/
|
|
154
|
-
- app/assets/javascripts/
|
|
155
|
-
- app/assets/javascripts/
|
|
156
|
-
- app/assets/javascripts/
|
|
157
|
-
- app/assets/javascripts/
|
|
158
|
-
- app/assets/javascripts/
|
|
159
|
-
- app/assets/javascripts/
|
|
160
|
-
- app/assets/javascripts/
|
|
161
|
-
- app/assets/javascripts/
|
|
162
|
-
- app/assets/javascripts/
|
|
163
|
-
- app/assets/javascripts/
|
|
164
|
-
- app/assets/javascripts/
|
|
165
|
-
- app/assets/javascripts/
|
|
166
|
-
- app/assets/javascripts/
|
|
167
|
-
- app/assets/javascripts/
|
|
168
|
-
- app/assets/javascripts/
|
|
169
|
-
- app/assets/javascripts/
|
|
170
|
-
- app/assets/javascripts/
|
|
171
|
-
- app/assets/javascripts/
|
|
172
|
-
- app/assets/javascripts/
|
|
173
|
-
- app/assets/javascripts/
|
|
174
|
-
- app/assets/javascripts/
|
|
175
|
-
- app/assets/javascripts/
|
|
176
|
-
- app/assets/javascripts/
|
|
177
|
-
- app/assets/javascripts/
|
|
178
|
-
- app/assets/javascripts/
|
|
179
|
-
- app/assets/javascripts/
|
|
180
|
-
- app/assets/javascripts/
|
|
181
|
-
- app/assets/javascripts/
|
|
182
|
-
- app/assets/javascripts/
|
|
183
|
-
- app/assets/javascripts/
|
|
184
|
-
- app/assets/javascripts/
|
|
185
|
-
- app/assets/javascripts/
|
|
186
|
-
- app/assets/javascripts/
|
|
187
|
-
- app/assets/stylesheets/
|
|
188
|
-
- app/assets/stylesheets/
|
|
189
|
-
- app/assets/stylesheets/
|
|
190
|
-
- app/assets/stylesheets/
|
|
191
|
-
- app/assets/stylesheets/
|
|
192
|
-
- app/assets/stylesheets/
|
|
193
|
-
- app/controllers/
|
|
194
|
-
- app/controllers/
|
|
195
|
-
- app/helpers/
|
|
196
|
-
- app/helpers/
|
|
197
|
-
- app/views/
|
|
198
|
-
- app/views/
|
|
199
|
-
- app/views/
|
|
140
|
+
- app/assets/fonts/dpn_swagger_engine/DroidSans-Bold.ttf
|
|
141
|
+
- app/assets/fonts/dpn_swagger_engine/DroidSans.ttf
|
|
142
|
+
- app/assets/images/dpn_swagger_engine/collapse.gif
|
|
143
|
+
- app/assets/images/dpn_swagger_engine/expand.gif
|
|
144
|
+
- app/assets/images/dpn_swagger_engine/explorer_icons.png
|
|
145
|
+
- app/assets/images/dpn_swagger_engine/favicon-16x16.png
|
|
146
|
+
- app/assets/images/dpn_swagger_engine/favicon-32x32.png
|
|
147
|
+
- app/assets/images/dpn_swagger_engine/favicon.ico
|
|
148
|
+
- app/assets/images/dpn_swagger_engine/logo_small.png
|
|
149
|
+
- app/assets/images/dpn_swagger_engine/pet_store_api.png
|
|
150
|
+
- app/assets/images/dpn_swagger_engine/throbber.gif
|
|
151
|
+
- app/assets/images/dpn_swagger_engine/wordnik_api.png
|
|
152
|
+
- app/assets/javascripts/dpn_swagger_engine/application.js
|
|
153
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/ca.js
|
|
154
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/en.js
|
|
155
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/es.js
|
|
156
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/fr.js
|
|
157
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/geo.js
|
|
158
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/it.js
|
|
159
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/ja.js
|
|
160
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/ko-kr.js
|
|
161
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/pl.js
|
|
162
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/pt.js
|
|
163
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/ru.js
|
|
164
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/tr.js
|
|
165
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/translator.js
|
|
166
|
+
- app/assets/javascripts/dpn_swagger_engine/lang/zh-cn.js
|
|
167
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/backbone-min.js
|
|
168
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/es5-shim.js
|
|
169
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/handlebars-4.0.5.js
|
|
170
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/highlight.9.1.0.pack.js
|
|
171
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/highlight.9.1.0.pack_extended.js
|
|
172
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/jquery-1.8.0.min.js
|
|
173
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/jquery.ba-bbq.min.js
|
|
174
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/jquery.slideto.min.js
|
|
175
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/jquery.wiggle.min.js
|
|
176
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/js-yaml.min.js
|
|
177
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/jsoneditor.min.js
|
|
178
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/lodash.min.js
|
|
179
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/marked.js
|
|
180
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/object-assign-pollyfill.js
|
|
181
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/sanitize-html.min.js
|
|
182
|
+
- app/assets/javascripts/dpn_swagger_engine/lib/swagger-oauth.js
|
|
183
|
+
- app/assets/javascripts/dpn_swagger_engine/o2c.html
|
|
184
|
+
- app/assets/javascripts/dpn_swagger_engine/swagger-ui.js
|
|
185
|
+
- app/assets/javascripts/dpn_swagger_engine/swagger-ui.min.js
|
|
186
|
+
- app/assets/javascripts/dpn_swagger_engine/swagger.json
|
|
187
|
+
- app/assets/stylesheets/dpn_swagger_engine/application.css
|
|
188
|
+
- app/assets/stylesheets/dpn_swagger_engine/print.css
|
|
189
|
+
- app/assets/stylesheets/dpn_swagger_engine/reset.css
|
|
190
|
+
- app/assets/stylesheets/dpn_swagger_engine/screen.css
|
|
191
|
+
- app/assets/stylesheets/dpn_swagger_engine/style.css
|
|
192
|
+
- app/assets/stylesheets/dpn_swagger_engine/typography.css
|
|
193
|
+
- app/controllers/dpn_swagger_engine/application_controller.rb
|
|
194
|
+
- app/controllers/dpn_swagger_engine/swaggers_controller.rb
|
|
195
|
+
- app/helpers/dpn_swagger_engine/application_helper.rb
|
|
196
|
+
- app/helpers/dpn_swagger_engine/swagger_helper.rb
|
|
197
|
+
- app/views/dpn_swagger_engine/swaggers/index.html.erb
|
|
198
|
+
- app/views/dpn_swagger_engine/swaggers/o2c.html
|
|
199
|
+
- app/views/dpn_swagger_engine/swaggers/show.html.erb
|
|
200
|
+
- app/views/layouts/dpn_swagger_engine/application.html.erb
|
|
200
201
|
- app/views/swagger_engine/swaggers/show.html.erb
|
|
201
202
|
- bin/rails
|
|
202
203
|
- bin/setup
|
|
203
204
|
- config/routes.rb
|
|
204
205
|
- dpn_swagger_engine.gemspec
|
|
205
|
-
- lib/
|
|
206
|
-
- lib/
|
|
207
|
-
- lib/
|
|
208
|
-
- lib/tasks/
|
|
206
|
+
- lib/dpn_swagger_engine.rb
|
|
207
|
+
- lib/dpn_swagger_engine/engine.rb
|
|
208
|
+
- lib/dpn_swagger_engine/version.rb
|
|
209
|
+
- lib/tasks/dpn_swagger_engine_tasks.rake
|
|
209
210
|
homepage: https://github.com/dpn-admin/dpn_swagger_engine
|
|
210
211
|
licenses:
|
|
211
212
|
- MIT
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// the order matches swagger-ui dist/index.html
|
|
2
|
-
|
|
3
|
-
//= require 'swagger_engine/lib/object-assign-polyfill.js'
|
|
4
|
-
//= require 'swagger_engine/lib/jquery-1.8.0.min.js'
|
|
5
|
-
//= require 'swagger_engine/lib/jquery.slideto.min.js'
|
|
6
|
-
//= require 'swagger_engine/lib/jquery.wiggle.min.js'
|
|
7
|
-
//= require 'swagger_engine/lib/jquery.ba-bbq.min.js'
|
|
8
|
-
//= require 'swagger_engine/lib/handlebars-4.0.5.js'
|
|
9
|
-
//= require 'swagger_engine/lib/lodash.min.js'
|
|
10
|
-
//= require 'swagger_engine/lib/backbone-min.js'
|
|
11
|
-
//= require 'swagger_engine/swagger-ui.js'
|
|
12
|
-
|
|
13
|
-
//= require 'swagger_engine/lib/highlight.9.1.0.pack.js'
|
|
14
|
-
//= require 'swagger_engine/lib/highlight.9.1.0.pack_extended.js'
|
|
15
|
-
//= require 'swagger_engine/lib/jsoneditor.min.js'
|
|
16
|
-
//= require 'swagger_engine/lib/marked.js'
|
|
17
|
-
//= require 'swagger_engine/lib/swagger-oauth.js'
|
|
18
|
-
|
|
19
|
-
//= require 'swagger_engine/lib/es5-shim.js'
|
|
20
|
-
//= require 'swagger_engine/lib/sanitize-html.min.js'
|
|
21
|
-
|
|
22
|
-
// Some basic translations
|
|
23
|
-
//= require 'swagger_engine/lang/translator.js'
|
|
24
|
-
//= require 'swagger_engine/lang/en.js'
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require_dependency "swagger_engine/application_controller"
|
|
2
|
-
|
|
3
|
-
module SwaggerEngine
|
|
4
|
-
class SwaggersController < ApplicationController
|
|
5
|
-
layout false
|
|
6
|
-
|
|
7
|
-
before_filter :load_json_files
|
|
8
|
-
|
|
9
|
-
def index
|
|
10
|
-
redirect_to swagger_path(@json_files.first[0]) if ( @json_files.size == 1 )
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def show
|
|
14
|
-
respond_to do |format|
|
|
15
|
-
format.html {
|
|
16
|
-
@swagger_json_url = swagger_path(params[:id], format: :json)
|
|
17
|
-
}
|
|
18
|
-
format.json {
|
|
19
|
-
send_file @json_files[params[:id].to_sym], type: 'application/json', disposition: 'inline'
|
|
20
|
-
}
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
private
|
|
25
|
-
def load_json_files
|
|
26
|
-
@json_files ||= SwaggerEngine.configuration.json_files || { default: "#{Rails.root}/lib/swagger_engine/swagger.json" }
|
|
27
|
-
end
|
|
28
|
-
end
|
|
29
|
-
end
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<title>SwaggerEngine</title>
|
|
5
|
-
<%= stylesheet_link_tag "swagger_engine/application", media: "all" %>
|
|
6
|
-
<%= javascript_include_tag "swagger_engine/application" %>
|
|
7
|
-
<%= csrf_meta_tags %>
|
|
8
|
-
</head>
|
|
9
|
-
<body>
|
|
10
|
-
|
|
11
|
-
<%= yield %>
|
|
12
|
-
|
|
13
|
-
</body>
|
|
14
|
-
</html>
|