Method: ChefConfig::PathHelper.printable?

Defined in:
lib/chef-config/path_helper.rb

.printable?(string) ⇒ Boolean



102
103
104
105
106
107
108
109
110
# File 'lib/chef-config/path_helper.rb', line 102

def self.printable?(string)
  # returns true if string is free of non-printable characters (escape sequences)
  # this returns false for whitespace escape sequences as well, e.g. \n\t
  if /[^[:print:]]/.match?(string)
    false
  else
    true
  end
end