From 0b396d588060707e227f21b80e964180674c8a50 Mon Sep 17 00:00:00 2001 From: hsbt Date: Fri, 14 Jul 2017 06:15:58 +0000 Subject: Merge psych-3.0.0.beta3 from ruby/psych. * Rely on encoding tags to determine if string should be dumped as binary. https://github.com/ruby/psych/commit/8949a47b8cee31e03e21608406ba116adcf74054 * Specify "frozen_string_literal: true". * Support to binary release for mingw32 platform. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/psych/lib/psych.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ext/psych/lib/psych.rb') diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index 9959320a7f..e93ac8f406 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/lib/psych.rb @@ -1,11 +1,15 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'psych/versions' case RUBY_ENGINE when 'jruby' require 'psych_jars' org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false) else - require 'psych.so' + begin + require "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so" + rescue LoadError + require 'psych.so' + end end require 'psych/nodes' require 'psych/streaming' -- cgit v1.2.1