Skip to content

Commit 934b858

Browse files
committed
📚 Fixing and formatting docs
Mostly fixing formatting... but a few errors were fixed too: * `SASL::Authenticators#add_authenticator` does not print any warnings. * `#select` should not use `@responses` ivar in example code.
1 parent 15d511d commit 934b858

File tree

2 files changed

+21
-24
lines changed

2 files changed

+21
-24
lines changed

lib/net/imap.rb

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ def capability
10451045
# ===== Capabilities
10461046
#
10471047
# The server's capabilities must include +ID+
1048-
# [RFC2971[https://tools.ietf.org/html/rfc2971]]
1048+
# [RFC2971[https://tools.ietf.org/html/rfc2971]].
10491049
def id(client_id=nil)
10501050
synchronize do
10511051
send_command("ID", ClientID.new(client_id))
@@ -1058,7 +1058,7 @@ def id(client_id=nil)
10581058
#
10591059
# This allows the server to send unsolicited untagged EXPUNGE #responses,
10601060
# but does not execute any client request. \IMAP servers are permitted to
1061-
# send unsolicited untagged responses at any time, except for `EXPUNGE`.
1061+
# send unsolicited untagged responses at any time, except for +EXPUNGE+:
10621062
#
10631063
# * +EXPUNGE+ can only be sent while a command is in progress.
10641064
# * +EXPUNGE+ must _not_ be sent during #fetch, #store, or #search.
@@ -1143,10 +1143,7 @@ def starttls(**options)
11431143
end
11441144

11451145
# :call-seq:
1146-
# authenticate(mechanism, *,
1147-
# sasl_ir: true,
1148-
# registry: Net::IMAP::SASL.authenticators,
1149-
# **, &) -> ok_resp
1146+
# authenticate(mechanism, *, sasl_ir: true, registry: Net::IMAP::SASL.authenticators, **, &) -> ok_resp
11501147
#
11511148
# Sends an {AUTHENTICATE command [IMAP4rev1 §6.2.2]}[https://www.rfc-editor.org/rfc/rfc3501#section-6.2.2]
11521149
# to authenticate the client. If successful, the connection enters the
@@ -1330,7 +1327,7 @@ def login(user, password)
13301327
# the server may return an untagged "NO" response with a "UIDNOTSTICKY"
13311328
# response code indicating that the mailstore does not support persistent
13321329
# UIDs:
1333-
# @responses["NO"].last.code.name == "UIDNOTSTICKY"
1330+
# imap.responses("NO", &:last)&.code&.name == "UIDNOTSTICKY"
13341331
def select(mailbox)
13351332
synchronize do
13361333
@responses.clear
@@ -1420,10 +1417,10 @@ def unsubscribe(mailbox)
14201417
# to the client. +refname+ provides a context (for instance, a base
14211418
# directory in a directory-based mailbox hierarchy). +mailbox+ specifies a
14221419
# mailbox or (via wildcards) mailboxes under that context. Two wildcards
1423-
# may be used in +mailbox+: '*', which matches all characters *including*
1424-
# the hierarchy delimiter (for instance, '/' on a UNIX-hosted
1425-
# directory-based mailbox hierarchy); and '%', which matches all characters
1426-
# *except* the hierarchy delimiter.
1420+
# may be used in +mailbox+: <tt>"*"</tt>, which matches all characters
1421+
# *including* the hierarchy delimiter (for instance, "/" on a UNIX-hosted
1422+
# directory-based mailbox hierarchy); and <tt>"%"</tt>, which matches all
1423+
# characters *except* the hierarchy delimiter.
14271424
#
14281425
# If +refname+ is empty, +mailbox+ is used directly to determine
14291426
# which mailboxes to match. If +mailbox+ is empty, the root
@@ -1471,16 +1468,16 @@ def list(refname, mailbox)
14711468
# servers, then folder creation (and listing, moving, etc) can lead to
14721469
# errors.
14731470
#
1474-
# From RFC2342:
1475-
#
1476-
# Although typically a server will support only a single Personal
1471+
# From RFC2342[https://tools.ietf.org/html/rfc2342]:
1472+
# >>>
1473+
# <em>Although typically a server will support only a single Personal
14771474
# Namespace, and a single Other User's Namespace, circumstances exist
14781475
# where there MAY be multiples of these, and a client MUST be prepared
14791476
# for them. If a client is configured such that it is required to create
14801477
# a certain mailbox, there can be circumstances where it is unclear which
14811478
# Personal Namespaces it should create the mailbox in. In these
14821479
# situations a client SHOULD let the user select which namespaces to
1483-
# create the mailbox in.
1480+
# create the mailbox in.</em>
14841481
#
14851482
# Related: #list, Namespaces, Namespace
14861483
#
@@ -1668,9 +1665,9 @@ def lsub(refname, mailbox)
16681665
# or more attributes whose statuses are to be requested. Supported
16691666
# attributes include:
16701667
#
1671-
# MESSAGES:: the number of messages in the mailbox.
1672-
# RECENT:: the number of recent messages in the mailbox.
1673-
# UNSEEN:: the number of unseen messages in the mailbox.
1668+
# MESSAGES:: the number of messages in the mailbox.
1669+
# RECENT:: the number of recent messages in the mailbox.
1670+
# UNSEEN:: the number of unseen messages in the mailbox.
16741671
#
16751672
# The return value is a hash of attributes. For example:
16761673
#
@@ -1935,11 +1932,11 @@ def uid_fetch(set, attr, mod = nil)
19351932
# to alter data associated with messages in the mailbox, in particular their
19361933
# flags. The +set+ parameter is a number, an array of numbers, or a Range
19371934
# object. Each number is a message sequence number. +attr+ is the name of a
1938-
# data item to store: 'FLAGS' will replace the message's flag list with the
1939-
# provided one, '+FLAGS' will add the provided flags, and '-FLAGS' will
1940-
# remove them. +flags+ is a list of flags.
1935+
# data item to store: <tt>"FLAGS"</tt> will replace the message's flag list
1936+
# with the provided one, <tt>"+FLAGS"</tt> will add the provided flags, and
1937+
# <tt>"-FLAGS"</tt> will remove them. +flags+ is a list of flags.
19411938
#
1942-
# The return value is an array of FetchData
1939+
# The return value is an array of FetchData.
19431940
#
19441941
# Related: #uid_store
19451942
#

lib/net/imap/sasl/authenticators.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ def names; @authenticators.keys end
5858
# {SASL mechanism}[https://www.iana.org/assignments/sasl-mechanisms/sasl-mechanisms.xhtml]
5959
# implemented by +authenticator_class+ (for instance, <tt>"PLAIN"</tt>).
6060
#
61-
# If +mechanism+ refers to an existing authenticator, a warning will be
62-
# printed and the old authenticator will be replaced.
61+
# If +mechanism+ refers to an existing authenticator,
62+
# the old authenticator will be replaced.
6363
#
6464
# When only a single argument is given, the authenticator class will be
6565
# lazily loaded from <tt>Net::IMAP::SASL::#{name}Authenticator</tt> (case is

0 commit comments

Comments
 (0)