swaggard 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b13f4f6f8c7324e18b0e4180029447daff4ffbcb
4
- data.tar.gz: 1c4b98467108320e6fafe0fc68268f918bbfe0e0
3
+ metadata.gz: beffa494b9022810c72e6b0dd874d2fb026397f1
4
+ data.tar.gz: 51cab140b398a107e4b309a6ffd1853a6e499f38
5
5
  SHA512:
6
- metadata.gz: 1255f1af2553ffddcb1b1d9cd639a65ca6aee976e282f5ef41b642fc37ddca1400c6d754186e68558b0513adcb80982f7847e2ae9dbc60f1eb924b12129805ac
7
- data.tar.gz: 7310f3d084ed6f071fe8a793cfb363ead0ec2651b599ade59ff2a1ebf33e1554828bf30343376ca5703a4275f27e79a3029f48150090cadbd25b738a900c5618
6
+ metadata.gz: e2fb323356636d66bacc03e42a922dfd49c69e3befbfc2788a32294b77c96b3408a0d2ebb94bcf218b32952440e18b0cb75ae25789b993cb9d3950953edd134e
7
+ data.tar.gz: 2f941a8e01954f8858101cb3ae9c4e0dfb810c41fbfa5d2dc84b340993b1e7c80da17a63904450fafd78fa956f9f28cfd4c94c1bc25615e8b7610f9120c4ffdc
data/README.md CHANGED
@@ -1,23 +1,24 @@
1
1
  Swaggard
2
2
  ========
3
3
 
