doc_yo_self 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -7
- data/doc_yo_self-0.0.1.gem +0 -0
- data/doc_yo_self.gemspec +7 -3
- data/test/fake_template.md +0 -1
- metadata +9 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 056f07b694b869d21da83aaefdde61b1df7b0a6f
|
4
|
+
data.tar.gz: c97f98b9684cf279095b92c6298ca3cdc74fa8cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ff4c4e2e621ee66b25439e10d151ca8a2d15f98bfa09f52775a99a0b892df84c0e7bf99272f0fa3473573fe5f13302d9686ec1ff8aa7250b0f06b79c8841ba
|
7
|
+
data.tar.gz: 469af588c0345a84f443094aec77b1e571677986ca72db1d6d8ea5000b7199d3367a3470a3d272bc1b84d2cec96091a72254e5f1fd28334cb6f565e926abd9d1
|
data/README.md
CHANGED
@@ -6,31 +6,40 @@ Time for this project was provided by my employer, [SmashingBoxes](http://smashi
|
|
6
6
|
|
7
7
|
# Limitations
|
8
8
|
|
9
|
-
* **Current focus is MiniTest**. Probably will work with Rspec too, but that's not our focus right now.
|
10
9
|
* **Probably not thread safe**. Thread safety isn't a focus for this project right now. Pull requests welcome :-).
|
11
10
|
|
12
11
|
|
13
12
|
## Setup
|
14
13
|
|
14
|
+
In your gemfile:
|
15
|
+
`gem 'doc_yo_self', group: :test`
|
16
|
+
|
17
|
+
In `test_helper.rb`:
|
15
18
|
```ruby
|
16
19
|
DocYoSelf.config do |c|
|
17
20
|
c.template_file = 'test/template.md.erb'
|
18
|
-
c.
|
21
|
+
c.output_file = 'api_docs.md'
|
19
22
|
end
|
20
23
|
```
|
21
24
|
|
25
|
+
See test/fake_template.md for template examples.
|
26
|
+
|
22
27
|
To run doc generation after every controller spec, put this into your `teardown` method. Or whatever method your test framework of choice will run after *every test*.
|
23
28
|
|
29
|
+
## For Minitest Folks
|
30
|
+
|
24
31
|
```ruby
|
25
|
-
|
26
|
-
|
27
|
-
|
32
|
+
class ActionController::TestCase < ActiveSupport::TestCase
|
33
|
+
def teardown
|
34
|
+
DocYoSelf.run!(request, response)
|
35
|
+
end
|
36
|
+
end
|
28
37
|
```
|
29
38
|
|
30
39
|
Then put this at the bottom of your `test_helper.rb`:
|
31
40
|
|
32
41
|
```ruby
|
33
|
-
DocYoSelf.finish!
|
42
|
+
MiniTest::Unit.after_tests { DocYoSelf.finish! }
|
34
43
|
```
|
35
44
|
|
36
45
|
Or put it individually into only certain tests...
|
@@ -39,10 +48,25 @@ Or put it individually into only certain tests...
|
|
39
48
|
def test_some_api
|
40
49
|
get :index, :users
|
41
50
|
assert response.status == 200
|
42
|
-
DocYoSelf.run!
|
51
|
+
DocYoSelf.run!(request, response)
|
52
|
+
end
|
53
|
+
```
|
54
|
+
|
55
|
+
## For RSpec Folks
|
56
|
+
|
57
|
+
Put this in your `spec_helper` and smoke it.
|
58
|
+
|
59
|
+
```ruby
|
60
|
+
RSpec.configure do |config|
|
61
|
+
config.after(:each, type: :controller) do
|
62
|
+
DocYoSelf.run!(request, response)
|
63
|
+
end
|
64
|
+
|
65
|
+
config.after(:suite) { DocYoSelf.finish! }
|
43
66
|
end
|
44
67
|
```
|
45
68
|
|
69
|
+
|
46
70
|
## Usage
|
47
71
|
|
48
72
|
It will log all requests and responses by default, but you can add some **optional** parameters as well.
|
Binary file
|
data/doc_yo_self.gemspec
CHANGED
@@ -5,11 +5,15 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.description = "An automatic API documentation generator."
|
6
6
|
s.email = 'rick.carlino@gmail.com'
|
7
7
|
s.files = `git ls-files`.split("\n")
|
8
|
-
s.homepage = 'https://github.com/
|
8
|
+
s.homepage = 'https://github.com/RickCarlino/smarf_doc'
|
9
9
|
s.license = 'MIT'
|
10
10
|
s.name = 'doc_yo_self'
|
11
11
|
s.require_paths = ['lib']
|
12
12
|
s.summary = "Uses your test cases to write example documentation for your API."
|
13
13
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
14
|
-
s.version = '0.0.
|
15
|
-
|
14
|
+
s.version = '0.0.2'
|
15
|
+
s.post_install_message = "DocYoSelf is now SmarfDoc. Please consider "\
|
16
|
+
"updating your Gemfile to the supported version for"\
|
17
|
+
" continued updates and support. "\
|
18
|
+
"https://github.com/RickCarlino/smarf_doc"
|
19
|
+
end
|
data/test/fake_template.md
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: doc_yo_self
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rick Carlino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: An automatic API documentation generator.
|
14
14
|
email: rick.carlino@gmail.com
|
@@ -16,10 +16,11 @@ executables: []
|
|
16
16
|
extensions: []
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
|
-
- .gitignore
|
19
|
+
- ".gitignore"
|
20
20
|
- README.md
|
21
21
|
- Rakefile
|
22
22
|
- api_docs.md
|
23
|
+
- doc_yo_self-0.0.1.gem
|
23
24
|
- doc_yo_self.gemspec
|
24
25
|
- documentation.md
|
25
26
|
- lib/base.rb
|
@@ -32,22 +33,23 @@ files:
|
|
32
33
|
- test/test_config.rb
|
33
34
|
- test/test_helper.rb
|
34
35
|
- test/test_test_case.rb
|
35
|
-
homepage: https://github.com/
|
36
|
+
homepage: https://github.com/RickCarlino/smarf_doc
|
36
37
|
licenses:
|
37
38
|
- MIT
|
38
39
|
metadata: {}
|
39
|
-
post_install_message:
|
40
|
+
post_install_message: DocYoSelf is now SmarfDoc. Please consider updating your Gemfile
|
41
|
+
to the supported version for continued updates and support. https://github.com/RickCarlino/smarf_doc
|
40
42
|
rdoc_options: []
|
41
43
|
require_paths:
|
42
44
|
- lib
|
43
45
|
required_ruby_version: !ruby/object:Gem::Requirement
|
44
46
|
requirements:
|
45
|
-
- -
|
47
|
+
- - ">="
|
46
48
|
- !ruby/object:Gem::Version
|
47
49
|
version: '0'
|
48
50
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
51
|
requirements:
|
50
|
-
- -
|
52
|
+
- - ">="
|
51
53
|
- !ruby/object:Gem::Version
|
52
54
|
version: '0'
|
53
55
|
requirements: []
|