Sha256: 48174c5751e6633ff8d3a3d47aa001535564b8ad56b68b8b5b76ca3c9b031c1c

Contents?: true

Size: 513 Bytes

Versions: 5

Compression:

Stored size: 513 Bytes

Contents

require 'puppet/util'

# The module for various puppet-strings utility helpers.
module PuppetStrings::Yard::Util
  # Trims indentation from trailing whitespace and removes ruby literal quotation
  # syntax `%Q{}` and `%{q}` from parsed strings.
  # @param [String] str The string to scrub.
  # @return [String] A scrubbed string.
  def self.scrub_string(str)
    match = str.match(/^%[Qq]{(.*)}$/m)
    if match
      return Puppet::Util::Docs.scrub(match[1])
    end

    Puppet::Util::Docs.scrub(str)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-strings-1.2.1 lib/puppet-strings/yard/util.rb
puppet-strings-1.2.0 lib/puppet-strings/yard/util.rb
puppet-strings-1.1.1 lib/puppet-strings/yard/util.rb
puppet-strings-1.1.0 lib/puppet-strings/yard/util.rb
puppet-strings-1.0.0 lib/puppet-strings/yard/util.rb