Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Guard gem for YARD.

branch: master

Added support for jRuby and improved server.

Fork is not supported in jRuby, and it was a bit of overkill since I am
just doing a fork+exec. I switched to using spawn which greatly simplifies the
code. I also changed the kill to use a TERM signal instead of a KILL. This will
ultimately make the yard server healthier.

Fixes #11
latest commit 3ffcce43d9
Pan Thomakos authored March 25, 2014
Octocat-spinner-32 lib Added support for jRuby and improved server. March 25, 2014
Octocat-spinner-32 .gitignore Initial guard-yard gem commits. June 20, 2011
Octocat-spinner-32 CHANGES.markdown Changed to gem version 2.1.0 March 18, 2013
Octocat-spinner-32 Gemfile Initial guard-yard gem commits. June 20, 2011
Octocat-spinner-32 LICENSE Initial guard-yard gem commits. June 20, 2011
Octocat-spinner-32 README.markdown Added Ruby requirement to README. February 10, 2014
Octocat-spinner-32 Rakefile Initial guard-yard gem commits. June 20, 2011
Octocat-spinner-32 guard-yard.gemspec Fix loading of gem via Bundler :path December 08, 2013
README.markdown

Guard::Yard

Guard::Yard allows you to automatically run and update your local YARD Documentation Server. It aims to centralize your file monitoring to guard instead of using the yard server --reload command which can be unreliable and provides little control over the generated documentation. Guard::Yard monitors files and updates only the documentation than changes, as opposed to generating the entire documentation suite. That means that changes to your documentation are available sooner!

Requirements

  • The YARD documentation tool.
  • The Guard rubygem.
  • Ruby 1.9.2 or higher.

Install

Add guard-yard to your Gemfile (inside development group):

gem 'guard-yard'

Install or update your bundle:

bundle install

Add the default guard-yard definition to your Guardfile:

guard init yard

Guardfile

Please read the Guardfile DSL documentation for additional information.

Guard::Yard automatically detects changes in your app, lib and ext directories, but you can have it monitor additional files using the Guardfile DSL.

Guard::Yard also provides some basic options for doc generation and running the YARD server.

guard 'yard', :port => '8808' do
  ...
end

Available options:

:port => '8808'         # Port on which the server shoud run.
:stdout => 'yard.log'   # File in which to log the yard server output.
:stderr => '/dev/null'  # File in which to log the yard server errors.
:cli => '--plugin rest' # Additional command line options to be appended to the server command.

Clean-Slate Documentation

To generate or re-create documentation from a clean-slate, run the following command:

rm -rf .yardoc && yard doc

When booting guard, Guard::Yard will do this for you automatically if no .yardoc directory is present. Once guard is running you can execute this command by using the Ctrl-\ key combination as well.

Troubleshooting

If you are running into issues, try re-creating your documentation using rm -rf .yardoc && yard doc. Once this operation is complete, restart guard. If you are still having problems, open a new issue in the GitHub issue tracker for this project.

Something went wrong with that request. Please try again.