Yard does not provide a convenience Rack integration AFAIK, but it features a rack adapter that allows you to run it inside a Rack Server like Passenger.
You need to write your own config.ru
to configure Passenger to run a Yard Server using Yard's RackAdapter
class. Also you need to tell Yard where it can find the documentation it should serve.
I have not tested this, but here is a rough guess at what the config.ru
should look like:
require "yard/server/rack_adapter"
run YARD::Server::RackAdapter.new({
"mylib" => [
YARD::Server::LibraryVersion.new("mylib", "1.0", "/path/to/mylib/.yardoc")
]
})
Where mylib
is the name of the library you want to serve.
See here: