summaryrefslogtreecommitdiff
path: root/lib/psych.rb
diff options
context:
space:
mode:
authorSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-07-12 12:16:03 +0900
committerSHIBATA Hiroshi <hsbt@ruby-lang.org>2017-07-12 12:16:03 +0900
commitb1d3b0a3f72b4c9dc40f81dceb9aca93614cd84b (patch)
treea3396a5655dad69e4102eedb970f8ae92d5567f6 /lib/psych.rb
parent2190eb07f34e205d8f6239000e4f037725a4e1eb (diff)
downloadpsych-b1d3b0a3f72b4c9dc40f81dceb9aca93614cd84b.zip
Added cross compilation task for mingw platform
Diffstat (limited to 'lib/psych.rb')
-rw-r--r--lib/psych.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/psych.rb b/lib/psych.rb
index 2fed434..76ed7d1 100644
--- a/lib/psych.rb
+++ b/lib/psych.rb
@@ -5,7 +5,11 @@ when 'jruby'
require 'psych_jars'
org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
else
- require 'psych.so'
+ begin
+ require "psych/#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
+ rescue LoadError
+ require 'psych.so'
+ end
end
require 'psych/nodes'
require 'psych/streaming'