FileUtils.chmod("a+r", "foobar", verbose: true) crashes
To reproduce in IRB:
require "fileutils" ; FileUtils.chmod("a+r", "foobar", verbose: true)
Here's the stack:
NoMethodError: undefined method
mode_to_s' for FileUtils:Modulechmod'
This ONLY crashes with :verbose. If you leave off :verbose it skips the call to mode_to_s, so there's no crash.
- Backport changed from 1.9.3: UNKNOWN, 2.0.0: UNKNOWN to 1.9.3: DONTNEED, 2.0.0: REQUIRED
I submitted a pull request on the GitHub mirror which fixes the issue. Whether it's the correct fix I can't be certain, as I've not submitted code to Ruby core before :)
Seems there is no tests for module methods.
- Status changed from Open to Feedback
- Backport deleted (
1.9.3: DONTNEED, 2.0.0: REQUIRED)
- Status changed from Feedback to Third Party's Issue
I guess it was fixed at r41853 before v2_1_0_preview1 and backported to ruby2_0_0 at r41946 [Backport #8633].
- Related to Backport #8633: backport r41853 (fix File.chmod error in :verbose mode) added
Also available in: Atom