New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dir#glob and escaped commas #1842

Closed
robin850 opened this Issue Jul 21, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@robin850
Contributor

robin850 commented Jul 21, 2014

Hello,

Dealing with a glob wrapped inside braces and a folder name containing commas, JRuby will ignore the escaping on commas and consider that the glob is in two parts so for instance, in the following example, JRuby will search for text files on the whole disk :

>> glob = '{i\,dont\,exist\,/**/*.txt}';

>> RUBY_ENGINE
=> "jruby"
>> Dir[glob]
=> ["/install.txt", "/etc/urls.txt", ...]

>> RUBY_ENGINE
=> "ruby"
>> Dir[glob]
=> []

For the record, this makes this test to fail in the Ruby on Rails test suite as searching files on the whole disk takes time and the Thread running this statement only has 5 seconds to run.

A RubySpec has been added for that in rubyspec/rubyspec#281.

Have a nice day.

@robin850

This comment has been minimized.

Show comment
Hide comment
@robin850

robin850 Jan 20, 2017

Contributor

@kares : Thank you very much ! :-) ❤️

Contributor

robin850 commented Jan 20, 2017

@kares : Thank you very much ! :-) ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment