From: "boris_stitnicky (Boris Stitnicky)" Date: 2012-11-20T06:41:18+09:00 Subject: [ruby-core:49613] [ruby-trunk - Feature #6811] File, Dir and FileUtils should have bang-versions of singleton methods that fails silently Issue #6811 has been updated by boris_stitnicky (Boris Stitnicky). First, let me apologize to everyone for expressing opinion, while having relatively little experience. I like your proposal, but I am concerned about feature creep. Maybe those convenience features should go to stdlib, just like eg. require 'mathn' changes math behavior, we could have require 'fileboost' or something making FileUtils fatter. I think that in the future, there will be many amazing proposals for FileUtils functionality, like yours here, so the best of them could go to this 'fileboost' or whatever other name would it have. ---------------------------------------- Feature #6811: File, Dir and FileUtils should have bang-versions of singleton methods that fails silently https://bugs.ruby-lang.org/issues/6811#change-33128 Author: prijutme4ty (Ilya Vorontsov) Status: Open Priority: Normal Assignee: Category: Target version: I found that often write Dir.mkdir(folder) unless Dir.exist? folder and similar code for rm, rm_rf and so on We can simply make bang-versions like def Dir.mkdir!(folder, permissions=0744) Dir.mkdir(folder, permissions) unless Dir.exist? folder # or another alternative Dir.mkdir(folder, permissions) rescue false end -- http://bugs.ruby-lang.org/