rspec-api-docs 0.5.0 → 0.6.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: e7e5799e512fca99e136a0909ba2118a90d96073
4
- data.tar.gz: 48de8b3f91fa45947fc1903fe25b0e4b8351aa93
3
+ metadata.gz: 45bd45a0a13f8512cf26c3406b17a461de6a6844
4
+ data.tar.gz: 545d0fe44c9de8c1a33c3fe5285fb716ea611ee2
5
5
  SHA512:
6
- metadata.gz: adac7650aa8fbd77ae177ec13eb55173818a0c48cf725795bbc0fa8821a98c7e9b375cc3418b0df1b668cd508cdad26c83b39e578c1ba76d2400235cbc7478e5
7
- data.tar.gz: 12f01cf8d991c15c98b5d05b9a452f0ea2e915049160337b8ef5ef39510b356af4ece8d43096aa80cdb2935e564f4394ca06599269c3fd5115e0efdac551f74f
6
+ metadata.gz: 4e2cd0a674337ac2e8683d5f9116a85f5bf01726482fd9300173653cd643ce3ae772edc6499dab21e62d701a9d2e6debcb706c5c4619b34c98283cf7ed8fcb4d
7
+ data.tar.gz: 30877036d873b254345a13678b9f339c4c2972876e3b5e76de3dd0a6aed946a7347c63cd70b29417b5b50e588ab9b8510f951d74bd2feb746f2bdd6fcb602e62
data/README.md CHANGED
@@ -8,6 +8,15 @@
8
8
  <a href="http://www.rubydoc.info/github/twe4ked/rspec-api-docs/master"><img src="https://img.shields.io/badge/docs-master-lightgrey.svg?style=flat-square" /></a>
9
9
  </p>
10
10
 
11
+ **rspec-api-docs** provides a way to generate documentation from your request
12
+ specs. It does this by providing a simple DSL and a custom formatter.
13
+
14
+ The default renderer produces a [single JSON file] which can be used by
15
+ [api-docs] to [display your documentation].
16
+
17
+ [single JSON file]: ./spec/integration/output/json/index.json
18
+ [display your documentation]: https://twe4ked.github.io/api-docs/
19
+
11
20
  ## Installation
12
21
 
13
22
  Add this line to your application's Gemfile:
@@ -265,6 +274,7 @@ $ ./bin/generate_integration_docs
265
274
  ## TODO
266
275
 
267
276
  - Allow specifying an order (`precedence`?)
277
+ - Order Resources and Examples alphabetically
268
278
 
269
279
  ## Contributing
270
280
 
@@ -281,3 +291,4 @@ The gem is available as open source under the terms of the [MIT License].
281
291
  [MIT License]: http://opensource.org/licenses/MIT
282
292
  [Contributor Covenant]: http://contributor-covenant.org
283
293
  [rubygems.org]: https://rubygems.org
294
+ [api-docs]: https://github.com/twe4ked/api-docs
@@ -17,12 +17,14 @@ module RspecApiDocs
17
17
  attr_accessor \
18
18
  :output_dir,
19
19
  :renderer,
20
- :validate_params
20
+ :validate_params,
21
+ :exclude_request_headers
21
22
 
22
23
  def initialize
23
24
  @output_dir = 'docs'
24
25
  @renderer = :json
25
26
  @validate_params = true
27
+ @exclude_request_headers = []
26
28
  end
27
29
  end
28
30
  end
@@ -95,12 +95,17 @@ module RspecApiDocs
95
95
 
96
96
  # http://stackoverflow.com/a/33235714/826820
97
97
  def request_headers(env)
98
- Hash[
98
+ headers = Hash[
99
99
  *env.select { |k,v| k.start_with? 'HTTP_' }
100
100
  .collect { |k,v| [k.sub(/^HTTP_/, ''), v] }
101
101
  .collect { |k,v| [k.split('_').collect(&:capitalize).join('-'), v] }
102
102
  .sort.flatten
103
103
  ]
104
+
105
+ # TODO: Extract, test, and document
106
+ headers.reject do |k, v|
107
+ RspecApiDocs.configuration.exclude_request_headers.include?(k)
108
+ end
104
109
  end
105
110
 
106
111
  def request_path(request)
@@ -1,3 +1,3 @@
1
1
  module RspecApiDocs
2
- VERSION = '0.5.0'
2
+ VERSION = '0.6.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-api-docs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Odin Dutton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-02 00:00:00.000000000 Z
11
+ date: 2017-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.5.1
176
+ rubygems_version: 2.5.2
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: Generate API documentation using RSpec