Skip to content

Instantly share code, notes, and snippets.

View bdewater-thatch's full-sized avatar

Bart de Water bdewater-thatch

View GitHub Profile
@bdewater-thatch
bdewater-thatch / patch.rb
Last active October 31, 2025 14:09
Tapioca compact mode
# credit: jeffcarbs on Sorbet Slack
# combine with Tapioca options `gems --no-doc --no-loc`
module TapiocaRbiShim
module RBIFormatter
SIG_METHOD_REGEX = /(^ *sig \{.*?)[;\n] *(def .*)\n+/
# This method post-processes the original `rbi_for_constant` to
# rewrite the sig+method to the one-liner form (i.e. `sig {}; def meth; end`)
def print_file(rbi)
@bdewater-thatch
bdewater-thatch / initializer.rb
Last active September 5, 2023 14:24
Tapioca Active Record find patch to return model instance
# typed: strict
# frozen_string_literal: true
require "patches/tapioca_active_record_relations" if defined?(Tapioca)