summaryrefslogtreecommitdiff
path: root/ext/pathname
diff options
context:
space:
mode:
authorktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-04 15:44:53 +0000
committerktsj <ktsj@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-04 15:44:53 +0000
commitdf0991f34b95e4f6a283c40613aac0334accce1e (patch)
tree6e7a18283edca3fdde2a8f0791671065316f1b3a /ext/pathname
parent77cf13a588be5bab7efa44eccf097ca579a41ae4 (diff)
* ext/pathname/lib/pathname.rb (Pathname#find): add "ignore_error"
keyword argument defaulted to true as well as Find#find. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/pathname')
-rw-r--r--ext/pathname/lib/pathname.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/pathname/lib/pathname.rb b/ext/pathname/lib/pathname.rb
index 46fa72b784..20c92e23dc 100644
--- a/ext/pathname/lib/pathname.rb
+++ b/ext/pathname/lib/pathname.rb
@@ -534,13 +534,13 @@ class Pathname # * Find *
#
# See Find.find
#
- def find # :yield: pathname
- return to_enum(__method__) unless block_given?
+ def find(ignore_error: true) # :yield: pathname
+ return to_enum(__method__, ignore_error: ignore_error) unless block_given?
require 'find'
if @path == '.'
- Find.find(@path) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
+ Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f.sub(%r{\A\./}, '')) }
else
- Find.find(@path) {|f| yield self.class.new(f) }
+ Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f) }
end
end
end