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
:delay 15; | |
/tool sms send lte1 <phone> message="Mikrotik LTE rebooted successfully" |
name: Test | |
on: | |
push: | |
branches: | |
- main | |
- features/** | |
- dependabot/** | |
pull_request: | |
branches: |
# frozen_string_literal: true | |
require "bundler/inline" | |
gemfile(true) do | |
source "https://rubygems.org" | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
ruby "2.7.2" |
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 |
class Kismet < Formula | |
desc "Wireless network and device detector, sniffer, wardriving tool, and WIDS framework." | |
homepage "https://www.kismetwireless.net/" | |
url "https://github.com/kismetwireless/kismet/archive/kismet-2020-09-R4.tar.gz" | |
sha256 "c9044b60f5efc2a83c024d51ea16dd549ec158c3bb8b36019513d91cd5b2f94c" | |
version "2020-09-R4" | |
head "https://github.com/kismetwireless/kismet.git" | |
license "GPL-2.0-only" | |
depends_on "pkg-config" => :build |
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 |
root = true | |
[*] | |
charset=utf-8 | |
end_of_line=lf | |
indent_style=space | |
insert_final_newline=true | |
trim_trailing_whitespace=true | |
[*.rb] |
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.