grape-swagger-rails 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +63 -8
- data/app/assets/javascripts/grape_swagger_rails/{swagger-ui.js → swagger-ui.js.erb} +41 -29
- data/app/assets/javascripts/grape_swagger_rails/swagger-ui.min.js +1 -1
- data/app/assets/javascripts/grape_swagger_rails/swagger.js +290 -54
- data/app/assets/stylesheets/grape_swagger_rails/application.css +1 -1
- data/app/assets/stylesheets/grape_swagger_rails/{hightlight.default.css → highlight.default.css} +0 -0
- data/app/assets/stylesheets/grape_swagger_rails/{screen.css → screen.css.erb} +1 -1
- data/app/views/grape_swagger_rails/application/index.html.erb +3 -4
- data/grape-swagger-rails.gemspec +1 -1
- data/lib/grape-swagger-rails.rb +8 -4
- data/lib/grape-swagger-rails/version.rb +1 -1
- metadata +7 -7
@@ -8,7 +8,7 @@
|
|
8
8
|
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
9
|
* compiled file, but it's generally better to create a new file per style scope.
|
10
10
|
*
|
11
|
-
*= require ./
|
11
|
+
*= require ./highlight.default
|
12
12
|
*= require ./screen
|
13
13
|
*= require_self
|
14
14
|
*/
|
data/app/assets/stylesheets/grape_swagger_rails/{hightlight.default.css → highlight.default.css}
RENAMED
File without changes
|
@@ -1014,7 +1014,7 @@ table {
|
|
1014
1014
|
font-size: 1.5em;
|
1015
1015
|
font-weight: bold;
|
1016
1016
|
text-decoration: none;
|
1017
|
-
background: transparent url(
|
1017
|
+
background: transparent url(<%= image_path('grape_swagger_rails/logo_small.png') %>) no-repeat left center;
|
1018
1018
|
padding: 20px 0 20px 40px;
|
1019
1019
|
color: white;
|
1020
1020
|
}
|
@@ -16,7 +16,7 @@
|
|
16
16
|
headers: options.headers,
|
17
17
|
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
|
18
18
|
onComplete: function(swaggerApi, swaggerUi){
|
19
|
-
if(console) {
|
19
|
+
if('console' in window) {
|
20
20
|
console.log("Loaded SwaggerUI")
|
21
21
|
console.log(swaggerApi);
|
22
22
|
console.log(swaggerUi);
|
@@ -24,7 +24,7 @@
|
|
24
24
|
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
25
25
|
},
|
26
26
|
onFailure: function(data) {
|
27
|
-
if(console) {
|
27
|
+
if('console' in window) {
|
28
28
|
console.log("Unable to Load SwaggerUI");
|
29
29
|
console.log(data);
|
30
30
|
}
|
@@ -34,12 +34,11 @@
|
|
34
34
|
|
35
35
|
$('#input_apiKey').change(function() {
|
36
36
|
var key = $('#input_apiKey')[0].value;
|
37
|
-
|
37
|
+
|
38
38
|
if(key && key.trim() != "") {
|
39
39
|
if (options.api_auth == 'basic') {
|
40
40
|
key = "Basic " + Base64.encode(key);
|
41
41
|
}
|
42
|
-
console.log("added key " + key);
|
43
42
|
window.authorizations.add("key", new ApiKeyAuthorization(options.api_key_name, key, options.api_key_type));
|
44
43
|
} else {
|
45
44
|
window.authorizations.add("key", null);
|
data/grape-swagger-rails.gemspec
CHANGED
@@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.add_development_dependency 'rake'
|
20
20
|
spec.add_dependency 'railties', '>= 3.2.12'
|
21
21
|
#spec.add_dependency 'rubyzip', '~> 0.9.9'
|
22
|
-
spec.add_dependency 'grape-swagger', '~> 0.
|
22
|
+
spec.add_dependency 'grape-swagger', '~> 0.7.2'
|
23
23
|
end
|
data/lib/grape-swagger-rails.rb
CHANGED
@@ -10,13 +10,17 @@ module GrapeSwaggerRails
|
|
10
10
|
mattr_accessor :options
|
11
11
|
|
12
12
|
self.options = Options.new(
|
13
|
+
|
13
14
|
url: '/swagger_doc.json',
|
14
|
-
api_key_name: 'api_key',
|
15
|
-
api_key_type: 'query',
|
16
|
-
api_auth: '', # 'basic'
|
17
|
-
headers: {},
|
18
15
|
app_name: 'Swagger',
|
19
16
|
app_url: 'http://swagger.wordnik.com',
|
17
|
+
|
18
|
+
headers: {},
|
19
|
+
|
20
|
+
api_auth: '', # 'basic'
|
21
|
+
api_key_name: 'api_key', # 'Authorization'
|
22
|
+
api_key_type: 'query', # 'header'
|
23
|
+
|
20
24
|
authentication_proc: nil # Proc used as a controller before filter that returns a boolean
|
21
25
|
)
|
22
26
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grape-swagger-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aleksandr B. Ivanov
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-02-
|
12
|
+
date: 2014-02-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.
|
62
|
+
version: 0.7.2
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
69
|
+
version: 0.7.2
|
70
70
|
description: grape grape-swagger swagger-ui rails integration
|
71
71
|
email:
|
72
72
|
- radanisk@ya.ru
|
@@ -95,13 +95,13 @@ files:
|
|
95
95
|
- app/assets/javascripts/grape_swagger_rails/jquery.wiggle.min.js
|
96
96
|
- app/assets/javascripts/grape_swagger_rails/shred.bundle.js
|
97
97
|
- app/assets/javascripts/grape_swagger_rails/shred/content.js
|
98
|
-
- app/assets/javascripts/grape_swagger_rails/swagger-ui.js
|
98
|
+
- app/assets/javascripts/grape_swagger_rails/swagger-ui.js.erb
|
99
99
|
- app/assets/javascripts/grape_swagger_rails/swagger-ui.min.js
|
100
100
|
- app/assets/javascripts/grape_swagger_rails/swagger.js
|
101
101
|
- app/assets/javascripts/grape_swagger_rails/underscore-min.js
|
102
102
|
- app/assets/stylesheets/grape_swagger_rails/application.css
|
103
|
-
- app/assets/stylesheets/grape_swagger_rails/
|
104
|
-
- app/assets/stylesheets/grape_swagger_rails/screen.css
|
103
|
+
- app/assets/stylesheets/grape_swagger_rails/highlight.default.css
|
104
|
+
- app/assets/stylesheets/grape_swagger_rails/screen.css.erb
|
105
105
|
- app/controllers/grape_swagger_rails/application_controller.rb
|
106
106
|
- app/views/grape_swagger_rails/application/index.html.erb
|
107
107
|
- config/routes.rb
|