File: xml.rb

package info (click to toggle)
ruby-webmock 3.26.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,196 kB
  • sloc: ruby: 12,905; makefile: 6
file content (16 lines) | stat: -rw-r--r-- 340 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require_relative "parse_error"
require "crack/xml"

module WebMock
  module Util
    module Parsers
      class XML
        def self.parse(xml)
          ::Crack::XML.parse(xml)
        rescue ::REXML::ParseException => e
          raise ParseError, "Invalid XML string: #{xml}, Error: #{e.inspect}"
        end
      end
    end
  end
end