YARD CHEATSHEET http://yardoc.org
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| import java.util.*; | |
| public class RPNCalc { | |
| private static Stack<Integer> stack = new Stack<Integer>(); | |
| private static Scanner input = new Scanner(System.in); | |
| public static void calculator() throws Exception { | |
| System.out.println("Welcome to the RPN Calculator program!"); |
| # Install tmux on Centos release 6.5 | |
| # install deps | |
| yum install gcc kernel-devel make ncurses-devel | |
| # DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
| curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
| tar -xvzf libevent-2.0.21-stable.tar.gz | |
| cd libevent-2.0.21-stable | |
| ./configure --prefix=/usr/local |
| def state | |
| case | |
| when !collected? then 'booked' | |
| when !ironed? then 'collected' | |
| when !delivered? then 'ironed' | |
| else 'delivered' | |
| end | |
| end |
| begin # start catching exceptions here | |
| ldap = Net::LDAP.open( | |
| :host => host, | |
| :port => port, | |
| :auth => { | |
| :method => :simple, | |
| :username => CONFIG['repldn'], | |
| :password => CONFIG['replpw'] | |
| } | |
| ) |
| module Auspice | |
| class BottomFeeder | |
| attr_accessor :x, :y, :z, :in, :out | |
| def initialize(size,w,h) | |
| @font = Gosu::Font.new(size,:name => DAT+'ttfs/ATComputer.ttf') | |
| @rows = ((h / size)+size) | |
| @cols = (w / @font.text_width('_',1)) | |
| @size = size | |
| @dtext = [''] |
| require 'io/console' | |
| Kernel.load('Auspice/Auspice.rb') | |
| module Auspice | |
| class SplashScreen | |
| def initialize | |
| @win = Screen.new | |
| #@sin = Gosu::Image.new(@win, Surface.new(64,64,[100,100,100,100]),false) | |
| @words = BottomFeeder.new 24,800,400 | |
| #@gl = OpenGLInjection.new | |
| #@win.addent(@gl) |
| I don't have a good name for it yet, webstorage git? | |
| I want it to be kinda up-and-running for v0.1, so major sections are omitted intentionally. | |
| basics: | |
| config: object: key/val -> preference/state | |
| { 'branchname': 'master' } | |
| tags: object: key/val -> tagname/(commit/tree/blob)hash | |
| { 'head': '' } | |
| directory: object: key/val -> fullpathfilename/contents | |
| {} |
| require 'digest/sha1' | |
| require 'zlib' | |
| require 'pp' | |
| module Git | |
| OBJECTS = {} | |
| class Object | |
cribbed from http://pastebin.com/xgzeAmBn
Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.
| def random_consonant | |
| ([*"b".."z"] - ["e", "i", "o", "u"]).sample | |
| end |