Sha256: eb51e877adaca0ac79272fe2ad4b76523829085b3713412ad4d7a92fb9cc41d7
Contents?: true
Size: 279 Bytes
Versions: 7
Compression:
Stored size: 279 Bytes
Contents
# frozen_string_literal: true module Iwoca class PathSanitizer # Removes any leading '/' and guarantees an ending '/' def self.sanitize(path) parts = path.split('/').reject(&:empty?) new_path = parts.join('/') [new_path, '/'].join end end end
Version data entries
7 entries across 7 versions & 1 rubygems