psych 5.0.1-java → 5.1.0.pre1-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -29,14 +29,15 @@ package org.jruby.ext.psych;
29
29
 
30
30
  import org.jruby.Ruby;
31
31
  import org.jruby.RubyClass;
32
+ import org.jruby.RubyException;
32
33
  import org.jruby.RubyModule;
33
34
  import org.jruby.RubyObject;
34
- import org.jruby.RubyException;
35
35
  import org.jruby.anno.JRubyMethod;
36
36
  import org.jruby.exceptions.RaiseException;
37
37
  import org.jruby.runtime.ThreadContext;
38
38
  import org.jruby.runtime.builtin.IRubyObject;
39
- import static org.jruby.runtime.Visibility.*;
39
+
40
+ import static org.jruby.runtime.Visibility.PRIVATE;
40
41
 
41
42
  public class PsychToRuby {
42
43
  public static void initPsychToRuby(Ruby runtime, RubyModule psych) {
data/ext/psych/extconf.rb CHANGED
@@ -22,7 +22,7 @@ if yaml_source
22
22
  args = [
23
23
  yaml_configure,
24
24
  "--enable-#{shared ? 'shared' : 'static'}",
25
- "--host=#{RbConfig::CONFIG['host'].sub(/-unknown-/, '-')}",
25
+ "--host=#{RbConfig::CONFIG['host'].sub(/-unknown-/, '-').sub(/arm64/, 'arm')}",
26
26
  "CC=#{RbConfig::CONFIG['CC']}",
27
27
  *(["CFLAGS=-w"] if RbConfig::CONFIG["GCC"] == "yes"),
28
28
  ]
@@ -35,7 +35,7 @@ module Psych
35
35
 
36
36
  constants.each do |const|
37
37
  konst = const_get const
38
- class_eval <<~RUBY
38
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
39
39
  def #{const.to_s.downcase}
40
40
  load #{konst.inspect}
41
41
  end
@@ -41,7 +41,7 @@ module Psych
41
41
  Sequence
42
42
  Mapping
43
43
  }.each do |node|
44
- class_eval %{
44
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
45
45
  def start_#{node.downcase}(anchor, tag, implicit, style)
46
46
  n = Nodes::#{node}.new(anchor, tag, implicit, style)
47
47
  set_start_location(n)
@@ -54,7 +54,7 @@ module Psych
54
54
  set_end_location(n)
55
55
  n
56
56
  end
57
- }
57
+ RUBY
58
58
  end
59
59
 
60
60
  ###
@@ -2,9 +2,9 @@
2
2
 
3
3
  module Psych
4
4
  # The version of Psych you are using
5
- VERSION = '5.0.1'
5
+ VERSION = '5.1.0.pre1'
6
6
 
7
7
  if RUBY_ENGINE == 'jruby'
8
- DEFAULT_SNAKEYAML_VERSION = '1.33'.freeze
8
+ DEFAULT_SNAKEYAML_VERSION = '2.6'.freeze
9
9
  end
10
10
  end
@@ -568,7 +568,7 @@ module Psych
568
568
  raise BadAlias, "Tried to dump an aliased object"
569
569
  end
570
570
 
571
- unless @permitted_classes[target.class]
571
+ unless Symbol === target || @permitted_classes[target.class]
572
572
  raise DisallowedClass.new('dump', target.class.name || target.class.inspect)
573
573
  end
574
574
 
@@ -576,7 +576,7 @@ module Psych
576
576
  end
577
577
 
578
578
  def visit_Symbol sym
579
- unless @permitted_symbols[sym]
579
+ unless @permitted_classes[Symbol] || @permitted_symbols[sym]
580
580
  raise DisallowedClass.new('dump', "Symbol(#{sym.inspect})")
581
581
  end
582
582
 
data/lib/psych.jar CHANGED
Binary file
data/lib/psych_jars.rb CHANGED
@@ -2,4 +2,4 @@
2
2
  require 'psych.jar'
3
3
 
4
4
  require 'jar-dependencies'
5
- require_jar('org.yaml', 'snakeyaml', Psych::DEFAULT_SNAKEYAML_VERSION)
5
+ require_jar('org.snakeyaml', 'snakeyaml-engine', Psych::DEFAULT_SNAKEYAML_VERSION)
data/psych.gemspec CHANGED
@@ -52,15 +52,16 @@ DESCRIPTION
52
52
  "ext/java/org/jruby/ext/psych/PsychLibrary.java",
53
53
  "ext/java/org/jruby/ext/psych/PsychParser.java",
54
54
  "ext/java/org/jruby/ext/psych/PsychToRuby.java",
55
- "ext/java/org/jruby/ext/psych/PsychYamlTree.java",
56
55
  "lib/psych_jars.rb",
57
56
  "lib/psych.jar"
58
57
  ]
59
- s.requirements = "jar org.yaml:snakeyaml, #{version_module::Psych::DEFAULT_SNAKEYAML_VERSION}"
58
+ s.requirements = "jar org.snakeyaml:snakeyaml-engine, #{version_module::Psych::DEFAULT_SNAKEYAML_VERSION}"
60
59
  s.add_dependency 'jar-dependencies', '>= 0.1.7'
61
60
  else
62
61
  s.extensions = ["ext/psych/extconf.rb"]
63
62
  s.add_dependency 'stringio'
64
63
  end
65
64
 
65
+ s.metadata['msys2_mingw_dependencies'] = 'libyaml'
66
+
66
67
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: psych
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0.pre1
5
5
  platform: java
6
6
  authors:
7
7
  - Aaron Patterson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-12-08 00:00:00.000000000 Z
13
+ date: 2023-01-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  requirement: !ruby/object:Gem::Requirement
@@ -51,7 +51,6 @@ files:
51
51
  - ext/java/org/jruby/ext/psych/PsychLibrary.java
52
52
  - ext/java/org/jruby/ext/psych/PsychParser.java
53
53
  - ext/java/org/jruby/ext/psych/PsychToRuby.java
54
- - ext/java/org/jruby/ext/psych/PsychYamlTree.java
55
54
  - ext/psych/depend
56
55
  - ext/psych/extconf.rb
57
56
  - ext/psych/psych.c
@@ -107,7 +106,8 @@ files:
107
106
  homepage: https://github.com/ruby/psych
108
107
  licenses:
109
108
  - MIT
110
- metadata: {}
109
+ metadata:
110
+ msys2_mingw_dependencies: libyaml
111
111
  post_install_message:
112
112
  rdoc_options:
113
113
  - "--main"
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements:
128
- - jar org.yaml:snakeyaml, 1.33
128
+ - jar org.snakeyaml:snakeyaml-engine, 2.6
129
129
  rubygems_version: 3.3.25
130
130
  signing_key:
131
131
  specification_version: 4
@@ -1,47 +0,0 @@
1
- /***** BEGIN LICENSE BLOCK *****
2
- * Version: EPL 1.0/GPL 2.0/LGPL 2.1
3
- *
4
- * The contents of this file are subject to the Eclipse Public
5
- * License Version 1.0 (the "License"); you may not use this file
6
- * except in compliance with the License. You may obtain a copy of
7
- * the License at http://www.eclipse.org/legal/epl-v10.html
8
- *
9
- * Software distributed under the License is distributed on an "AS
10
- * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
11
- * implied. See the License for the specific language governing
12
- * rights and limitations under the License.
13
- *
14
- * Copyright (C) 2010 Charles O Nutter <headius@headius.com>
15
- *
16
- * Alternatively, the contents of this file may be used under the terms of
17
- * either of the GNU General Public License Version 2 or later (the "GPL"),
18
- * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
19
- * in which case the provisions of the GPL or the LGPL are applicable instead
20
- * of those above. If you wish to allow use of your version of this file only
21
- * under the terms of either the GPL or the LGPL, and not to allow others to
22
- * use your version of this file under the terms of the EPL, indicate your
23
- * decision by deleting the provisions above and replace them with the notice
24
- * and other provisions required by the GPL or the LGPL. If you do not delete
25
- * the provisions above, a recipient may use your version of this file under
26
- * the terms of any one of the EPL, the GPL or the LGPL.
27
- ***** END LICENSE BLOCK *****/
28
- package org.jruby.ext.psych;
29
-
30
- import org.jruby.Ruby;
31
- import org.jruby.RubyClass;
32
- import org.jruby.RubyModule;
33
- import org.jruby.RubyObject;
34
- import org.jruby.anno.JRubyMethod;
35
- import org.jruby.runtime.ThreadContext;
36
- import org.jruby.runtime.builtin.IRubyObject;
37
- import static org.jruby.runtime.Visibility.*;
38
-
39
- public class PsychYamlTree {
40
- public static void initPsychYamlTree(Ruby runtime, RubyModule psych) {
41
- RubyModule visitors = (RubyModule)psych.getConstant("Visitors");
42
- RubyClass visitor = (RubyClass)visitors.getConstant("Visitor");
43
- RubyClass psychYamlTree = runtime.defineClassUnder("YAMLTree", visitor, RubyObject.OBJECT_ALLOCATOR, visitors);
44
-
45
- psychYamlTree.defineAnnotatedMethods(PsychYamlTree.class);
46
- }
47
- }