zipmark/rspec_api_documentation — pull request #97 by alenia (2013-10-16 20:33:10+00:00)
Title: All writers now inherit from a base writer

* the writers are now responsible for cleaning docs
* added an append_json writer that does not delete docs and simply modifies index.json

## Example of use

in lib/tasks/my_docs.rspec:
```ruby
RSpec::Core::RakeTask.new('mydocs:generate', :spec_file) do |t, task_args|
if spec_file = task_args[:spec_file]
ENV["DOC_FORMAT"] = "append_json"
end
t.pattern = spec_file || 'spec/acceptance/**/*_spec.rb'
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter"]
end
```

in spec/support/documentation.rb
```ruby
ENV["DOC_FORMAT"] ||= "json"

RspecApiDocumentation.configure do |config|
config.format = ENV["DOC_FORMAT"]
end
```

then when I run rake mydocs:generate[spec/acceptance/foo_spec.rb, I only generate output relevant to foo.