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.
# Thanks to: | |
# http://stackoverflow.com/questions/1921777/how-to-write-a-haml-custom-filter | |
# config/initializers/haml_filters.rb | |
require 'haml/filters/redcarpet' | |
# lib/haml/filters/redcarpet.rb | |
require 'redcarpet' | |
module Haml::Filters::Redcarpet |
# config/routes | |
match 'articles/*path' => "articles#static" | |
match '*path' => "articles#static" | |
# app/controllers/ArticlesController | |
class ArticlesController < ApplicationController | |
# GET /articles/:path | |
def static |
module AttributeFiltering | |
# [ :flying, :not => :psychic] | |
def is(arg) | |
return true if arg.class == TrueClass | |
return false if arg.class == FalseClass || arg.class == NilClass | |
if arg.class == Array | |
put "It's an array! #{arg.inspect}}" | |
# lib/explore/models/location.rb | |
require 'controllers/action_delegate' | |
require 'util/argument_validator' | |
require 'util/text_processor' | |
require 'explore/models/edge' | |
require 'explore/parsers/location_parser' | |
module Explore::Models |
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.
export PATH="/Applications/Sublime Text.app/Contents/SharedSupport/bin:$PATH" | |
export PGDATA="/usr/local/var/postgres" | |
eval "$(rbenv init - zsh)" | |
alias ci="bundle exec rspec && bundle exec rubocop" | |
alias be="bundle exec" | |
alias bea="bundle exec appraisal" | |
alias loki="bundle exec thor" | |
alias osd="OVERMIND_PROCFILE=Procfile.dev overmind start" |
# Implements module-based inheritance of both class- and instance-level | |
# methods. | |
module Mixin | |
def mixins | |
@mixins ||= [] | |
end # accessor mixins | |
def mixins=(ary) | |
@mixins = ary |
class Comparator | |
def initialize(actual, expected) | |
@actual = actual | |
@expected = expected | |
@errors = Hash.new { |hsh, key| hsh[key] = [] } | |
end # constructor | |
attr_accessor :actual, :expected, :errors | |
def eql? |
alias git-list-branches="git for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'" |
module Spec::Support | |
class ExampleGroup | |
class << self | |
attr_reader :description | |
def describe description | |
example_group = Class.new(self) | |
example_group.description = description |