README.md in smashing_docs-1.2.1 vs README.md in smashing_docs-1.3.1

- old
+ new

@@ -4,30 +4,30 @@ ## Gem Installation in Rails In your gemfile add the following to your test group: -`gem 'smashing_docs', '~> 0.0.3'` +`gem 'smashing_docs', '~> 1.3.1'` Installation differs for RSpec/Minitest, so scroll to the appropriate section for guidance. ## Automatic Installation (RSpec or Minitest!) After you bundle, run: -`rails generate smashing_documentation:install` +`rails g docs:install` SmashingDocs will be configured to run on all your controller tests with the default template. If you're using RSpec and you haven't required `rails_helper` in your tests, do that now. `require 'rails_helper'` #### To generate your docs -Run `rails g smashing_documentation:build_docs`, and your docs will be waiting for you in the `smashing_docs` folder. +Run `rails g docs: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). @@ -35,10 +35,11 @@ SmashingDocs.config do |c| c.template_file = 'smashing_docs/template.md' c.output_file = 'smashing_docs/api_docs.md' c.run_all = true c.auto_push = false + c.wiki_folder = nil end ``` Add the following content to `spec_helper.rb` inside the `RSpec.configure` block @@ -57,14 +58,13 @@ #### To run on only select tests 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' + # configs c.run_all = false - c.auto_push = false + # configs end ``` Then just add `SmashingDocs.run!(request, response)` to the tests you want to run ```ruby @@ -84,10 +84,11 @@ SmashingDocs.config do |c| c.template_file = 'smashing_docs/template.md' c.output_file = 'smashing_docs/api_docs.md' c.run_all = true c.auto_push = false + c.wiki_folder = nil end # More code end class ActionController::TestCase < ActiveSupport::TestCase @@ -101,14 +102,13 @@ #### To run on only select tests 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' + # configs c.run_all = false - c.auto_push = false + # configs end ``` Then just add `SmashingDocs.run!(request, response)` to specific tests ```ruby @@ -174,23 +174,33 @@ **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/rails_app ../projects/my_rails_app.wiki - 2. Set auto_push to true in `rails_helper.rb` or `test_helper.rb` + 2. Set the name of your wiki folder (do **not** include '.wiki') ``` ruby SmashingDocs.config do |c| # configs + c.wiki_folder = "my_rails_app" + end + ``` + + 3. Set auto_push to true in `rails_helper.rb` or `test_helper.rb` + + ``` ruby + SmashingDocs.config do |c| + # configs c.auto_push = true + # configs end ``` - 3. Build your docs with `rails g smashing_documentation:build_docs` + 4. Build your docs with `rails g docs: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