4
- Swaggard is a Rails Engine that can be used to document a REST api. It does this by generating a
5
- json that is compliant with [Swagger](http://swagger.io) and displaying it using [Swagger-ui](https://github.com/wordnik/swagger-ui).
4
+ Swaggard is a Rails Engine that can be used to document a REST api. It does this by generating a json that is compliant with [Swagger](http://swagger.io) and displaying it using [Swagger-ui](https://github.com/wordnik/swagger-ui).
6
5
  This gem is inspired and based on [SwaggerYard](https://github.com/synctv/swagger_yard) by [Chris Trinh](https://github.com/chtrinh).
7
6
 
8
- Swagger UI versions
9
- -----------------------
10
- This table tracks the version of Swagger UI used on each Swaggard version:
11
-
12
- Swaggard Version | Swagger UI Version
13
- ---------------- | ------------------
14
- 0.4.0 | 2.2.8
15
- 0.3.0 | 2.1.3
16
- 0.2.1 | 2.1.3
17
- 0.2.0 | 2.1.3
18
- 0.1.1 | 2.1.3
19
- 0.1.0 | 2.1.3
20
- 0.0.4 | 2.1.8-M1
7
+ Compatibility
8
+ -------------
9
+ This table tracks the version of Swagger UI used on each Swaggard version and
10
+ the supported rails version.
11
+
12
+ Swaggard Version | Swagger UI Version | Supported Rails Versions
13
+ ---------------- | -------------------| ------------------------
14
+ 0.5.0 | 2.2.8 | 4 - 5
15
+ 0.4.0 | 2.2.8 | 4
16
+ 0.3.0 | 2.1.3 | 4
17
+ 0.2.1 | 2.1.3 | 4
18
+ 0.2.0 | 2.1.3 | 4
19
+ 0.1.1 | 2.1.3 | 4
20
+ 0.1.0 | 2.1.3 | 4
21
+ 0.0.4 | 2.1.8-M1 | 4
21
22
 
22
23
  Swaggard vs SwaggerYard
23
24
  -----------------------
@@ -207,7 +208,7 @@ If you not set `access_username`, everyone will have access to Swagger documenta
207
208
  Additional parameters
208
209
  --------------
209
210
 
210
- Swaggard additional parameters to be sent on every request, either as a header or as part of the query.
211
+ Swaggard supports additional parameters to be sent on every request, either as a header or as part of the query.
211
212
 
212
213
  You can configure it as follows:
213
214
 
@@ -1,7 +1,7 @@
1
1
  module Swaggard
2
2
  class SwaggerController < ApplicationController
3
3
 
4
- before_filter :authorize
4
+ before_action :authorize
5
5
 
6
6
  def index
7
7
  respond_to do |format|
@@ -43,4 +43,4 @@ module Swaggard
43
43
  end
44
44
 
45
45
  end
46
- end
46
+ end
@@ -6,8 +6,8 @@
6
6
  <%= favicon_link_tag 'swaggard/favicon-32x32.png', sizes: '32x32' %>
7
7
  <%= favicon_link_tag 'swaggard/favicon-16x16.png', sizes: '16x16' %>
8
8
 
9
- <%= stylesheet_link_tag 'swaggard/application', media: :screen %>
10
- <%= stylesheet_link_tag 'swaggard/application_print', media: :print %>
9
+ <%= stylesheet_link_tag 'swaggard/application', media: :screen %>
10
+ <%= stylesheet_link_tag 'swaggard/application_print', media: :print %>
11
11
 
12
12
  <%= javascript_include_tag 'swaggard/application' %>
13
13
  <%= javascript_include_tag "swaggard/lang/#{Swaggard.configuration.language}" %>
@@ -1,2 +1,5 @@
1
- Rails.application.config.assets.precompile += %w[swaggard/application_print.css]
2
- Rails.application.config.assets.precompile += %w[swaggard/lang/*.js]
1
+ Rails.application.config.assets.precompile += %w[swaggard/application_print.css
2
+ swaggard/favicon-32x32.png
3
+ swaggard/favicon-16x16.png
4
+ swaggard/lang/*.js
5
+ swaggard/logo_small.png]
@@ -19,7 +19,7 @@ module Swaggard
19
19
  :description, :tos, :contact_email, :contact_name, :contact_url, :host,
20
20
  :authentication_type, :authentication_key, :authentication_value,
21
21
  :access_username, :access_password, :default_content_type, :use_cache, :module_name,
22
- :language, :additional_parameters
22
+ :language, :additional_parameters, :schemes
23
23
 
24
24
  def swagger_version
25
25
  @swagger_version ||= '2.0'
@@ -1,8 +1,17 @@
1
+ unless Rails::Application.instance_methods.include?(:assets_manifest)
2
+ warn <<-END
3
+ [Swaggard] It seems you are using an api only rails setup but swaggard
4
+ [Swaggard] neeeds sprockets in order to work. This might have undesired side effects,
5
+ [Swaggard] if thats not the case you can ignore this warning.
6
+ END
7
+ require 'sprockets/railtie'
8
+ end
9
+
1
10
  module Swaggard
2
11
  class Engine < ::Rails::Engine
3
12
  isolate_namespace Swaggard
4
13
 
5
- initializer 'swaggard.finisher_hook', :after => :finisher_hook do |app|
14
+ initializer 'swaggard.finisher_hook', after: :finisher_hook do |app|
6
15
  app.reload_routes!
7
16
 
8
17
  Swaggard.configure do |config|
@@ -21,4 +30,4 @@ module Swaggard
21
30
  end
22
31
 
23
32
  end
24
- end
33
+ end
@@ -33,7 +33,10 @@ module Swaggard
33
33
  end
34
34
 
35
35
  def route_verb(route)
36
- route.verb.source.gsub(/[$^]/, '')
36
+ verb = route.verb
37
+ verb = route.verb.source unless verb.is_a?(String)
38
+
39
+ verb.gsub(/[$^]/, '')
37
40
  end
38
41
 
39
42
  def route_path(route)
@@ -51,4 +54,4 @@ module Swaggard
51
54
 
52
55
  end
53
56
  end
54
- end
57
+ end
@@ -1,5 +1,5 @@
1
1
  module Swaggard
2
2
 
3
- VERSION = '0.4.0'
3
+ VERSION = '0.5.0'
4
4
 
5
5
  end
@@ -12,4 +12,4 @@ module Dummy
12
12
  end
13
13
  end
14
14
 
15
- Dummy::Application.initialize!
15
+ Dummy::Application.initialize!
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: swaggard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Gomez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-11-29 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '4.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '6.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
25
28
  - !ruby/object:Gem::Version
26
29
  version: '4.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '6.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: sass-rails
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -96,7 +102,7 @@ dependencies:
96
102
  version: '0'
97
103
  description: Generate swagger documentation for your Rails REST API using YARD
98
104
  email:
99
- - adrian.gomez@moove-it.com
105
+ - adri4n.steam@gmail.com
100
106
  executables: []
101
107
  extensions: []
102
108
  extra_rdoc_files: []
@@ -188,7 +194,7 @@ files:
188
194
  - spec/fixtures/swagger_schema.json
189
195
  - spec/integration/swaggard_spec.rb
190
196
  - spec/spec_helper.rb
191
- homepage: https://github.com/Moove-it/swaggard
197
+ homepage: https://github.com/adrian-gomez/swaggard
192
198
  licenses:
193
199
  - MIT
194
200
  metadata: {}