README.md in smashing_docs-1.0.0 vs README.md in smashing_docs-1.1.0
- old
+ new
@@ -15,13 +15,17 @@
After you bundle, run:
`rails generate smashing_documentation:install`
SmashingDocs will be configured to run on all your controller tests with the default
-template, whenever you run your tests. Your API documentation will appear in the smashing_docs
-folder in the root of your Rails app.
+template.
+#### To generate your docs
+
+Run `rails g smashing_documentation:build_docs`, and your docs will be waiting for you
+in the `smashing_docs` folder.
+
## Manual RSpec Installation
Add this to your `rails_helper.rb` It should go outside of other blocks
(Do not place it inside the `RSpec.configure` block).
```ruby
@@ -41,11 +45,11 @@
RSpec.configure do |config|
# Existing code
config.after(:each, type: :controller) do
SmashingDocs.run!(request, response, true)
end
- config.after(:suite) { SmashingDocs.finish! }
+ # config.after(:suite) { SmashingDocs.finish! }
end
```
#### To run on only select tests
Set the `c.run_all` line to `false` in `rails_helper.rb`
@@ -140,10 +144,11 @@
# test code
end
```
#### Adding information, e.g. notes
+
SmashingDocs will log all requests and responses by default, but you can add some
**optional** parameters as well.
```ruby
it "responds with 200" do
@@ -151,5 +156,29 @@
# test code
end
```
You can store any information with `:note`, `:message`, or any other key you can think of.
To access information in the template, just use `<%= information[:key] %>`
+
+#### Auto-Push Docs to Your Project Wiki
+
+SmashingDocs can automatically push your generated docs to your project wiki.
+
+**To enable this feature**
+ 1. Clone your wiki repo from Github into the same parent folder as your app
+
+ Your folder structure should be
+
+ ../projects/my_rails_app
+
+ ../projects/my_rails_app.wiki
+
+ 2. Set auto_push to true in `spec_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`