easy_swagger_ui 0.1.1 → 0.1.2

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: fb69bf4054ea2258df60e3bad3c85a706a053833
4
- data.tar.gz: dfe40a699efc3003da6d41be36c9e7f3b1e9acc1
3
+ metadata.gz: e90ab29f418dd69dc1737be17ff10afa828df33c
4
+ data.tar.gz: da13944d26fe609c1e4bafaaa412c6abe7493a72
5
5
  SHA512:
6
- metadata.gz: 235135a74376c13f3f14f97410db0a13fc4dd4aa45ba1d069f46f940cdade3bf7b8242a52b7ed9cf29efbb65ce619bf21186fe27a880d9dc85ca8bce57c8a37b
7
- data.tar.gz: d675885f1618286fa70c2558c9011972f1f7c21758ac5a15b8a3d977c3ee6df45b3f14deacf91fead54cb37d49f4ce08bf4bd29445faa290a7c36ab01c504877
6
+ metadata.gz: 15068018a03fc497126d370b6ce6aeadb74e33acebab31f7710d363a5a51e9c46180defe4be260c95a2f24bd58437d89124f13984c1e9c03ca263a5ae65926ef
7
+ data.tar.gz: 0a1078ea03dfa01f5d631167371bfe5666d450798c6561c5e219dd6d3a45114b9df736b386b68be9b2ac46a5438973853f93b53c8c07f217f19ee53131806904
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 0.1.2
6
+
7
+ * Fix routing error when docs are not in sub directories of `EasySwaggerUi.base_path`
8
+ * Add support for [Sprockets](https://github.com/rails/sprockets) >= 4
9
+
5
10
  ## 0.1.1
6
11
 
7
12
  * Fix checking whether an asset exists in production environment
data/README.md CHANGED
@@ -6,6 +6,8 @@ Test against Rails 5.x. Should also work with Rails 4.2.x.
6
6
 
7
7
  Swagger UI version: 2.2.10. Accessible by in `EasySwaggerUi::SWAGGER_UI_VERSION`.
8
8
 
9
+ [![Build Status](https://travis-ci.org/bianjp/easy_swagger_ui.svg?branch=master)](https://travis-ci.org/bianjp/easy_swagger_ui) [![Gem Version](https://badge.fury.io/rb/easy_swagger_ui.svg)](https://badge.fury.io/rb/easy_swagger_ui) [![Dependency Status](https://gemnasium.com/badges/github.com/bianjp/easy_swagger_ui.svg)](https://gemnasium.com/github.com/bianjp/easy_swagger_ui) [![Code Climate](https://lima.codeclimate.com/github/bianjp/easy_swagger_ui/badges/gpa.svg)](https://lima.codeclimate.com/github/bianjp/easy_swagger_ui)
10
+
9
11
  ## Features
10
12
 
11
13
  * Parse API documentation in YAML files and serve as JSON to be consumed by Swagger UI
@@ -34,7 +36,7 @@ Mount it in `config/routes.rb`:
34
36
 
35
37
  ```
36
38
  # Change the mount point as you like
37
- mount EasySwaggerUi::Engine => '/docs'
39
+ mount EasySwaggerUi::Engine => 'docs'
38
40
  ```
39
41
 
40
42
  ### Write your API documentation
@@ -1,7 +1,11 @@
1
- Rails.application.config.assets.precompile += %w(
2
- easy_swagger_ui/*.png
3
- easy_swagger_ui/*.gif
4
- easy_swagger_ui/*.jpg
5
- easy_swagger_ui/print.css
6
- easy_swagger_ui/lang/*.js
7
- )
1
+ if Gem::Version.new(Sprockets::VERSION) >= Gem::Version.new('4.x')
2
+ Rails.application.config.assets.precompile += %w(easy_swagger_ui_manifest.js)
3
+ else
4
+ Rails.application.config.assets.precompile += %w(
5
+ easy_swagger_ui/*.png
6
+ easy_swagger_ui/*.gif
7
+ easy_swagger_ui/*.jpg
8
+ easy_swagger_ui/print.css
9
+ easy_swagger_ui/lang/*.js
10
+ )
11
+ end
data/config/routes.rb CHANGED
@@ -2,6 +2,10 @@ EasySwaggerUi::Engine.routes.draw do
2
2
  get 'oauth2', to: 'swagger#oauth2', format: false
3
3
 
4
4
  constraints(EasySwaggerUi::RouteMatcher) do
5
+ get '/', to: 'swagger#view', format: false, doc_path: ''
6
+ get '.json', to: 'swagger#spec', format: false, doc_path: ''
7
+
8
+ # when docs are in sub directories
5
9
  get '*doc_path', to: 'swagger#view', format: false, as: 'view'
6
10
  get '*doc_path.json', to: 'swagger#spec', format: false, as: 'spec'
7
11
  end
@@ -1,4 +1,4 @@
1
1
  module EasySwaggerUi
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  SWAGGER_UI_VERSION = '2.2.10'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: easy_swagger_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bian Jiaping
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-12 00:00:00.000000000 Z
11
+ date: 2017-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails