Sha256: 20bac6485e1d38676f82e67b3479aa82512229f5d410acfda7ed6609d98b6cc0
Contents?: true
Size: 764 Bytes
Versions: 34
Compression:
Stored size: 764 Bytes
Contents
module Cms module Extensions module String def indent(n=0) (" "*n.to_i) + self end def markdown Cms.markdown? ? Markdown.new(self).to_html : "<strong>ERROR</strong>: Markdown Support Not Installed" end def to_slug gsub(/\W+/, ' ').strip.downcase.gsub(/\ +/, '-') end # Allows for conditional pluralization of names where object counts are not singular. # # @param [Integer] count The number of objects of this string there are. # @return [String] Plural of string, unless count == 1 def pluralize_unless_one(count=nil) count == 1 ? self : ActiveSupport::Inflector.pluralize(self) end end end end String.send(:include, Cms::Extensions::String)
Version data entries
34 entries across 34 versions & 2 rubygems