swagui 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +34 -12
- data/lib/swagui/version.rb +1 -1
- data/swagui.gemspec +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3ccf570fcfda9ff6511b51eb648fbbc755f52d3
|
4
|
+
data.tar.gz: 7ab5f29ba3149173f93436f0bb35cf25e7f74eb6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06bc77a2629bf87c800fa8ad40b4886708aee79e5afb14612c1e057dfa3ed3ce800f301be6a9498833a9a06710b74dd1971bd551be9c434f9c59d257c2adef35
|
7
|
+
data.tar.gz: 807ecbe969430ba4d9baa91cd128d19851c3acf17fb9b81ce4de3df341e0e10bab0088f7d62c670c37a64e96785716d437b20f17b9e8ff87000701c300d389f8
|
data/README.md
CHANGED
@@ -1,28 +1,50 @@
|
|
1
|
-
#
|
1
|
+
# Swigui
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
## Installation
|
3
|
+
a Rack middleware app and a command-line utility that helps you render [swagger-ui], a great api documentation tool, with ease and grace.
|
6
4
|
|
5
|
+
## Install
|
7
6
|
Add this line to your application's Gemfile:
|
8
7
|
|
9
|
-
|
8
|
+
```ruby
|
9
|
+
group :development do
|
10
|
+
gem 'swagui'
|
11
|
+
end
|
12
|
+
```
|
10
13
|
|
11
|
-
|
14
|
+
## Usage
|
12
15
|
|
13
|
-
|
16
|
+
### Rack middleware
|
14
17
|
|
15
|
-
|
18
|
+
In your `application.rb` (for Rails app) or `config.ru` (for Rack app), add Swigui middleware close to the top of the middleware stack. For example, in a `config.ru` file, add the following line:
|
16
19
|
|
17
|
-
|
20
|
+
```ruby
|
21
|
+
if Rack.env == 'development'
|
22
|
+
use Swagui::Middleware, url: '/doc', path: 'doc'
|
23
|
+
end
|
24
|
+
```
|
18
25
|
|
19
|
-
|
26
|
+
* `url`: the url path to access the [swagger-ui].
|
27
|
+
* `path`: the sub-directory name where the swagger files are stored. It assumes that `api-docs` is the index file in the directory.
|
28
|
+
|
29
|
+
You will be able to access the [swagger-ui] loaded with your api documentation at `/doc` (your `url` setting) when the server starts.
|
30
|
+
|
31
|
+
### Command-line utility
|
32
|
+
|
33
|
+
Sometimes, you only want to see the documentation without starting the entire application. All you need to do is to run the following command in your documentation directory:
|
34
|
+
|
35
|
+
$ bundle exec swagui
|
36
|
+
|
37
|
+
optionally, you can specify the directory name as a command line argument:
|
38
|
+
|
39
|
+
$ bundle exec swagui doc
|
40
|
+
|
41
|
+
You will then able to view the [swagger-ui] loaded with your api documentation at `http://localhost:9292`
|
20
42
|
|
21
|
-
|
43
|
+
[swagger-ui]: https://github.com/wordnik/swagger-ui
|
22
44
|
|
23
45
|
## Contributing
|
24
46
|
|
25
|
-
1. Fork it ( https://github.com/
|
47
|
+
1. Fork it ( https://github.com/jackxxu/swagui/fork )
|
26
48
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
49
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
50
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/lib/swagui/version.rb
CHANGED
data/swagui.gemspec
CHANGED
@@ -7,9 +7,9 @@ Gem::Specification.new do |spec|
|
|
7
7
|
spec.name = "swagui"
|
8
8
|
spec.version = Swagui::VERSION
|
9
9
|
spec.authors = ["Jack Xu"]
|
10
|
-
spec.email = ["
|
11
|
-
spec.summary = %q{A rack-based swagger-ui middleware and utility.}
|
12
|
-
spec.homepage = ""
|
10
|
+
spec.email = ["jackxxu@gmail.com"]
|
11
|
+
spec.summary = %q{A rack-based swagger-ui middleware and commandline utility.}
|
12
|
+
spec.homepage = "https://github.com/jackxxu/swagui"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
15
15
|
spec.files = `git ls-files -z`.split("\x0")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: swagui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Xu
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
type: :development
|
41
41
|
description:
|
42
42
|
email:
|
43
|
-
-
|
43
|
+
- jackxxu@gmail.com
|
44
44
|
executables:
|
45
45
|
- swagui
|
46
46
|
extensions: []
|
@@ -79,7 +79,7 @@ files:
|
|
79
79
|
- swagger-ui/swagger-ui.js
|
80
80
|
- swagger-ui/swagger-ui.min.js
|
81
81
|
- swagui.gemspec
|
82
|
-
homepage:
|
82
|
+
homepage: https://github.com/jackxxu/swagui
|
83
83
|
licenses:
|
84
84
|
- MIT
|
85
85
|
metadata: {}
|
@@ -102,5 +102,5 @@ rubyforge_project:
|
|
102
102
|
rubygems_version: 2.2.2
|
103
103
|
signing_key:
|
104
104
|
specification_version: 4
|
105
|
-
summary: A rack-based swagger-ui middleware and utility.
|
105
|
+
summary: A rack-based swagger-ui middleware and commandline utility.
|
106
106
|
test_files: []
|