Sha256: 9b1b70487a32fc368d4a5fe5a28523e760c52efcb2b688185ba3b6514f673c03
Contents?: true
Size: 578 Bytes
Versions: 17
Compression:
Stored size: 578 Bytes
Contents
# encoding: utf-8 module Nanoc::StringExtensions # Transforms string into an actual identifier # # @return [String] The identifier generated from the receiver def cleaned_identifier "/#{self}/".gsub(/^\/+|\/+$/, '/') end # Calculates the checksum for this string. Any change to this string will # result in a different checksum. # # @return [String] The checksum for this string # # @api private def checksum digest = Digest::SHA1.new digest.update(self) digest.hexdigest end end class String include Nanoc::StringExtensions end
Version data entries
17 entries across 17 versions & 1 rubygems