Sha256: 80a2e75748b12244918da633684965cf1e70fb7ac33a15e8e7efac186b7a4838

Contents?: true

Size: 351 Bytes

Versions: 10

Compression:

Stored size: 351 Bytes

Contents

module Bixby
  module Debug

    # Simple helper for use in to_s methods
    def self.pretty_str(str) # :nocov:
      if str.nil? then
        "nil"
      elsif str.empty? then
        '""'
      elsif str.include? "\n" then
        "<<-EOF\n" + str + "\nEOF"
      else
        '"' + str + '"'
      end
    end # :nocov:

  end # Debug
end # Bixby

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bixby-common-0.4.0 lib/bixby-common/util/debug.rb
bixby-common-0.3.16 lib/bixby-common/util/debug.rb
bixby-common-0.3.15 lib/bixby_common/util/debug.rb
bixby-common-0.3.14 lib/bixby_common/util/debug.rb
bixby-common-0.3.13 lib/bixby_common/util/debug.rb
bixby-common-0.3.12 lib/bixby_common/util/debug.rb
bixby-common-0.3.11 lib/bixby_common/util/debug.rb
bixby-common-0.3.10 lib/bixby_common/util/debug.rb
bixby-common-0.3.9 lib/bixby_common/util/debug.rb
bixby-common-0.3.8 lib/bixby_common/util/debug.rb