Commit 3473873

mo <mo@mokhan.ca>
2018-03-16 20:02:10
move xsd constants to xsd_validatable.
1 parent b0666fd
Changed files (3)
lib/saml/kit/concerns/xsd_validatable.rb
@@ -5,6 +5,14 @@ module Saml
     # This module is responsible for validating
     # xml documents against the SAML XSD's
     module XsdValidatable
+      PROTOCOL_XSD = File.expand_path(
+        '../xsd/saml-schema-protocol-2.0.xsd', File.dirname(__FILE__)
+      ).freeze
+
+      METADATA_XSD = File.expand_path(
+        '../xsd/saml-schema-metadata-2.0.xsd', File.dirname(__FILE__)
+      ).freeze
+
       # @!visibility private
       def matches_xsd?(xsd)
         Dir.chdir(File.dirname(xsd)) do
lib/saml/kit/document.rb
@@ -9,9 +9,6 @@ module Saml
       include Translatable
       include Trustable
       include Buildable
-      PROTOCOL_XSD = File.expand_path(
-        './xsd/saml-schema-protocol-2.0.xsd', File.dirname(__FILE__)
-      ).freeze
       NAMESPACES = {
         "NameFormat": ::Saml::Kit::Namespaces::ATTR_SPLAT,
         "ds": ::Xml::Kit::Namespaces::XMLDSIG,
lib/saml/kit/metadata.rb
@@ -30,9 +30,6 @@ module Saml
       include XsdValidatable
       include Translatable
       include Buildable
-      METADATA_XSD = File.expand_path(
-        './xsd/saml-schema-metadata-2.0.xsd', File.dirname(__FILE__)
-      ).freeze
       NAMESPACES = {
         NameFormat: Namespaces::ATTR_SPLAT,
         ds: ::Xml::Kit::Namespaces::XMLDSIG,