rspec-api-docs 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +3 -0
- data/LICENSE.txt +21 -0
- data/README.md +52 -0
- data/Rakefile +6 -0
- data/bin/setup +7 -0
- data/lib/rspec_api_docs.rb +22 -0
- data/lib/rspec_api_docs/after.rb +10 -0
- data/lib/rspec_api_docs/dsl.rb +27 -0
- data/lib/rspec_api_docs/dsl/doc_proxy.rb +46 -0
- data/lib/rspec_api_docs/dsl/request_store.rb +16 -0
- data/lib/rspec_api_docs/formatter.rb +27 -0
- data/lib/rspec_api_docs/formatter/index_serializer.rb +37 -0
- data/lib/rspec_api_docs/formatter/renderers/json_renderer.rb +34 -0
- data/lib/rspec_api_docs/formatter/resource.rb +130 -0
- data/lib/rspec_api_docs/formatter/resource_serializer.rb +21 -0
- data/lib/rspec_api_docs/version.rb +3 -0
- data/rspec-api-docs.gemspec +29 -0
- metadata +164 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 93a03551851fab62786002d514811191321bcab5
|
4
|
+
data.tar.gz: cbde2ff103792b94141f1bb96092485b78882817
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2789ae22918606ca1d572f8025bd4930540dc097c8a2606c9b28867b12c8d17a2750e77926d381d0e44f5ddef3c7c6d0d652edd076eb4830ecef81b0924f8c0c
|
7
|
+
data.tar.gz: af7acf8f314521c861a9c321be0939a93e6e8eab25e22b61a2a6cc3d4890d4f5f28ed41ac16f642e74b21eb6fd2036c6a6f2b667d116bc8c491fc80e8a74b1c6
|
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
/Gemfile.lock
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at odindutton@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Odin Dutton
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# rspec-api-docs
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'rspec-api-docs'
|
9
|
+
```
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install rspec-api-docs
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
For now see the integration specs.
|
22
|
+
|
23
|
+
```
|
24
|
+
rm -rf spec/integration/output
|
25
|
+
rspec spec/integration/rspec_api_docs_spec.rb --format=RspecApiDocs::Formatter
|
26
|
+
```
|
27
|
+
|
28
|
+
## Development
|
29
|
+
|
30
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
31
|
+
`rake` to run the tests.
|
32
|
+
|
33
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To
|
34
|
+
release a new version, update the version number in `version.rb`, and then run
|
35
|
+
`bundle exec rake release`, which will create a git tag for the version, push
|
36
|
+
git commits and tags, and push the `.gem` file to [rubygems.org].
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
Bug reports and pull requests are welcome on GitHub at
|
41
|
+
https://github.com/twe4ked/rspec-api-docs. This project is intended to be a
|
42
|
+
safe, welcoming space for collaboration, and contributors are expected to
|
43
|
+
adhere to the [Contributor Covenant] code of
|
44
|
+
conduct.
|
45
|
+
|
46
|
+
## License
|
47
|
+
|
48
|
+
The gem is available as open source under the terms of the [MIT License].
|
49
|
+
|
50
|
+
[MIT License]: http://opensource.org/licenses/MIT
|
51
|
+
[Contributor Covenant]: http://contributor-covenant.org
|
52
|
+
[rubygems.org]: https://rubygems.org
|
data/Rakefile
ADDED
data/bin/setup
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'rspec_api_docs/version'
|
2
|
+
|
3
|
+
module RspecApiDocs
|
4
|
+
METADATA_NAMESPACE = :rspec_api_docs
|
5
|
+
|
6
|
+
class << self
|
7
|
+
attr_accessor :configuration
|
8
|
+
end
|
9
|
+
|
10
|
+
def self.configure
|
11
|
+
self.configuration ||= Config.new
|
12
|
+
yield configuration
|
13
|
+
end
|
14
|
+
|
15
|
+
class Config
|
16
|
+
attr_accessor :output_dir
|
17
|
+
|
18
|
+
def initialize
|
19
|
+
@output_dir = 'docs'
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rspec_api_docs'
|
2
|
+
require 'rspec_api_docs/dsl/request_store'
|
3
|
+
require 'rspec_api_docs/dsl/doc_proxy'
|
4
|
+
|
5
|
+
module RspecApiDocs
|
6
|
+
module Dsl
|
7
|
+
def doc(&block)
|
8
|
+
example.metadata[METADATA_NAMESPACE] ||= {}
|
9
|
+
|
10
|
+
if block
|
11
|
+
DocProxy.new(example).instance_eval(&block)
|
12
|
+
end
|
13
|
+
|
14
|
+
RequestStore.new(example)
|
15
|
+
end
|
16
|
+
|
17
|
+
def no_doc
|
18
|
+
example.metadata[METADATA_NAMESPACE] = nil
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def example
|
24
|
+
RSpec.current_example
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module RspecApiDocs
|
2
|
+
module Dsl
|
3
|
+
class DocProxy
|
4
|
+
attr_reader :metadata
|
5
|
+
|
6
|
+
def initialize(example)
|
7
|
+
@metadata = example.metadata
|
8
|
+
end
|
9
|
+
|
10
|
+
def name(value)
|
11
|
+
metadata[METADATA_NAMESPACE][:example_name] = value
|
12
|
+
end
|
13
|
+
|
14
|
+
def resource_name(value)
|
15
|
+
metadata[METADATA_NAMESPACE][:resource_name] = value
|
16
|
+
end
|
17
|
+
|
18
|
+
def description(value)
|
19
|
+
metadata[METADATA_NAMESPACE][:description] = value
|
20
|
+
end
|
21
|
+
|
22
|
+
def path(value)
|
23
|
+
metadata[METADATA_NAMESPACE][:path] = value
|
24
|
+
end
|
25
|
+
|
26
|
+
def field(name, description, scope: [], type: nil)
|
27
|
+
metadata[METADATA_NAMESPACE][:fields] ||= {}
|
28
|
+
metadata[METADATA_NAMESPACE][:fields][name] = {
|
29
|
+
description: description,
|
30
|
+
scope: Array(scope),
|
31
|
+
type: type,
|
32
|
+
}
|
33
|
+
end
|
34
|
+
|
35
|
+
def param(name, description, scope: [], type: nil, required: false)
|
36
|
+
metadata[METADATA_NAMESPACE][:parameters] ||= {}
|
37
|
+
metadata[METADATA_NAMESPACE][:parameters][name] = {
|
38
|
+
description: description,
|
39
|
+
scope: Array(scope),
|
40
|
+
type: type,
|
41
|
+
required: required,
|
42
|
+
}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module RspecApiDocs
|
2
|
+
module Dsl
|
3
|
+
class RequestStore
|
4
|
+
attr_reader :metadata
|
5
|
+
|
6
|
+
def initialize(example)
|
7
|
+
@metadata = example.metadata
|
8
|
+
end
|
9
|
+
|
10
|
+
def <<(value)
|
11
|
+
metadata[METADATA_NAMESPACE][:requests] ||= []
|
12
|
+
metadata[METADATA_NAMESPACE][:requests] << value.sort_by { |v| v.class.name }.reverse
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rspec/core/formatters/base_formatter'
|
2
|
+
require 'json'
|
3
|
+
|
4
|
+
require 'rspec_api_docs/formatter/resource'
|
5
|
+
require 'rspec_api_docs/formatter/renderers/json_renderer'
|
6
|
+
|
7
|
+
module RspecApiDocs
|
8
|
+
class Formatter < RSpec::Core::Formatters::BaseFormatter
|
9
|
+
RSpec::Core::Formatters.register self, :example_passed, :close
|
10
|
+
|
11
|
+
attr_reader :resources
|
12
|
+
|
13
|
+
def initialize(*args)
|
14
|
+
@resources = []
|
15
|
+
super args
|
16
|
+
end
|
17
|
+
|
18
|
+
def example_passed(example_notification)
|
19
|
+
return unless example_notification.example.metadata[METADATA_NAMESPACE]
|
20
|
+
resources << Resource.new(example_notification.example)
|
21
|
+
end
|
22
|
+
|
23
|
+
def close(null_notification)
|
24
|
+
JSONRender.new(resources).render
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class IndexSerializer
|
2
|
+
class ResourceSerializer
|
3
|
+
attr_reader :resource
|
4
|
+
|
5
|
+
def initialize(resource)
|
6
|
+
@resource = resource
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_h
|
10
|
+
{
|
11
|
+
description: resource.example_name,
|
12
|
+
link: resource.link,
|
13
|
+
groups: resource.groups,
|
14
|
+
route: resource.path,
|
15
|
+
method: resource.http_method.downcase,
|
16
|
+
}
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
attr_reader :resources
|
21
|
+
|
22
|
+
def initialize(resources)
|
23
|
+
@resources = resources.group_by(&:name)
|
24
|
+
end
|
25
|
+
|
26
|
+
def to_h
|
27
|
+
{
|
28
|
+
resources: resources.map do |name, examples|
|
29
|
+
{
|
30
|
+
name: name,
|
31
|
+
explanation: nil,
|
32
|
+
examples: examples.map { |resource| ResourceSerializer.new(resource).to_h },
|
33
|
+
}
|
34
|
+
end
|
35
|
+
}
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rspec_api_docs/formatter/index_serializer'
|
2
|
+
require 'rspec_api_docs/formatter/resource_serializer'
|
3
|
+
|
4
|
+
module RspecApiDocs
|
5
|
+
class JSONRender
|
6
|
+
attr_reader :resources
|
7
|
+
|
8
|
+
def initialize(resources)
|
9
|
+
@resources = resources
|
10
|
+
end
|
11
|
+
|
12
|
+
def render
|
13
|
+
FileUtils.mkdir_p output_dir
|
14
|
+
|
15
|
+
File.open(output_dir + 'index.json', 'w') do |f|
|
16
|
+
f.write JSON.pretty_generate(IndexSerializer.new(resources).to_h) + "\n"
|
17
|
+
end
|
18
|
+
|
19
|
+
resources.each do |resource|
|
20
|
+
FileUtils.mkdir_p output_dir + Pathname.new(resource.link).dirname
|
21
|
+
|
22
|
+
File.open(output_dir + resource.link, 'w') do |f|
|
23
|
+
f.write JSON.pretty_generate(ResourceSerializer.new(resource).to_h) + "\n"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def output_dir
|
31
|
+
Pathname.new RspecApiDocs.configuration.output_dir
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
require 'active_support/inflector'
|
2
|
+
|
3
|
+
module RspecApiDocs
|
4
|
+
class Resource
|
5
|
+
attr_reader :example
|
6
|
+
|
7
|
+
def initialize(example)
|
8
|
+
@example = example
|
9
|
+
end
|
10
|
+
|
11
|
+
def name
|
12
|
+
metadata.fetch(:resource_name, example.metadata[:example_group][:description])
|
13
|
+
end
|
14
|
+
|
15
|
+
def example_name
|
16
|
+
metadata.fetch(:example_name, example.description)
|
17
|
+
end
|
18
|
+
|
19
|
+
def description
|
20
|
+
metadata[:description]
|
21
|
+
end
|
22
|
+
|
23
|
+
def parameters
|
24
|
+
metadata.fetch(:parameters, []).map do |name, field|
|
25
|
+
result = {}
|
26
|
+
result[:required] = true if field[:required]
|
27
|
+
result[:scope] = field[:scope].join unless field[:scope].empty?
|
28
|
+
result = result.merge(
|
29
|
+
name: name,
|
30
|
+
description: field[:description],
|
31
|
+
)
|
32
|
+
result
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def response_fields
|
37
|
+
metadata.fetch(:fields, []).map do |name, field|
|
38
|
+
{
|
39
|
+
scope: field[:scope].join,
|
40
|
+
Type: field[:type],
|
41
|
+
name: name,
|
42
|
+
description: field[:description],
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def requests
|
48
|
+
reqs = metadata.fetch(:requests, []).reject { |x| x.any?(&:nil?) }
|
49
|
+
reqs.map do |request, response|
|
50
|
+
{
|
51
|
+
request_method: request.request_method,
|
52
|
+
request_path: request_path(request),
|
53
|
+
request_body: request_body(request.body),
|
54
|
+
request_headers: request_headers(request.env),
|
55
|
+
request_query_parameters: request.params,
|
56
|
+
request_content_type: request.content_type,
|
57
|
+
response_status: response.status,
|
58
|
+
response_status_text: response_status_text(response.status),
|
59
|
+
response_body: response_body(response.body),
|
60
|
+
response_headers: response.headers,
|
61
|
+
response_content_type: response.content_type,
|
62
|
+
curl: curl,
|
63
|
+
}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# NOTE: returns the first route requested
|
68
|
+
def path
|
69
|
+
metadata.fetch(:path) do
|
70
|
+
reqs = metadata.fetch(:requests, []).reject { |x| x.any?(&:nil?) }
|
71
|
+
return if reqs.empty?
|
72
|
+
reqs.first.first.path
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
# NOTE: returns the first HTTP method used
|
77
|
+
def http_method
|
78
|
+
reqs = metadata.fetch(:requests, []).reject { |x| x.any?(&:nil?) }
|
79
|
+
return if reqs.empty?
|
80
|
+
reqs.first.first.request_method
|
81
|
+
end
|
82
|
+
|
83
|
+
def link
|
84
|
+
"#{name.downcase}/#{example_name.parameterize.underscore}.json"
|
85
|
+
end
|
86
|
+
|
87
|
+
def groups
|
88
|
+
'all'
|
89
|
+
end
|
90
|
+
|
91
|
+
private
|
92
|
+
|
93
|
+
# http://stackoverflow.com/a/33235714/826820
|
94
|
+
def request_headers(env)
|
95
|
+
Hash[
|
96
|
+
*env.select { |k,v| k.start_with? 'HTTP_' }
|
97
|
+
.collect { |k,v| [k.sub(/^HTTP_/, ''), v] }
|
98
|
+
.collect { |k,v| [k.split('_').collect(&:capitalize).join('-'), v] }
|
99
|
+
.sort.flatten
|
100
|
+
]
|
101
|
+
end
|
102
|
+
|
103
|
+
def request_path(request)
|
104
|
+
URI(request.path).tap do |uri|
|
105
|
+
uri.query = request.query_string unless request.query_string.empty?
|
106
|
+
end.to_s
|
107
|
+
end
|
108
|
+
|
109
|
+
def request_body(body)
|
110
|
+
body = body.read
|
111
|
+
body.empty? ? nil : body
|
112
|
+
end
|
113
|
+
|
114
|
+
def response_body(body)
|
115
|
+
body.empty? ? nil : body
|
116
|
+
end
|
117
|
+
|
118
|
+
def response_status_text(status)
|
119
|
+
Rack::Utils::HTTP_STATUS_CODES[status]
|
120
|
+
end
|
121
|
+
|
122
|
+
# TODO
|
123
|
+
def curl
|
124
|
+
end
|
125
|
+
|
126
|
+
def metadata
|
127
|
+
example.metadata[METADATA_NAMESPACE]
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class ResourceSerializer
|
2
|
+
attr_reader :resource
|
3
|
+
|
4
|
+
def initialize(resource)
|
5
|
+
@resource = resource
|
6
|
+
end
|
7
|
+
|
8
|
+
def to_h
|
9
|
+
{
|
10
|
+
resource: resource.name,
|
11
|
+
resource_explanation: nil,
|
12
|
+
http_method: resource.http_method,
|
13
|
+
route: resource.path,
|
14
|
+
description: resource.example_name,
|
15
|
+
explanation: resource.description,
|
16
|
+
parameters: resource.parameters,
|
17
|
+
response_fields: resource.response_fields,
|
18
|
+
requests: resource.requests,
|
19
|
+
}
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'rspec_api_docs/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'rspec-api-docs'
|
8
|
+
spec.version = RspecApiDocs::VERSION
|
9
|
+
spec.authors = ['Odin Dutton']
|
10
|
+
spec.email = ['odindutton@gmail.com']
|
11
|
+
|
12
|
+
spec.summary = 'Generate API documentation using RSpec'
|
13
|
+
spec.homepage = 'https://github.com/twe4ked'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
17
|
+
spec.bindir = 'bin'
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.require_paths = ['lib']
|
20
|
+
|
21
|
+
spec.add_dependency 'activesupport'
|
22
|
+
|
23
|
+
spec.add_development_dependency 'bundler', '~> 1.13'
|
24
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
26
|
+
spec.add_development_dependency 'pry'
|
27
|
+
spec.add_development_dependency 'rack-test'
|
28
|
+
spec.add_development_dependency 'sinatra', '2.0.0.beta2'
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,164 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rspec-api-docs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Odin Dutton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.13'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.13'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '10.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: pry
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rack-test
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: sinatra
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 2.0.0.beta2
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 2.0.0.beta2
|
111
|
+
description:
|
112
|
+
email:
|
113
|
+
- odindutton@gmail.com
|
114
|
+
executables:
|
115
|
+
- setup
|
116
|
+
extensions: []
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
119
|
+
- ".gitignore"
|
120
|
+
- ".rspec"
|
121
|
+
- ".travis.yml"
|
122
|
+
- CODE_OF_CONDUCT.md
|
123
|
+
- Gemfile
|
124
|
+
- LICENSE.txt
|
125
|
+
- README.md
|
126
|
+
- Rakefile
|
127
|
+
- bin/setup
|
128
|
+
- lib/rspec_api_docs.rb
|
129
|
+
- lib/rspec_api_docs/after.rb
|
130
|
+
- lib/rspec_api_docs/dsl.rb
|
131
|
+
- lib/rspec_api_docs/dsl/doc_proxy.rb
|
132
|
+
- lib/rspec_api_docs/dsl/request_store.rb
|
133
|
+
- lib/rspec_api_docs/formatter.rb
|
134
|
+
- lib/rspec_api_docs/formatter/index_serializer.rb
|
135
|
+
- lib/rspec_api_docs/formatter/renderers/json_renderer.rb
|
136
|
+
- lib/rspec_api_docs/formatter/resource.rb
|
137
|
+
- lib/rspec_api_docs/formatter/resource_serializer.rb
|
138
|
+
- lib/rspec_api_docs/version.rb
|
139
|
+
- rspec-api-docs.gemspec
|
140
|
+
homepage: https://github.com/twe4ked
|
141
|
+
licenses:
|
142
|
+
- MIT
|
143
|
+
metadata: {}
|
144
|
+
post_install_message:
|
145
|
+
rdoc_options: []
|
146
|
+
require_paths:
|
147
|
+
- lib
|
148
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
153
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - ">="
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
requirements: []
|
159
|
+
rubyforge_project:
|
160
|
+
rubygems_version: 2.5.1
|
161
|
+
signing_key:
|
162
|
+
specification_version: 4
|
163
|
+
summary: Generate API documentation using RSpec
|
164
|
+
test_files: []
|