summaryrefslogtreecommitdiff
path: root/ext/psych/lib
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-21 17:55:23 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-21 17:55:23 +0000
commit226c6a1bdc6a50af1b6a7c374a1268f51a5bc23c (patch)
treed6325105afc9aefcbd3b3e177f8f036e66195e9f /ext/psych/lib
parent2a1569d6932b843b4b02883685fa05cd3c82d992 (diff)
* ext/psych/*: update to Psych 2.0.14
* test/psych/*: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/psych/lib')
-rw-r--r--ext/psych/lib/psych.rb10
-rw-r--r--ext/psych/lib/psych/versions.rb3
-rw-r--r--ext/psych/lib/psych/visitors/to_ruby.rb4
-rw-r--r--ext/psych/lib/psych_jars.rb5
4 files changed, 18 insertions, 4 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 085e828224..ef8f12a472 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -1,4 +1,10 @@
-require 'psych.so'
+case RUBY_ENGINE
+when 'jruby'
+ require 'psych_jars'
+ org.jruby.ext.psych.PsychLibrary.new.load(JRuby.runtime, false)
+else
+ require 'psych.so'
+end
require 'psych/nodes'
require 'psych/streaming'
require 'psych/visitors'
@@ -217,7 +223,7 @@ require 'psych/class_loader'
module Psych
# The version is Psych you're using
- VERSION = '2.0.13'
+ VERSION = '2.0.14'
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
diff --git a/ext/psych/lib/psych/versions.rb b/ext/psych/lib/psych/versions.rb
new file mode 100644
index 0000000000..530d310f44
--- /dev/null
+++ b/ext/psych/lib/psych/versions.rb
@@ -0,0 +1,3 @@
+module Psych
+ DEFAULT_SNAKEYAML_VERSION = '1.14'.freeze
+end
diff --git a/ext/psych/lib/psych/visitors/to_ruby.rb b/ext/psych/lib/psych/visitors/to_ruby.rb
index b68abb6919..ea3ab1c479 100644
--- a/ext/psych/lib/psych/visitors/to_ruby.rb
+++ b/ext/psych/lib/psych/visitors/to_ruby.rb
@@ -61,7 +61,7 @@ module Psych
case o.tag
when '!binary', 'tag:yaml.org,2002:binary'
o.value.unpack('m').first
- when /^!(?:str|ruby\/string)(?::(.*))?/, 'tag:yaml.org,2002:str'
+ when /^!(?:str|ruby\/string)(?::(.*))?$/, 'tag:yaml.org,2002:str'
klass = resolve_class($1)
if klass
klass.allocate.replace o.value
@@ -208,7 +208,7 @@ module Psych
obj
end
- when /^!(?:str|ruby\/string)(?::(.*))?/, 'tag:yaml.org,2002:str'
+ when /^!(?:str|ruby\/string)(?::(.*))?$/, 'tag:yaml.org,2002:str'
klass = resolve_class($1)
members = {}
string = nil
diff --git a/ext/psych/lib/psych_jars.rb b/ext/psych/lib/psych_jars.rb
new file mode 100644
index 0000000000..795c7ea4a8
--- /dev/null
+++ b/ext/psych/lib/psych_jars.rb
@@ -0,0 +1,5 @@
+require 'psych/versions'
+require 'psych.jar'
+
+require 'jar-dependencies'
+require_jar('org.yaml', 'snakeyaml', Psych::DEFAULT_SNAKEYAML_VERSION)