Skip to content
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
Closed

Dir#glob and escaped commas #1842

robin850 opened this issue Jul 21, 2014 · 1 comment

Comments

@robin850
Copy link
Contributor

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
Copy link
Contributor Author

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

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

No branches or pull requests

2 participants