autodoc 0.3.4 → 0.3.5

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: 7d2c0efdba248e2389ee71279609112523677cce
4
- data.tar.gz: b56df7831699c1b4a74a3d56d98b1da342147cb2
3
+ metadata.gz: 0c2aa5947baeb7bbb3aeb4ca8c94827db14643e4
4
+ data.tar.gz: 0c0c019f1d5845ed1226ce95235a4ba72990f0ef
5
5
  SHA512:
6
- metadata.gz: 66deb224a2b8e1f584409f7795af9b43e1862518f92ff9aa84a02311a2bc336d00a0a1033be3fbedb4e7977ccc847f2cc9d1a91ee63b302f622f36d8cb0e8857
7
- data.tar.gz: c7ab1e29455fd193163aed36655946689b1fd7d0f64442fe3fdd3d0b336c96994e0851a44f153c4ecde849893f0055a0f5415ae4f41e7b2840c603ac929c6c0f
6
+ metadata.gz: 023540cf07d6922fcaf674320778a5434e1f99467517edd4eeadfd8a5897ec0307a86489fd21c9c681d7315b11836e3d5d3d73ad18e2e05ca3a9cc011a3c884b
7
+ data.tar.gz: 2adc8b8e171ea8bae310b6a1793f84953a96a6c6e5d525b692f6afa5306e36e1ba57538b152b50a0d5ac3068ef4429895cf07b3c61f6a1ea8fd522b901434265
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.3.5
2
+ * Support PATCH method
3
+
4
+ ## 0.3.4
5
+ * Some improvements on the document template file
6
+
1
7
  ## 0.3.3
2
8
  * Fix ToC template for specs in sub-directory
3
9
 
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), [doc/toc.md](https://github.com/r7kamura/autodoc/blob/master/spec/dummy/doc/toc.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
- ### Example for any Rack application with rack-test
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
- get "/entries"
30
- last_response.status.should == 200
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
- ### Example for Rails application with rspec-rails
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
 
@@ -178,7 +178,7 @@ module Autodoc
178
178
  end
179
179
 
180
180
  def path
181
- @context.example.full_description[%r<(GET|POST|PUT|DELETE) ([^ ]+)>, 2]
181
+ @context.example.full_description[%r<(GET|POST|PATCH|PUT|DELETE) ([^ ]+)>, 2]
182
182
  end
183
183
 
184
184
  def parameters_section
@@ -1,3 +1,3 @@
1
1
  module Autodoc
2
- VERSION = "0.3.4"
2
+ VERSION = "0.3.5"
3
3
  end
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
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-01-24 00:00:00.000000000 Z
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: