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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3398b87997facd945fc411efcad5b7fe4bd1ea0a
4
- data.tar.gz: 86726fc12df1d0e7564edb712b7e9ea3c430dd42
3
+ metadata.gz: aae2b92c885f31dc1d49e0cef87e8a74b90c6fd5
4
+ data.tar.gz: 7f4cc106fd14c24c05d046141d27541118323c62
5
5
  SHA512:
6
- metadata.gz: b6bf838b4dfe9f2616ff1220189c14b67567dfc8088c2d226f223c1ca2122984666236ae752884098261d67159ebc051ac2d941019b25dc61ff4a4a1538d4597
7
- data.tar.gz: e3db0ce08099d05159c6f85921a06232d295a67ebb7c30e34f078f0ce653f6431681fecbecc4d27dbaa84a189add4637619e339ba16b6212d16db1ea8f1cd6a9
6
+ metadata.gz: 7ca3523a242b761e3d0e9df7f6df38fb5c89f22ae46817d579fa142d8a0b1bcefece2ce87fdc9eeba9b78ede9e4c9b3ed4ce2dc886e60c26ef0e3f9f413e9512
7
+ data.tar.gz: 042785fbb3d787ec88b9d5c823c6d7ac905452384bd51d238944eba68deba1e6d492b9e7930d863f795f6c2ab35d88fb2984120689da113c816a27ed9ba61ef6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 0.4.3
2
+ - Support nested parameters on weak_parameters (Thx @mzp)
3
+
1
4
  ## 0.4.2
2
5
  - Add HTML Documentation support (Thx @daviddening)
3
6
 
data/Gemfile CHANGED
@@ -15,4 +15,5 @@ group :test do
15
15
  gem "protected_attributes"
16
16
  gem "rack-test"
17
17
  gem "redcarpet"
18
+ gem "responders"
18
19
  end
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).
@@ -219,13 +219,27 @@ module Autodoc
219
219
  end
220
220
 
221
221
  def to_s
222
- "#{body}#{payload}"
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
- "* `#{validator.key}` #{validator.type}"
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
@@ -1,3 +1,3 @@
1
1
  module Autodoc
2
- VERSION = "0.4.2"
2
+ VERSION = "0.4.3"
3
3
  end
@@ -13,7 +13,7 @@
13
13
 
14
14
  ActiveRecord::Schema.define(version: 20130607075126) do
15
15
 
16
- create_table "recipes", force: true do |t|
16
+ create_table "recipes", force: :cascade do |t|
17
17
  t.string "name"
18
18
  t.integer "type"
19
19
  t.datetime "created_at"
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.2
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-13 00:00:00.000000000 Z
11
+ date: 2015-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport