Skip to content

Updating docs for wURL, Removing rake restriction #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 22, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ See the `example` folder for a sample Rails app that has been documented.
## Configuration options
- app - Set the application that Rack::Test uses, defaults to `Rails.application`
- docs_dir - Output folder
- format - Output format
- format - An array of output format(s). Possible values are :json, :html, or :wurl. The final option is similar to :html, but includes the wURL console.
- template_path - Location of templates
- filter - Filter by example document type
- exclusion_filter - Filter by example document type
Expand All @@ -40,14 +40,16 @@ See the `example` folder for a sample Rails app that has been documented.
### Example Configuration
`spec/spec_helper.rb`

RspecApiDocumentation.configure do |config|
config.docs_dir = Rails.root.join("app", "views", "pages")
```ruby
RspecApiDocumentation.configure do |config|
config.docs_dir = Rails.root.join("app", "views", "pages")

config.define_group :public do |config|
config.docs_dir = Rails.root.join("public", "docs")
config.url_prefix = "/docs"
end
end
config.define_group :public do |config|
config.docs_dir = Rails.root.join("public", "docs")
config.url_prefix = "/docs"
end
end
```

## Usage

Expand Down
5 changes: 4 additions & 1 deletion example/spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@

RspecApiDocumentation.configure do |config|
config.docs_dir = Rails.root.join("public", "docs")
config.format = [:html, :json]
# html pages with the wURL console
config.format = [:json, :wurl]
# html pages without the wURL console
#config.format = [:json, :html]
config.url_prefix = "/docs"
config.curl_host = 'http://localhost:3000'
end
10 changes: 4 additions & 6 deletions lib/tasks/docs.rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
require 'rspec/core/rake_task'

if Rails.env.test? || Rails.env.development?
desc 'Generate API request documentation from API specs'
RSpec::Core::RakeTask.new('docs:generate') do |t|
t.pattern = 'spec/acceptance/**/*_spec.rb'
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter"]
end
desc 'Generate API request documentation from API specs'
RSpec::Core::RakeTask.new('docs:generate') do |t|
t.pattern = 'spec/acceptance/**/*_spec.rb'
t.rspec_opts = ["--format RspecApiDocumentation::ApiFormatter"]
end