swagui 0.0.3 → 0.0.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17ed2bd9763980dda2fa4c312a8d2f71d0c4c487
4
- data.tar.gz: 73e41032b485a0dc82fc50c3e6f51f05524d8d0a
3
+ metadata.gz: f3ccf570fcfda9ff6511b51eb648fbbc755f52d3
4
+ data.tar.gz: 7ab5f29ba3149173f93436f0bb35cf25e7f74eb6
5
5
  SHA512:
6
- metadata.gz: a46f621183573241215acbd6814333e23cf784c52183ca4f19045ebacc73cf042cf54ae196fc53df0d53d07cff547365fa2d65efa91e1cb85d89a91d149b3717
7
- data.tar.gz: b9751810860da1f9b20e89489593b4022ba6e92bc9d81387d5aa111fae42b9d46b49f2828ce4599ae4f8c57f57fe68d627a0db01ac0c3f5e58b72a87a46806a7
6
+ metadata.gz: 06bc77a2629bf87c800fa8ad40b4886708aee79e5afb14612c1e057dfa3ed3ce800f301be6a9498833a9a06710b74dd1971bd551be9c434f9c59d257c2adef35
7
+ data.tar.gz: 807ecbe969430ba4d9baa91cd128d19851c3acf17fb9b81ce4de3df341e0e10bab0088f7d62c670c37a64e96785716d437b20f17b9e8ff87000701c300d389f8
data/README.md CHANGED
@@ -1,28 +1,50 @@
1
- # Swagui
1
+ # Swigui
2
2
 
3
- TODO: Write a gem description
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
- gem 'swagui'
8
+ ```ruby
9
+ group :development do
10
+ gem 'swagui'
11
+ end
12
+ ```
10
13
 
11
- And then execute:
14
+ ## Usage
12
15
 
13
- $ bundle
16
+ ### Rack middleware
14
17
 
15
- Or install it yourself as:
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
- $ gem install swagui
20
+ ```ruby
21
+ if Rack.env == 'development'
22
+ use Swagui::Middleware, url: '/doc', path: 'doc'
23
+ end
24
+ ```
18
25
 
19
- ## Usage
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
- TODO: Write usage instructions here
43
+ [swagger-ui]: https://github.com/wordnik/swagger-ui
22
44
 
23
45
  ## Contributing
24
46
 
25
- 1. Fork it ( https://github.com/[my-github-username]/swagui/fork )
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`)
@@ -1,3 +1,3 @@
1
1
  module Swagui
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
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 = ["jack.xu@sungard.com"]
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.3
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
- - jack.xu@sungard.com
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: []