Sha256: bfed50673997d71e2e8ab074eeb4b7a29e55a2fef89c3d2c1b4829f660c4a341
Contents?: true
Size: 294 Bytes
Versions: 20
Compression:
Stored size: 294 Bytes
Contents
# frozen_string_literal: true module I18n::Tasks module StringInterpolation module_function def interpolate_soft(s, t = {}) return s unless s t.each do |k, v| pat = "%{#{k}}" s = s.gsub pat, v.to_s if s.include?(pat) end s end end end
Version data entries
20 entries across 20 versions & 3 rubygems