README.md in smashing_docs-1.2.0 vs README.md in smashing_docs-1.2.1
- old
+ new
@@ -33,18 +33,18 @@
(Do not place it inside the `RSpec.configure` block).
```ruby
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
- c.auto_push = false
c.run_all = true
+ c.auto_push = false
end
```
Add the following content to `spec_helper.rb` inside the `RSpec.configure` block
-`config.after(:suite) { SmashingDocs.finish! }`
+`# config.after(:suite) { SmashingDocs.finish! }`
It should look like this
```ruby
RSpec.configure do |config|
# Existing code
@@ -59,12 +59,12 @@
Set the `c.run_all` line to `false` in `rails_helper.rb`
```ruby
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
- c.auto_push = false
c.run_all = false
+ c.auto_push = false
end
```
Then just add `SmashingDocs.run!(request, response)` to the tests you want to run
```ruby
@@ -82,12 +82,12 @@
class ActiveSupport::TestCase
# Already existing code
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
- c.auto_push = false
c.run_all = true
+ c.auto_push = false
end
# More code
end
class ActionController::TestCase < ActiveSupport::TestCase
@@ -103,12 +103,12 @@
Set the `c.run_all` line to `false` in `test_helper.rb`
```ruby
SmashingDocs.config do |c|
c.template_file = 'smashing_docs/template.md'
c.output_file = 'smashing_docs/api_docs.md'
- c.auto_push = false
c.run_all = false
+ c.auto_push = false
end
```
Then just add `SmashingDocs.run!(request, response)` to specific tests
```ruby
@@ -119,12 +119,12 @@
end
```
## Setting a template
-If you copied the code from above, SmashingDocs will look for a template file located in
-`smashing_docs/template.md`
+If you used the auto-installer or copied the code from above, SmashingDocs will
+look for a template file located in `smashing_docs/template.md`
This template may be customized to fit your needs.
```erb
<%= request.method %>
@@ -134,12 +134,13 @@
<%= information[:note] %>
```
## Where to find the docs
-By default, the docs are output to `api_docs.md` in the root of the Rails project.
-You can change this by altering the config in `test_helper.rb` or `rails_helper.rb`.
+By default, the docs are output to `smashing_docs/api_docs.md` in the Rails project.
+You can change this by altering the config in `test_helper.rb` (MiniTest) or
+`rails_helper.rb`(RSpec).
## Additional Features
#### Skipping documentation on tests
@@ -177,15 +178,21 @@
../projects/my_rails_app
../projects/my_rails_app.wiki
- 2. Set auto_push to true in `spec_helper.rb` or `test_helper.rb`
+ 2. Set auto_push to true in `rails_helper.rb` or `test_helper.rb`
``` ruby
SmashingDocs.config do |c|
# configs
c.auto_push = true
end
```
3. Build your docs with `rails g smashing_documentation:build_docs`
+
+#### Generate Docs on Every Test Suite Run
+
+If you prefer to have your docs built every time you run the test suite, and do
+not want to run the build command, then uncomment the `SmashingDocs.finish` line
+in your `rails_helper` or `test_helper`