Skip to content

Commit

Permalink
Regenerate gemspec for version 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
rknLA committed Feb 1, 2012
1 parent dc5d68c commit 99cf7ba
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/yard-rest.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
YARD::Templates::Engine.register_template_path File.dirname(__FILE__) + '/../templates'

require File.join(File.dirname(__FILE__), 'yard-rest', 'tags')
require File.join(File.dirname(__FILE__), 'yard-rest', 'rest_filters')

YARD::Templates::Template.extra_includes << RestFilters


31 changes: 31 additions & 0 deletions lib/yard-rest/rest_filters.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module RestFilters

def index_objects(list)
res = reject_module(list)
res = reject_without_url(res)
res = reject_without_topic(res)
res = reject_overall(res)

res
end

def reject_module(list)
list.reject { |object| [:root, :module].include?(object.type) }
end

def reject_without_url(list)
list.reject { |object| [:class, :method].include?(object.type) and !object.has_tag?('url') }
end

def reject_without_topic(list)
list.reject { |object| [:class].include?(object.type) and !object.has_tag?('topic') }
end

def reject_overall(list)
list.reject { |object| object.has_tag?('overall') }
end

end



13 changes: 13 additions & 0 deletions lib/yard-rest/tags.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Define custom tags
YARD::Tags::Library.define_tag("URL for Service", :url)
YARD::Tags::Library.define_tag("Topic for Service", :topic)
YARD::Tags::Library.define_tag("Required Arguments", :argument, :with_types_and_name)
YARD::Tags::Library.define_tag("Optional Arguments", :optional_argument, :with_types_and_name)
YARD::Tags::Library.define_tag("Example Request", :example_request)
YARD::Tags::Library.define_tag("Example Response", :example_response)
YARD::Tags::Library.define_tag("Response Fields", :response_field, :with_types_and_name)
YARD::Tags::Library.define_tag("Request Fields", :request_field, :with_types_and_name)
YARD::Tags::Library.define_tag("Headers", :header, :with_name)
YARD::Tags::Library.define_tag("Response codes", :response_code, :with_name)
YARD::Tags::Library.define_tag("Image", :image)
YARD::Tags::Library.define_tag("Overall", :overall)
44 changes: 44 additions & 0 deletions yard-rest.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
s.name = "yard-rest"
s.version = "0.3.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["R. Kevin Nelson", "Aisha Fenton"]
s.date = "2012-02-01"
s.description = "A plugin for Yardoc that produces API documentation for Restful web services. See README.markdown for more details"
s.email = "kevin@rkn.la"
s.extra_rdoc_files = [
"README.markdown",
"VERSION"
]
s.files = [
"Rakefile",
"example/README.markdown",
"example/SampleController.rb",
"lib/yard-rest.rb",
"lib/yard-rest/rest_filters.rb",
"lib/yard-rest/tags.rb"
]
s.homepage = "http://github.com/rknLA/yard-rest-plugin"
s.require_paths = ["lib"]
s.rubygems_version = "1.8.10"
s.summary = "A plugin for Yardoc that produces API documentation for Restful web services"

if s.respond_to? :specification_version then
s.specification_version = 3

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<yard>, ["~> 0.7.4"])
else
s.add_dependency(%q<yard>, ["~> 0.7.4"])
end
else
s.add_dependency(%q<yard>, ["~> 0.7.4"])
end
end

0 comments on commit 99cf7ba

Please sign in to comment.