Sha256: c75bd0a0dc6f7ad8eb0e4c71a46590ce42b383199da936fb7620a17a11af3a79
Contents?: true
Size: 281 Bytes
Versions: 8
Compression:
Stored size: 281 Bytes
Contents
# frozen_string_literal: true module Youlend 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
8 entries across 8 versions & 1 rubygems