generate gtags.files list consisting only from .rb files
find . -name "*.rb" > gtags.files
generate *TAGS files
gtags --gtagslabel=new-ctags
| # ./spec/user_spec.rb | |
| require_relative '../../lib/user.rb' | |
| require 'ostruct' | |
| RSpec.describe User do | |
| subject { described_class.new(name: name, payment_service: payment_service) } | |
| let(:name) { 'John Doe' } | |
| let(:success_result) { true } |
| # homework.rb | |
| class Homework | |
| attr_reader :title, :content, :completed | |
| def initialize(title:, content:) | |
| @title = title | |
| @content = content | |
| @completed = false | |
| end |
| ### lib/user_input.rb | |
| class UserInput | |
| class InvalidUserInput < StandardError; end | |
| def initialize(input) | |
| @input = input | |
| end | |
| def to_s |
| # frozen_string_literal: true | |
| # CLI tool, accepts user input; | |
| # Saves as txt file | |
| # archives that txt file | |
| require 'pry' | |
| require 'zip' | |
| USER_INPUT_FILENAME = 'user_input.txt' |
| nvmrc=~/.nvm/nvm.sh | |
| if [ -e $nvmrc ]; then | |
| source $nvmrc | |
| nvm use | |
| fi | |
| PATH_add node_modules/.bin |
| version: '3' | |
| services: | |
| db: | |
| image: postgres | |
| volumes: | |
| - db-data:/var/lib/postgresql/data | |
| ports: | |
| - "5432:5432" | |
| environment: | |
| - POSTGRES_USER=username |
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.
| # This is just a cheat sheet: | |
| # On production | |
| sudo -u postgres pg_dump database | gzip -9 > database.sql.gz | |
| # On local | |
| scp -C production:~/database.sql.gz | |
| dropdb database && createdb database | |
| gunzip < database.sql.gz | psql database |