Sha256: 86e06d031b979722ac8e4c16ce98c86209477230c18ec7e2884ac6e51ff8ff5a

Contents?: true

Size: 589 Bytes

Versions: 15

Compression:

Stored size: 589 Bytes

Contents

# frozen_string_literal: true

module CqmValidators
  module BaseValidator
    def build_error(msg, loc, file_name)
      ValidationError.new(message: msg, location: loc, file_name: file_name, validator: @name)
    end

    def get_document(input)
      doc = case input
            when File
              input.rewind
              input.read
            when Nokogiri::XML::Document
              return input
            else
              input
            end
      Nokogiri::XML(doc.to_s) { |conf| conf.strict.nonet.noblanks } # grumble, grumble nokogiri java @SS
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
cqm-validators-4.0.5 lib/base_validator.rb
cqm-validators-4.0.4 lib/base_validator.rb
cqm-validators-4.0.3 lib/base_validator.rb
cqm-validators-4.0.2 lib/base_validator.rb
cqm-validators-4.0.1 lib/base_validator.rb
cqm-validators-3.1.3 lib/base_validator.rb
cqm-validators-4.0.0 lib/base_validator.rb
cqm-validators-3.1.2 lib/base_validator.rb
cqm-validators-3.1.1 lib/base_validator.rb
cqm-validators-2.0.2 lib/base_validator.rb
cqm-validators-3.0.1 lib/base_validator.rb
cqm-validators-3.0.0 lib/base_validator.rb
cqm-validators-2.0.1 lib/base_validator.rb
cqm-validators-2.0.0 lib/base_validator.rb
cqm-validators-1.0.1.0 lib/base_validator.rb