Let's look at an innocuous piece of ruby. Consider some view code showing a user's name and phone number:
"#{first_name} #{last_name} #{phone}"Great - this is very succinct, readable, and can easily be extracted to a method in a
| name: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - features/** | |
| - dependabot/** | |
| pull_request: | |
| branches: |
| begin | |
| require "bundler/inline" | |
| rescue LoadError => e | |
| $stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
| raise e | |
| end | |
| gemfile(true) do | |
| source "https://rubygems.org" |
| require "bundler/inline" | |
| gemfile do | |
| gem "rspec" | |
| end | |
| require "rspec/autorun" | |
| RSpec.describe "inline Bundler and autorun RSpec" do | |
| it "is convenient for self-contained examples & bug repros" do |
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |
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.
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| # | |
| # weechat.conf -- weechat v0.3.2 | |
| # | |
| [debug] | |
| [startup] | |
| command_after_plugins = "" | |
| command_before_plugins = "" | |
| display_logo = on |
| # ....other stuff here | |
| paginate: 10 |
| {-# OPTIONS_GHC -fcontext-stack=32 #-} | |
| import XMonad hiding ( (|||) ) | |
| import qualified XMonad.StackSet as W | |
| import Control.OldException(catchDyn,try) | |
| import Data.Char (toLower) | |
| import Data.List (intercalate, intersperse, isSuffixOf, isPrefixOf) | |
| import qualified Data.Map as M (fromList) |