Thanks to visit codestin.com
Credit goes to github.com

Skip to content

What's Here for class Dir #4472

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

Merged
merged 3 commits into from
May 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -3448,6 +3448,75 @@ rb_dir_s_empty_p(VALUE obj, VALUE dirname)
* (<code>config.h</code> and <code>main.rb</code>), the parent
* directory (<code>..</code>), and the directory itself
* (<code>.</code>).
*
* == What's Here
*
* \Class \Dir provides methods that are useful for:
*
* - {Reading}[#class-Dir-label-Reading]
* - {Setting}[#class-Dir-label-Setting]
* - {Querying}[#class-Dir-label-Querying]
* - {Iterating}[#class-Dir-label-Iterating]
* - {Other}[#class-Dir-label-Other]
*
* === Reading
*
* - #close:: Closes the directory stream for +self+.
* - #pos=:: Sets the position in the directory stream for +self+.
* - #read:: Reads and returns the next entry in the directory stream for +self+.
* - #rewind:: Sets the position in the directory stream for +self+ to the first entry.
* - #seek:: Sets the position in the directory stream for +self+
* the entry at the given offset.
*
* === Setting
*
* - ::chdir:: Changes the working directory of the current process
* to the given directory.
* - ::chroot:: Changes the file-system root for the current process
* to the given directory.
*
* === Querying
*
* - ::[]:: Same as ::glob without the ability to pass flags.
* - ::children:: Returns an array of names of the children
* (both files and directories) of the given directory,
* but not including <tt>.</tt> or <tt>..</tt>.
* - ::empty?:: Returns whether the given path is an empty directory.
* - ::entries:: Returns an array of names of the children
* (both files and directories) of the given directory,
* including <tt>.</tt> and <tt>..</tt>.
* - ::exist?:: Returns whether the given path is a directory.
* - ::getwd (aliased as #pwd):: Returns the path to the current working directory.
* - ::glob:: Returns an array of file paths matching the given pattern and flags.
* - ::home:: Returns the home directory path for a given user or the current user.
* - #children:: Returns an array of names of the children
* (both files and directories) of +self+,
* but not including <tt>.</tt> or <tt>..</tt>.
* - #fileno:: Returns the integer file descriptor for +self+.
* - #path (aliased as #to_path):: Returns the path used to create +self+.
* - #tell (aliased as #pos):: Returns the integer position
* in the directory stream for +self+.
*
* === Iterating
*
* - ::each_child:: Calls the given block with each entry in the given directory,
* but not including <tt>.</tt> or <tt>..</tt>.
* - ::foreach:: Calls the given block with each entryin the given directory,
* including <tt>.</tt> and <tt>..</tt>.
* - #each:: Calls the given block with each entry in +self+,
* including <tt>.</tt> and <tt>..</tt>.
* - #each_child:: Calls the given block with each entry in +self+,
* but not including <tt>.</tt> or <tt>..</tt>.
*
* === Other
*
* - ::mkdir:: Creates a directory at the given path, with optional permissions.
* - ::new:: Returns a new \Dir for the given path, with optional encoding.
* - ::open:: Same as ::new, but if a block is given, yields the \Dir to the block,
* closing it upon block exit.
* - ::unlink (aliased as ::delete and ::rmdir):: Removes the given directory.
* - #inspect:: Returns a string description of +self+.
*
*/
void
Init_Dir(void)
Expand Down
8 changes: 8 additions & 0 deletions doc/time/zone_and_in.rdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- +zone+: a timezone, which may be:
- A string offset from UTC.
- A single letter offset from UTC, in the range <tt>'A'..'Z'</tt>,
<tt>'J'</tt> (the so-called military timezone) excluded.
- An integer number of seconds.
- A timezone object;
see {Timezone Argument}[#class-Time-label-Timezone+Argument] for details.
- <tt>in: zone</tt>: a timezone _zone_, which may be as above.
2 changes: 1 addition & 1 deletion timev.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Time
# :include: doc/time/year.rdoc
# :include: doc/time/mon-min.rdoc
# :include: doc/time/sec.rdoc
# :include: doc/time/in.rdoc
# :include: doc/time/zone_and_in.rdoc
#
def initialize(year = (now = true), mon = nil, mday = nil, hour = nil, min = nil, sec = nil, zone = nil, in: nil)
if zone
Expand Down