PATH:
opt
/
alt
/
ruby40
/
share
/
ruby
# frozen_string_literal: true # # = pathname.rb # # Object-Oriented Pathname Class # # Author:: Tanaka Akira <akr@m17n.org> # Documentation:: Author and Gavin Sinclair # # For documentation, see class Pathname. # class Pathname # * Find * # # Iterates over the directory tree in a depth first manner, yielding a # Pathname for each file under "this" directory. # # Note that you need to require 'pathname' to use this method. # # Returns an Enumerator if no block is given. # # Since it is implemented by the standard library module Find, Find.prune can # be used to control the traversal. # # If +self+ is +.+, yielded pathnames begin with a filename in the # current directory, not +./+. # # See Find.find # 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, ignore_error: ignore_error) {|f| yield self.class.new(f.delete_prefix('./')) } else Find.find(@path, ignore_error: ignore_error) {|f| yield self.class.new(f) } end end end class Pathname # * FileUtils * # Recursively deletes a directory, including all directories beneath it. # # Note that you need to require 'pathname' to use this method. # # See FileUtils.rm_rf def rmtree(noop: nil, verbose: nil, secure: nil) # The name "rmtree" is borrowed from File::Path of Perl. # File::Path provides "mkpath" and "rmtree". require 'fileutils' FileUtils.rm_rf(@path, noop: noop, verbose: verbose, secure: secure) self end end class Pathname # * tmpdir * # Creates a tmp directory and wraps the returned path in a Pathname object. # # Note that you need to require 'pathname' to use this method. # # See Dir.mktmpdir def self.mktmpdir require 'tmpdir' unless defined?(Dir.mktmpdir) if block_given? Dir.mktmpdir do |dir| dir = self.new(dir) yield dir end else self.new(Dir.mktmpdir) end end end
[-] json.rb
[edit]
[+]
vendor_ruby
[-] expect.rb
[edit]
[-] optionparser.rb
[edit]
[+]
prism
[-] coverage.rb
[edit]
[+]
random
[+]
optparse
[-] pathname.rb
[edit]
[+]
forwardable
[+]
psych
[+]
bigdecimal
[-] ipaddr.rb
[edit]
[+]
net
[-] prism.rb
[edit]
[-] open3.rb
[edit]
[-] did_you_mean.rb
[edit]
[+]
digest
[-] English.rb
[edit]
[+]
cgi
[-] resolv.rb
[edit]
[-] mkmf.rb
[edit]
[-] uri.rb
[edit]
[-] securerandom.rb
[edit]
[-] openssl.rb
[edit]
[-] shellwords.rb
[edit]
[+]
syntax_suggest
[-] pp.rb
[edit]
[-] tsort.rb
[edit]
[-] digest.rb
[edit]
[-] monitor.rb
[edit]
[-] weakref.rb
[edit]
[+]
openssl
[+]
strscan
[-] timeout.rb
[edit]
[+]
..
[-] socket.rb
[edit]
[-] tmpdir.rb
[edit]
[-] date.rb
[edit]
[-] time.rb
[edit]
[-] psych.rb
[edit]
[-] tempfile.rb
[edit]
[-] cgi.rb
[edit]
[+]
ripper
[+]
did_you_mean
[+]
set
[+]
open3
[-] prettyprint.rb
[edit]
[+]
uri
[-] syntax_suggest.rb
[edit]
[+]
yaml
[-] forwardable.rb
[edit]
[-] bundled_gems.rb
[edit]
[-] optparse.rb
[edit]
[-] yaml.rb
[edit]
[-] fileutils.rb
[edit]
[+]
unicode_normalize
[-] singleton.rb
[edit]
[-] delegate.rb
[edit]
[+]
json
[+]
error_highlight
[+]
erb
[+]
objspace
[-] error_highlight.rb
[edit]
[-] objspace.rb
[edit]
[-] erb.rb
[edit]
[-] un.rb
[edit]
[-] find.rb
[edit]
[-] ripper.rb
[edit]
[+]
io
[-] open-uri.rb
[edit]