Skip to content

Instantly share code, notes, and snippets.

Run Yard server to serve Gem docs

Based on good work found at http://goo.gl/bKjJe

If you have Nginx running, you can run Yard as a rack app to serve docs for locally installed Gem.

  1. Create a directory to host Rack app. Install yard gem
mkdir -p ~/Dropbox/yard/public
set :rbenv_ruby, '2.3.0'
set :bundle_binstubs, shared_path.join( 'bundle/bin' )
namespace :rbenv do
before :validate, :install_rbenv do
on roles( :flashpoint_server ) do
unless test( "[ -d $HOME/.rbenv ]" )
# Install rbenv
execute( :git, :clone, "https://github.com/rbenv/rbenv.git", "$HOME/.rbenv" )
execute( "cd $HOME/.rbenv/ && src/configure && make -C src" )
@mattmeng
mattmeng / .bashrc
Last active January 2, 2018 17:06
.bashrc
GIT_PS1_SHOWCOLORHINTS=true
green="$(tput setaf 2)"
red="$(tput setaf 1)"
blue="$(tput setaf 4)"
yellow="$(tput setaf 3)"
white="$(tput setaf 7)"
bold="$(tput bold)"
reset="$(tput sgr0)"
PS1="\`if [[ \$? = "0" ]]; then echo '\n$green'; else echo '\n$red'; fi\`\$(s=\$(printf "%*s" \$COLUMNS); echo \${s// /-})\n \[$reset\]\[$blue\]\W\$(__git_ps1 \"\[$bold\](\[$reset\]\[$green\]%s\[$reset\]\[$blue\]\[$bold\])\") \[$reset\]\[$yellow\]\[$reset\]"