Skip to content

Commit a1f2f7d

Browse files
committed
remove Dir.chdir
1 parent 21b676b commit a1f2f7d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/onelogin/ruby-saml/saml_message.rb

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,13 @@ class SamlMessage
1919
PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol".freeze
2020

2121
BASE64_FORMAT = %r(\A([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?\Z)
22-
@@mutex = Mutex.new
2322

2423
# @return [Nokogiri::XML::Schema] Gets the schema object of the SAML 2.0 Protocol schema
2524
#
2625
def self.schema
27-
@@mutex.synchronize do
28-
Dir.chdir(File.expand_path("../../../schemas", __FILE__)) do
29-
::Nokogiri::XML::Schema(File.read("saml-schema-protocol-2.0.xsd"))
30-
end
26+
path = File.expand_path("../../../schemas/saml-schema-protocol-2.0.xsd", __FILE__)
27+
File.open(path) do |file|
28+
::Nokogiri::XML::Schema(file)
3129
end
3230
end
3331

0 commit comments

Comments
 (0)