autodoc 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/Gemfile +1 -0
- data/README.md +6 -0
- data/lib/autodoc/document.rb +16 -2
- data/lib/autodoc/version.rb +1 -1
- data/spec/dummy/db/schema.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aae2b92c885f31dc1d49e0cef87e8a74b90c6fd5
|
4
|
+
data.tar.gz: 7f4cc106fd14c24c05d046141d27541118323c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ca3523a242b761e3d0e9df7f6df38fb5c89f22ae46817d579fa142d8a0b1bcefece2ce87fdc9eeba9b78ede9e4c9b3ed4ce2dc886e60c26ef0e3f9f413e9512
|
7
|
+
data.tar.gz: 042785fbb3d787ec88b9d5c823c6d7ac905452384bd51d238944eba68deba1e6d492b9e7930d863f795f6c2ab35d88fb2984120689da113c816a27ed9ba61ef6
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -6,6 +6,12 @@ Generate documentation from your rack application & request-spec.
|
|
6
6
|
gem "autodoc", group: :test
|
7
7
|
```
|
8
8
|
|
9
|
+
If you want to generate toc_html, you should install [redcarpet gem](https://github.com/vmg/redcarpet) (optional).
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem "redcarpet", group: :test
|
13
|
+
```
|
14
|
+
|
9
15
|
## Usage
|
10
16
|
Run rspec with AUTODOC=1 to generate documents for your request-specs tagged with `:autodoc`.
|
11
17
|
example: Autodoc generates [doc/recipes.md](https://github.com/r7kamura/autodoc/blob/master/spec/dummy/doc/recipes.md) and [doc/toc.md](https://github.com/r7kamura/autodoc/blob/master/spec/dummy/doc/toc.md) from [spec/requests/recipes_spec.rb](https://github.com/r7kamura/autodoc/blob/master/spec/requests/recipes_spec.rb).
|
data/lib/autodoc/document.rb
CHANGED
@@ -219,13 +219,27 @@ module Autodoc
|
|
219
219
|
end
|
220
220
|
|
221
221
|
def to_s
|
222
|
-
"
|
222
|
+
string = ""
|
223
|
+
string << "#{body}#{payload}"
|
224
|
+
|
225
|
+
if validator.respond_to? :validators
|
226
|
+
validator.validators.each do |x|
|
227
|
+
string << "\n"
|
228
|
+
string << Parameter.new(x).to_s.indent(2)
|
229
|
+
end
|
230
|
+
end
|
231
|
+
|
232
|
+
string
|
223
233
|
end
|
224
234
|
|
225
235
|
private
|
226
236
|
|
227
237
|
def body
|
228
|
-
|
238
|
+
if validator.key.nil?
|
239
|
+
"* #{validator.type}"
|
240
|
+
else
|
241
|
+
"* `#{validator.key}` #{validator.type}"
|
242
|
+
end
|
229
243
|
end
|
230
244
|
|
231
245
|
def payload
|
data/lib/autodoc/version.rb
CHANGED
data/spec/dummy/db/schema.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autodoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|