Sha256: d89b8c310aeef246de9a1ca8126d5913aa625b9882dd723fc57938d569ea0be7
Contents?: true
Size: 854 Bytes
Versions: 6
Compression:
Stored size: 854 Bytes
Contents
require 'digest/md5' require 'nokogiri' require 'bluecloth' require 'sanitize' module Rad::TextUtils; end %w( processor github_flavoured_markdown image_box custom_markdown urls tag_shortcuts html_sanitizer ensure_utf truncate code_highlighter truncator markup ).each{|f| require "kit/text_utils/#{f}"} module Rad::TextUtils class << self def markup text Rad::TextUtils::Markup.new.process text, {} end def random_string length = 3 @digits ||= ('a'..'z').to_a + (0..9).to_a (0..(length-1)).map{@digits[rand(@digits.size)]}.join end def truncate str_or_html, length Rad::TextUtils::Truncator.new(nil, length).process str_or_html, {} # str_or_html = HtmlSanitizer.new.process str_or_html, {} # Truncator.new(length).process str_or_html end end end
Version data entries
6 entries across 6 versions & 1 rubygems