Skip to content

Commit

Permalink
Fix optional_arguments, update example.
Browse files Browse the repository at this point in the history
Prepare again for 0.3.0 release.

Update README
  • Loading branch information
rknLA committed Feb 1, 2012
1 parent 7954f3b commit dc5d68c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 106 deletions.
15 changes: 15 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@ When using yardoc you ask it to use the "rest" plugin (the --plugin option). For

yardoc '*.rb' --plugin rest --title "Our App's API"

## Gemfile functionality

You may also include yard-rest in your gemfile using:

gem 'yard-rest'

You may need to include the following dependencies as well:

gem 'redcarpet'
gem 'yard', '~>0.7.4'

If you include yard-rest in your gemfile, you should generate docs using bundle exec:

bundle exec yardoc '*.rb' --plugin rest --title "Our App's API"

## Writing Comments

In addition to starting your comment with the normal RDoc description. The following tags are provided:
Expand Down
15 changes: 8 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ require 'rake'
begin
require 'jeweler'
Jeweler::Tasks.new do |gem|
gem.name = "yard-rest-plugin"
gem.name = "yard-rest"
gem.summary = %Q{A plugin for Yardoc that produces API documentation for Restful web services}
gem.description = %Q{A plugin for Yardoc that produces API documentation for Restful web services. See README.markdown for more details}
gem.email = "aisha.fenton@visfleet.com"
gem.email = 'kevin@rkn.la'
gem.homepage = "http://github.com/rknLA/yard-rest-plugin"
gem.authors = ['R. Kevin Nelson', 'Aisha Fenton']
gem.add_dependency("yard", '~>0.7.4')
Expand All @@ -22,16 +22,17 @@ end

desc "Rebuild the gem from the gemspec"
task :rebuild do
`rm yard-rest-plugin-0.2.6.gem`
`gem uninstall yard-rest-plugin&& \
gem build yard-rest-plugin.gemspec && \
gem install yard-rest-plugin-0.2.6.gem`
gemfilename = 'yard-rest-' + File.open('VERSION').gets.strip + '.gem'
`rm yard-rest-*.gem`
`gem uninstall yard-rest&& \
gem build yard-rest.gemspec && \
gem install #{gemfilename}`
end

namespace :ex do
desc "Generate example docs"
task :generate do
`yardoc 'example/*.rb' --backtrace -e ./lib/yard-rest-plugin.rb -r example/README.markdown --title 'Sample API'`
`yardoc 'example/*.rb' --backtrace -e ./lib/yard-rest.rb -r example/README.markdown --title 'Sample API'`
end

desc "Clean example docs"
Expand Down
3 changes: 2 additions & 1 deletion example/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ This is a sample API. You should see:

- This file
- An index containing one service /sample.
- That service should contain only one action: Index
- That service should contain only two actions: Index, and Create
- Index should have a description, list of arguments, an example response, and a list of response fields.
- Create should have everything that Index has, and also an example request field.
- Nothing else should be included because it doesn't have a URL specified.

Click [here](./_index.html) to go to the Index
4 changes: 2 additions & 2 deletions example/SampleController.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SampleController
# @argument [String] format Only "xml" is supported at this time.
# @argument [String] name The name of the sample
# @argument [String] reource The resource that sample belongs to
# @argument ["@assigned"|"@complete"|"!@complete"] search Return jobs that are assigned, complete, or
# @optional_argument ["@assigned"|"@complete"|"!@complete"] search Return jobs that are assigned, complete, or
# uncomplete.
#
# @example_response
Expand Down Expand Up @@ -131,4 +131,4 @@ def action
end

end
end
end
8 changes: 0 additions & 8 deletions lib/yard-rest-plugin.rb

This file was deleted.

31 changes: 0 additions & 31 deletions lib/yard-rest-plugin/rest_filters.rb

This file was deleted.

13 changes: 0 additions & 13 deletions lib/yard-rest-plugin/tags.rb

This file was deleted.

5 changes: 5 additions & 0 deletions templates/default/tags/setup.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
def init
super
sections :index, [:argument,
:optional_argument,
:example_request,
:request_field,
:example_response,
Expand All @@ -21,6 +22,10 @@ def argument
generic_tag :argument, :no_types => false
end

def optional_argument
generic_tag :optional_argument, :no_types => false
end

def header
generic_tag :header
end
Expand Down
44 changes: 0 additions & 44 deletions yard-rest-plugin.gemspec

This file was deleted.

0 comments on commit dc5d68c

Please sign in to comment.