Sha256: 1f11d8f5a9c82b1914ee236b9b30dffdc0aafc8b0ce6fc791f0facf73de1745c

Contents?: true

Size: 463 Bytes

Versions: 10

Compression:

Stored size: 463 Bytes

Contents

module Roart
  class ContentFormatter
    # The following is only based on quick trial&error on my part. The RT Api (at least in 3.6) does not have good documentation.
    # Strings in a RT request:
    #  - are not allowed to contain '\r'
    #  - must use equally padded new-lines to distinguish them from the beginning of a new field (we use 2-space padding)
    def self.format_string(string)
      string.gsub("\r", '').gsub("\n", "\n  ")
    end

  end
end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
ludo-roart-0.1.19 lib/roart/core/content_formatter.rb
ludo-roart-0.1.18 lib/roart/core/content_formatter.rb
ludo-roart-0.1.17 lib/roart/core/content_formatter.rb
ludo-roart-0.1.16 lib/roart/core/content_formatter.rb
ludo-roart-0.1.15 lib/roart/core/content_formatter.rb
ludo-roart-0.1.13 lib/roart/core/content_formatter.rb
ludo-roart-0.1.12 lib/roart/core/content_formatter.rb
ludo-roart-0.1.11 lib/roart/core/content_formatter.rb
roart-0.1.10 lib/roart/core/content_formatter.rb
axtro-roart-0.1.9.2 lib/roart/core/content_formatter.rb