Sha256: ca9e52154c8d7a519f0dacfcfaa1351ff0b70e036e087fddd97cdc498817f21b

Contents?: true

Size: 514 Bytes

Versions: 35

Compression:

Stored size: 514 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  
      def pluralize(count=nil)
        count == 1 ? self : ActiveSupport::Inflector.pluralize(self)
      end
    end
  end
end
String.send(:include, Cms::Extensions::String)

Version data entries

35 entries across 35 versions & 11 rubygems

Version Path
browsercms-3.1.0 lib/cms/extensions/string.rb
we5-browsercms-3.1.0 lib/cms/extensions/string.rb
browsercms-3.0.6 lib/cms/extensions/string.rb
browsercms-3.0.5 lib/cms/extensions/string.rb
we5-browsercms-3.0.5.1 lib/cms/extensions/string.rb
we5-browsercms-3.0.5 lib/cms/extensions/string.rb
browsercms_s3-3.0.5 lib/cms/extensions/string.rb
browsercms-3.0.4 lib/cms/extensions/string.rb
browsercms-3.0.3 lib/cms/extensions/string.rb
browsercms_s3-3.0.4 lib/cms/extensions/string.rb
browsercms_s3-3.0.3 lib/cms/extensions/string.rb
we5-browsercms-3.0.2 lib/cms/extensions/string.rb
browsercms-3.0.2 lib/cms/extensions/string.rb
browsercms-3.0.1 lib/cms/extensions/string.rb
browsercms-3.0.0 lib/cms/extensions/string.rb