autodoc 0.3.4 → 0.3.5
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 +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +26 -5
- data/lib/autodoc/document.rb +1 -1
- data/lib/autodoc/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c2aa5947baeb7bbb3aeb4ca8c94827db14643e4
|
4
|
+
data.tar.gz: 0c0c019f1d5845ed1226ce95235a4ba72990f0ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 023540cf07d6922fcaf674320778a5434e1f99467517edd4eeadfd8a5897ec0307a86489fd21c9c681d7315b11836e3d5d3d73ad18e2e05ca3a9cc011a3c884b
|
7
|
+
data.tar.gz: 2adc8b8e171ea8bae310b6a1793f84953a96a6c6e5d525b692f6afa5306e36e1ba57538b152b50a0d5ac3068ef4429895cf07b3c61f6a1ea8fd522b901434265
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -8,14 +8,15 @@ gem "autodoc", group: :test
|
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
Run rspec with AUTODOC=1 to generate documents for your request-specs tagged with `:autodoc`.
|
11
|
-
example: [doc/recipes.md](https://github.com/r7kamura/autodoc/blob/master/spec/dummy/doc/recipes.md)
|
11
|
+
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).
|
12
12
|
|
13
13
|
```sh
|
14
14
|
# shell-command
|
15
15
|
AUTODOC=1 rspec
|
16
16
|
```
|
17
17
|
|
18
|
-
###
|
18
|
+
### Examples
|
19
|
+
#### For any Rack application with rack-test
|
19
20
|
```ruby
|
20
21
|
# spec/requests/entries_spec.rb
|
21
22
|
describe "Entries" do
|
@@ -26,13 +27,15 @@ describe "Entries" do
|
|
26
27
|
end
|
27
28
|
|
28
29
|
describe "GET /entries", autodoc: true do
|
29
|
-
|
30
|
-
|
30
|
+
it "returns entries" do
|
31
|
+
get "/entries"
|
32
|
+
last_response.status.should == 200
|
33
|
+
end
|
31
34
|
end
|
32
35
|
end
|
33
36
|
```
|
34
37
|
|
35
|
-
|
38
|
+
#### For Rails application with rspec-rails
|
36
39
|
```ruby
|
37
40
|
# spec/requests/recipes_spec.rb
|
38
41
|
describe "Recipes" do
|
@@ -45,6 +48,24 @@ describe "Recipes" do
|
|
45
48
|
end
|
46
49
|
```
|
47
50
|
|
51
|
+
### Custom description
|
52
|
+
You can write more detailed descriptions with `let(:description)`.
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
describe "Recipes" do
|
56
|
+
describe "PUT /recipes/:id", autodoc: true do
|
57
|
+
let(:description) do
|
58
|
+
"Updates a recipe. `name` parameter is required."
|
59
|
+
end
|
60
|
+
|
61
|
+
it "updates a recipe" do
|
62
|
+
put "/recipes/#{recipe.id}", name: "Bob"
|
63
|
+
response.status.should == 204
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
```
|
68
|
+
|
48
69
|
### Configuration
|
49
70
|
You can configure `Autodoc.configuration` to change its behavior:
|
50
71
|
|
data/lib/autodoc/document.rb
CHANGED
data/lib/autodoc/version.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.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -243,3 +243,4 @@ test_files:
|
|
243
243
|
- spec/requests/entries_spec.rb
|
244
244
|
- spec/requests/recipes_spec.rb
|
245
245
|
- spec/spec_helper.rb
|
246
|
+
has_rdoc:
|