templates/api/fulldoc/json/setup.rb in yard-api-0.2.2 vs templates/api/fulldoc/json/setup.rb in yard-api-0.2.3
- old
+ new
@@ -24,17 +24,17 @@
})
end
end
def method_details_list(controllers)
- @meths = controllers.map do |controller|
+ meths = controllers.map do |controller|
controller.meths(:inherited => false, :included => false)
end.flatten
- @meths = run_verifier(@meths)
+ meths = run_verifier(meths)
- @meths.map do |object, i|
+ meths.map do |object, i|
dump_object(object).tap do |object_info|
object_info[:tags] = dump_object_tags(object)
end
end
end
@@ -92,21 +92,17 @@
action = action.sub(/_with_.*$/, '')
routes = RouteHelper.api_methods_for_controller_and_action(controller, action)
route = routes.first
if route.present?
- # controller_path = "app/controllers/#{route.requirements[:controller]}_controller.rb"
- # controller_path = nil unless File.file?(Rails.root+controller_path)
-
- route_path = route.path.spec.to_s.gsub("(.:format)", "")
verb = if route.verb.source =~ /\^?(\w*)\$/
$1.upcase
else
route.verb.source
end
{
- path: route_path,
+ path: route.path.spec.to_s.gsub("(.:format)", ""),
verb: verb
}
end
end