Skip to content

Commit e7c8de3

Browse files
committed
Remove Dir.chdir
1 parent 40250eb commit e7c8de3

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/ruby_saml/saml_message.rb

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

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

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

0 commit comments

Comments
 (0)