autodoc 0.0.2 → 0.0.3
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/lib/autodoc.rb +9 -2
- data/lib/autodoc/configuration.rb +20 -0
- data/lib/autodoc/document.rb +5 -7
- 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: f65c49b9848c73ca1b541e127c4ddf0e88398204
|
4
|
+
data.tar.gz: c96d43d4d997c3dd77ee24e1f2dac07f21950545
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db3256827ba11fac42e63b14a5795477761f87da901c3d7dbe27c09d3e01a428b33592de932767d1b112420cd408bf053576247909979f32661b6a4a1774b493
|
7
|
+
data.tar.gz: 578d459c2bb55482e42c8a7f4fc368484e1536aa8bf10616c385c81fe8645c0c4e44628d7b32026f262d64987ecb6b74fb0bd349c682bc04e15977b4eaf684e0
|
data/lib/autodoc.rb
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
require "autodoc/collector"
|
2
|
+
require "autodoc/configuration"
|
2
3
|
require "autodoc/document"
|
3
4
|
require "autodoc/version"
|
4
5
|
|
5
6
|
module Autodoc
|
6
|
-
|
7
|
-
|
7
|
+
class << self
|
8
|
+
def collector
|
9
|
+
@collector ||= Autodoc::Collector.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def configuration
|
13
|
+
@configuration ||= Autodoc::Configuration.new
|
14
|
+
end
|
8
15
|
end
|
9
16
|
end
|
10
17
|
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# You can configure documented headers.
|
2
|
+
#
|
3
|
+
# Examples
|
4
|
+
#
|
5
|
+
# # response.headers["X-Content-Type-Options"] will be documented.
|
6
|
+
# Autodoc.configuration.headers << "X-Content-Type-Options"
|
7
|
+
#
|
8
|
+
module Autodoc
|
9
|
+
class Configuration
|
10
|
+
attr_accessor :headers
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
reset
|
14
|
+
end
|
15
|
+
|
16
|
+
def reset
|
17
|
+
@headers = %w[Link location]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/autodoc/document.rb
CHANGED
@@ -53,12 +53,10 @@ module Autodoc
|
|
53
53
|
WeakParameters.stats[request.params[:controller]][request.params[:action]].try(:validators)
|
54
54
|
end
|
55
55
|
|
56
|
-
def
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
def location
|
61
|
-
"\nlocation: #{response.location}" if response.location
|
56
|
+
def headers
|
57
|
+
Autodoc.configuration.headers.map do |header|
|
58
|
+
"\n#{header}: #{response.headers[header]}" if response.headers[header]
|
59
|
+
end.compact.join
|
62
60
|
end
|
63
61
|
end
|
64
62
|
end
|
@@ -73,7 +71,7 @@ __END__
|
|
73
71
|
<%= parameters_section %>
|
74
72
|
### response
|
75
73
|
```
|
76
|
-
Status: <%= response.status %><%=
|
74
|
+
Status: <%= response.status %><%= headers %>
|
77
75
|
response: <%= request_body %>
|
78
76
|
```
|
79
77
|
|
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.0.
|
4
|
+
version: 0.0.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: 2013-06-
|
11
|
+
date: 2013-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- autodoc.gemspec
|
110
110
|
- lib/autodoc.rb
|
111
111
|
- lib/autodoc/collector.rb
|
112
|
+
- lib/autodoc/configuration.rb
|
112
113
|
- lib/autodoc/document.rb
|
113
114
|
- lib/autodoc/version.rb
|
114
115
|
- spec/dummy/Rakefile
|