Permalink
Browse files

Update to snakeyaml 1.17.

I had to hard-code two places that referenced a constant under
Psych because neither the Rakefile nor a "gem build" loads that
file. It was picking up the older version in my current JRuby
process.
  • Loading branch information...
1 parent cf1264d commit 146a637e2205b2b36a6fa83fc0c6f7ce0c74e123 @headius headius committed Nov 17, 2016
Showing with 5 additions and 6 deletions.
  1. +1 −1 Rakefile
  2. +2 −3 ext/java/PsychParser.java
  3. +1 −1 lib/psych/versions.rb
  4. +1 −1 psych.gemspec
View
@@ -15,7 +15,7 @@ if RUBY_PLATFORM =~ /java/
# and tell maven via system properties the snakeyaml version
# this is basically the same as running from the commandline:
# rmvn dependency:build-classpath -Dsnakeyaml.version='use version from Psych::DEFAULT_SNAKEYAML_VERSION here'
- Maven::Ruby::Maven.new.exec( 'dependency:build-classpath', "-Dsnakeyaml.version=#{Psych::DEFAULT_SNAKEYAML_VERSION}", '-Dverbose=true')#, '--quiet' )
+ Maven::Ruby::Maven.new.exec( 'dependency:build-classpath', "-Dsnakeyaml.version=1.17", '-Dverbose=true')#, '--quiet' )
ext.source_version = '1.7'
ext.target_version = '1.7'
ext.classpath = File.read('pkg/classpath')
@@ -241,10 +241,9 @@ public IRubyObject parse(ThreadContext context, IRubyObject yaml, IRubyObject pa
private void handleDocumentStart(ThreadContext context, DocumentStartEvent dse, boolean tainted, IRubyObject handler) {
Ruby runtime = context.runtime;
DumperOptions.Version _version = dse.getVersion();
- Integer[] versionInts = _version == null ? null : _version.getArray();
- IRubyObject version = versionInts == null ?
+ IRubyObject version = _version == null ?
RubyArray.newArray(runtime) :
- RubyArray.newArray(runtime, runtime.newFixnum(versionInts[0]), runtime.newFixnum(versionInts[1]));
+ RubyArray.newArray(runtime, runtime.newFixnum(_version.major()), runtime.newFixnum(_version.minor()));
Map<String, String> tagsMap = dse.getTags();
RubyArray tags = RubyArray.newArray(runtime);
@@ -1,4 +1,4 @@
# frozen_string_literal: false
module Psych
- DEFAULT_SNAKEYAML_VERSION = '1.14'.freeze
+ DEFAULT_SNAKEYAML_VERSION = '1.17'.freeze
end
View
@@ -32,7 +32,7 @@ DESCRIPTION
if RUBY_PLATFORM =~ /java/
require 'psych/versions'
s.platform = 'java'
- s.requirements = "jar org.yaml:snakeyaml, #{Psych::DEFAULT_SNAKEYAML_VERSION}"
+ s.requirements = "jar org.yaml:snakeyaml, 1.17"
s.add_dependency 'jar-dependencies', '>= 0.1.7'
s.add_development_dependency 'ruby-maven'
else

0 comments on commit 146a637

Please sign in to comment.