Sha256: 0e029a8bff9148efd3c8833d6f76cf53933e1d1200eb894329db9d03a59242b6
Contents?: true
Size: 430 Bytes
Versions: 2
Compression:
Stored size: 430 Bytes
Contents
# encoding: UTF-8 module Unparser # Helpers for stripping source module StripHelper INDENT_PATTERN = /^\s*/.freeze # String indentation of source away # # @param [String] source # # @return [String] # # @api private # def strip(source) indent = source.rstrip.scan(INDENT_PATTERN).min_by(&:length) source.gsub(/^#{indent}/, '') end end # StripHelper end # Unparser
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
unparser-0.1.9 | lib/unparser/strip_helper.rb |
unparser-0.1.8 | lib/unparser/strip_helper.rb |