Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pathname::glob behavior changed with 9.4.13.0 and later #8973

@robertpanzer

Description

@robertpanzer

This issue relates to asciidoctor/asciidoctorj#1309.

It seems like after JRuby 9.4.13.0 Pathname::glob behaves differently for files below uri:classloader:...
The rouge gem iterates over all .rb files in <rouge gem>/lib/rouge/lexers.
The problematic code looks like this:

                lexer_dir = Pathname::new("uri:classloader:/gems/rouge-3.30.0/lib") / "rouge/lexers/"
                Pathname.glob(lexer_dir / '*.rb').each do |f|
                    puts "found #{f}"
                end

With JRuby 9.4.12.0 the code will print a list of all files like this:

found uri:classloader:/gems/rouge-3.30.0/lib/rouge/lexers/shell.rb
found uri:classloader:/gems/rouge-3.30.0/lib/rouge/lexers/sieve.rb
found uri:classloader:/gems/rouge-3.30.0/lib/rouge/lexers/slice.rb

With JRuby 9.4.13.0 and 10.x it does not match any file anymore.

I have pushed a small reproducer to https://github.com/robertpanzer/jruby-pathname-reproducer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions