How to upload gems to server?

Skip to first unread message


Jul 15, 2019, 11:44:50 AM7/15/19
Hello YARD community. 

I have been using YARD for a bit now, and I really enjoy the documentation interface it provides as well as the website it builds for the documentation. 
I have recently found out about 
yard server
command, and I would like to utilize it for my local gem store. It works fine on its own, but I would like to be able to upload documentation to it remotely (for example, geminabox supplies something like
gem inabox gem_name --host rubygems.home.local
command for uploading a new gem to a gem server). This is because I am trying to set up CI/CD that will automatically upload the documentation to the server upon release, and I would like to avoid connecting to the documentation server and performing 
gem install gem_name
systemctl restart docsserver

My first thought was to create another gem that will manage the uploading interface - provide some function like
yard upload gem_name
on one side, and listen for upload requests server-side, installing provided gem and restarting the yardoc server. 

Maybe I am overthinking it, and I missed some functionality that YARD already provides. Please let me know if there is a better way.


Loren Segal

Jul 15, 2019, 4:28:31 PM7/15/19


You can look at the way this works for, which is an open sourced project to manage serving docs for arbitrary gems:

The TLDR of it is that gems are pulled by the service (the service being an extended YARD server) itself rather than uploaded to I suppose you can build some kind of .gem upload queue, but if your gem is published and publicly accessible, you can just link to that gem, download, unpack, and process the source as is done with this YARD server extension code:

The `load_yardoc_from_XXXX` methods provided by the above extension allow YARD to load documentation from extra sources, one of which being "remote_gem", which can download and unpack for processing. The implementation for expanding the gem is in that file as well. This extension API is documented in and can be used to avoid pushing data to your server (instead have the server pull).

Hope that helps!



You received this message because you are subscribed to the Google Groups "YARD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
For more options, visit
Reply all
Reply to author
0 new messages