class Specinfra::Backend::PowerShell::Command

Public Instance Methods

convert_regexp(target) click to toggle source

Do a better job at escaping regexes, handle both LF and CRLF (YAY!)

# File lib/beaker-rspec/helpers/serverspec.rb, line 153
def convert_regexp(target)
  case target
  when Regexp
    target.source
  else
    Regexp.escape(target.to_s.gsub('/', '\/')).gsub('\n', '(\r\n|\n)')
  end
end