Sha256: c13a8d829d6733cc9be5b3ab9213f541204ed50b8e34c03492789ed11af5430c

Contents?: true

Size: 567 Bytes

Versions: 1

Compression:

Stored size: 567 Bytes

Contents

# @api private
module Nanoc::StringExtensions
  # Transforms string into an actual identifier
  #
  # @return [String] The identifier generated from the receiver
  def __nanoc_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 __nanoc_checksum
    Nanoc::Int::Checksummer.calc(self)
  end
end

# @api private
class String
  include Nanoc::StringExtensions
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nanoc-4.0.0b3 lib/nanoc/base/core_ext/string.rb