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
Assignees
Milestone

Comments

@robin850
Copy link
Contributor

@robin850 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.

@kares kares added this to the JRuby 9.1.8.0 milestone Jan 20, 2017
@kares kares self-assigned this Jan 20, 2017
@kares kares closed this in 9c88738 Jan 20, 2017
kares added a commit to kares/jruby that referenced this issue Jan 20, 2017
@robin850
Copy link
Contributor Author

@robin850 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.