Open-Source Wikis

/

GitLab

/

Packages

/

gitlab-utils

gitlab-org/gitlab

gitlab-utils

Tiny shared utilities used across the monolith and many sibling gems.

Source

gems/gitlab-utils/. Top-level entry point: gems/gitlab-utils/lib/gitlab/utils.rb.

What's in it

  • Gitlab::Utils::StrongMemoize — opinionated memoization (strong_memoize(:foo) { ... }).
  • Gitlab::Utils::LazyAttributes — lazy attribute helpers.
  • Gitlab::Utils::Override — declarative override :method for safer subclasses.
  • Gitlab::Utils::DelegatorOverride — same but for delegated methods.
  • Gitlab::Utils::DeepSize — bounded recursive size of a nested structure.
  • Gitlab::Utils::SafeInlineHash — hash with bounded depth.
  • Gitlab::Utils::SanitizedRegex — wrap untrusted regex with a timeout.
  • Gitlab::Utils::JSON — Oj-backed JSON helpers (already-decoded markers).
  • Gitlab::Utils::ErrorMessage — assemble user-readable error strings.
  • Gitlab::Utils::SafeRetry — bounded retry with backoff.
  • Many smaller helpers: pluralize, parse_int, sanitize_url, etc.

Why a gem

It loads cleanly without Rails. Many other gems and Rails initializers depend on it; making it a gem avoids lib/gitlab/utils.rb getting pulled in via half-loaded Rails state.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

gitlab-utils – GitLab wiki | Factory