File tree Expand file tree Collapse file tree
ext/java/org/jruby/ext/psych Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4141import org .jruby .runtime .builtin .IRubyObject ;
4242import org .jruby .runtime .load .Library ;
4343
44+ import org .snakeyaml .engine .v2 .common .SpecVersion ;
45+
4446import java .io .IOException ;
4547import java .io .InputStream ;
4648import java .util .Properties ;
4749
4850public class PsychLibrary implements Library {
51+
52+ private static final String POM_PROPERTIES = "META-INF/maven/org.snakeyaml/snakeyaml-engine/pom.properties" ;
4953 private static final String DUMMY_VERSION = "0.0" ;
5054
5155 public void load (final Ruby runtime , boolean wrap ) {
5256 RubyModule psych = runtime .defineModule ("Psych" );
5357
5458 // load version from properties packed with the jar
5559 Properties props = new Properties ();
56- try ( InputStream is = runtime . getJRubyClassLoader () .getResourceAsStream ("META-INF/maven/org.snakeyaml/snakeyaml-engine/pom.properties" ) ) {
57- props .load (is );
60+ try ( InputStream is = SpecVersion . class .getResourceAsStream (POM_PROPERTIES ) ) {
61+ if ( is != null ) props .load (is );
5862 }
5963 catch ( IOException e ) {
6064 // ignored
You can’t perform that action at this time.
0 commit comments