autodoc 0.3.1 → 0.3.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac859dfcddee9d293290317ff4039da04edd3eed
4
- data.tar.gz: f752329167fe44b3b7f6db9938bf2f80122239a7
3
+ metadata.gz: 937c3ab0cd4c58a348027ba6b9a05d2c87d45e6b
4
+ data.tar.gz: ee87c40f918c645971f3f14cdb7a26756557371f
5
5
  SHA512:
6
- metadata.gz: af8b5f8a3d932fc51013b591ed3968648f512e0b4365ef96cfc526b57332ccd3f59d1b7e1dce0e64d6cbb9d3e3cdd87f7fe09fa60a969fa881391913e63b0600
7
- data.tar.gz: b1f555f70b33527afd368f57ab1127b8ef2a882655240027627643748c1e5837cb3466de5c4960f3533033de42f9241082f7c2e7727a06fc9a1c5f37f32bdeaf
6
+ metadata.gz: 6da626b43eab6022fb1d434cd7800ecba703113be0246c6f5230618ee031a6168d8bf43d6250d23964ff19ba03d50321f6e0e1ebc7172e530ad108e3ff63b202
7
+ data.tar.gz: c5c7e82c7915f3efcedda12a4d88365eeaceacd6c2d8cf8584780fae8808ec0b800fecc3d6b3d8804c2ec1a0bc80ad8e93c4deff51e99f0edb4978b4990fb93e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.3.2
2
+ * Fix template & document bug
3
+
1
4
  ## 0.3.1
2
5
  * prettify JSON request body
3
6
  * filter request & response header by Autodoc.configuration.suppress_{request,response}_header
@@ -80,7 +80,9 @@ module Autodoc
80
80
  end
81
81
 
82
82
  def request_header_from_fixed_keys
83
- request.headers.env.slice("CONTENT_TYPE", "CONTENT_LENGTH", "LOCATION")
83
+ table = request.headers
84
+ table = table.env if table.respond_to?(:env)
85
+ table.slice("CONTENT_TYPE", "CONTENT_LENGTH", "LOCATION")
84
86
  end
85
87
 
86
88
  def request_http_version
@@ -124,10 +126,6 @@ module Autodoc
124
126
  table.map {|key, value| [key, value].join(": ") }.sort.join("\n")
125
127
  end
126
128
 
127
- def response_header_from_fixed_keys
128
- response.headers.env.slice("CONTENT_TYPE", "CONTENT_LENGTH", "LOCATION")
129
- end
130
-
131
129
  def response_http_version
132
130
  response.header["HTTP_VERSION"] || "HTTP/1.1"
133
131
  end
@@ -4,7 +4,7 @@
4
4
  <%= parameters_section %>
5
5
  ### Example
6
6
  ```
7
- <%= method %> <%= path %><%= request_query %> <%= request_http_version %>
7
+ <%= method %> <%= request.path %><%= request_query %> <%= request_http_version %>
8
8
  <%= request_header %><%= request_body_section %>
9
9
  ```
10
10
 
@@ -1,3 +1,3 @@
1
1
  module Autodoc
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2"
3
3
  end
@@ -3,7 +3,7 @@ Returns the recipe.
3
3
 
4
4
  ### Example
5
5
  ```
6
- GET /recipes/:id HTTP/1.1
6
+ GET /recipes/1 HTTP/1.1
7
7
  Content-Length: 0
8
8
  Content-Type: application/json
9
9
  Host: example.org
@@ -14,11 +14,11 @@ HTTP/1.1 200
14
14
  Cache-Control: max-age=0, private, must-revalidate
15
15
  Content-Length: 111
16
16
  Content-Type: application/json; charset=utf-8
17
- ETag: "082bd55a40d73aebcc3f6227e98dcebb"
17
+ ETag: "817f9446a34cdb5179ee09b555b507f8"
18
18
  X-Content-Type-Options: nosniff
19
19
  X-Frame-Options: SAMEORIGIN
20
- X-Request-Id: 1ced421d-4c76-44cf-bf5b-241358f73311
21
- X-Runtime: 0.038226
20
+ X-Request-Id: a1723cc5-c4f7-4779-8382-5dbf879687e5
21
+ X-Runtime: 0.017503
22
22
  X-UA-Compatible: chrome=1
23
23
  X-XSS-Protection: 1; mode=block
24
24
 
@@ -26,8 +26,8 @@ X-XSS-Protection: 1; mode=block
26
26
  "id": 1,
27
27
  "name": "test",
28
28
  "type": 2,
29
- "created_at": "2013-12-17T09:17:20.775Z",
30
- "updated_at": "2013-12-17T09:17:20.775Z"
29
+ "created_at": "2013-12-18T06:33:23.129Z",
30
+ "updated_at": "2013-12-18T06:33:23.129Z"
31
31
  }
32
32
  ```
33
33
 
@@ -61,12 +61,12 @@ HTTP/1.1 201
61
61
  Cache-Control: max-age=0, private, must-revalidate
62
62
  Content-Length: 111
63
63
  Content-Type: application/json; charset=utf-8
64
- ETag: "1220735207c1ff5203a3c8975649d37a"
64
+ ETag: "9a32ff7207d60c4e3eca833ed83320f9"
65
65
  Location: http://www.example.com/recipes/1
66
66
  X-Content-Type-Options: nosniff
67
67
  X-Frame-Options: SAMEORIGIN
68
- X-Request-Id: b1fded86-bbc2-4442-9fa2-d9536bd55dd4
69
- X-Runtime: 0.006243
68
+ X-Request-Id: 06f2dfe3-3085-419a-b2a8-db3abd1d3156
69
+ X-Runtime: 0.006099
70
70
  X-UA-Compatible: chrome=1
71
71
  X-XSS-Protection: 1; mode=block
72
72
 
@@ -74,7 +74,7 @@ X-XSS-Protection: 1; mode=block
74
74
  "id": 1,
75
75
  "name": "name",
76
76
  "type": 1,
77
- "created_at": "2013-12-17T09:17:20.858Z",
78
- "updated_at": "2013-12-17T09:17:20.858Z"
77
+ "created_at": "2013-12-18T06:33:23.195Z",
78
+ "updated_at": "2013-12-18T06:33:23.195Z"
79
79
  }
80
80
  ```
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.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryo Nakamura
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-17 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport