Sha256: f0f023c2ccb247999fa342cd6fc8576913875bb05d30c491dbc27c8b935cc99a

Contents?: true

Size: 462 Bytes

Versions: 6

Compression:

Stored size: 462 Bytes

Contents

module Saml
  module Kit
    module XsdValidatable
      def matches_xsd?(xsd)
        Dir.chdir(File.dirname(xsd)) do
          xsd = Nokogiri::XML::Schema(IO.read(xsd))
          document = Nokogiri::XML(to_xml)
          xsd.validate(document).each do |error|
            errors[:base] << error.message
          end
        end
      end

      def error_message(key)
        I18n.translate(key, scope: "saml/kit.errors.#{name}")
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
saml-kit-0.2.4 lib/saml/kit/xsd_validatable.rb
saml-kit-0.2.3 lib/saml/kit/xsd_validatable.rb
saml-kit-0.2.2 lib/saml/kit/xsd_validatable.rb
saml-kit-0.2.1 lib/saml/kit/xsd_validatable.rb
saml-kit-0.2.0 lib/saml/kit/xsd_validatable.rb
saml-kit-0.1.0 lib/saml/kit/xsd_validatable.rb