Sha256: bdbdf5d4537e05d17bb6e1abe5b560e063bab15743ce30e30d0af472f9de7653

Contents?: true

Size: 296 Bytes

Versions: 4

Compression:

Stored size: 296 Bytes

Contents

# encoding: utf-8

module Nanoc3::StringExtensions

  # Transforms string into an actual identifier
  #
  # @return [String] The identifier generated from the receiver
  def cleaned_identifier
    "/#{self}/".gsub(/^\/+|\/+$/, '/')
  end

end

class String
  include Nanoc3::StringExtensions
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
nanoc3-3.1.0b1 lib/nanoc3/base/core_ext/string.rb
nanoc3-3.1.0a3 lib/nanoc3/base/core_ext/string.rb
nanoc3-3.1.0a2 lib/nanoc3/base/core_ext/string.rb
nanoc3-3.1.0a1 lib/nanoc3/base/core_ext/string.rb