Sha256: 02542101a1dc4aaf77de41cb83eb898d7ab96473f486e3e806527d6c3c9a3066

Contents?: true

Size: 356 Bytes

Versions: 10

Compression:

Stored size: 356 Bytes

Contents

module Utils
  # Utility methods for manipulating text
  module Text
    # Try to make names more friendly
    def friendly_name(long_name)
      long_name.split(/\s/).first
    end

    # Strip off bad characters 
    def sanitze_for_chat(text)
      # Remove bash colorings
      text.gsub(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]/, '')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lita-puppet-0.5.5 lib/utils/text.rb
lita-puppet-0.5.4 lib/utils/text.rb
lita-puppet-0.4.5 lib/utils/text.rb
lita-puppet-0.4.4 lib/utils/text.rb
lita-puppet-0.4.3 lib/utils/text.rb
lita-puppet-0.4.2 lib/utils/text.rb
lita-puppet-0.4.1 lib/utils/text.rb
lita-puppet-0.4.0 lib/utils/text.rb
lita-puppet-0.3.1 lib/utils/text.rb
lita-puppet-0.3.0 lib/utils/text.rb