Results for: "Dir.chdir"

Sends a CHECK command to request a checkpoint of the currently selected mailbox. This performs implementation-specific housekeeping; for instance, reconciling the mailbox’s in-memory and on-disk state.

Sends a SEARCH command to search the mailbox for messages that match the given searching criteria, and returns message sequence numbers. keys can either be a string holding the entire search string, or a single-dimension array of search keywords and arguments. The following are some common search criteria; see [IMAP] section 6.4.4 for a full list.

<message set>

a set of message sequence numbers. ‘,’ indicates an interval, ‘:’ indicates a range. For instance, ‘2,10:12,15’ means “2,10,11,12,15”.

BEFORE <date>

messages with an internal date strictly before <date>. The date argument has a format similar to 8-Aug-2002.

BODY <string>

messages that contain <string> within their body.

CC <string>

messages containing <string> in their CC field.

FROM <string>

messages that contain <string> in their FROM field.

NEW

messages with the Recent, but not the Seen, flag set.

NOT <search-key>

negate the following search key.

OR <search-key> <search-key>

“or” two search keys together.

ON <date>

messages with an internal date exactly equal to <date>, which has a format similar to 8-Aug-2002.

SINCE <date>

messages with an internal date on or after <date>.

SUBJECT <string>

messages with <string> in their subject.

TO <string>

messages with <string> in their TO field.

For example:

p imap.search(["SUBJECT", "hello", "NOT", "NEW"])
#=> [1, 6, 7, 8]

Sends a FETCH command to retrieve data associated with a message in the mailbox.

The set parameter is a number or a range between two numbers, or an array of those. The number is a message sequence number, where -1 represents a ‘*’ for use in range notation like 100..-1 being interpreted as ‘100:*’. Beware that the exclude_end? property of a Range object is ignored, and the contents of a range are independent of the order of the range endpoints as per the protocol specification, so 1…5, 5..1 and 5…1 are all equivalent to 1..5.

attr is a list of attributes to fetch; see the documentation for Net::IMAP::FetchData for a list of valid attributes.

The return value is an array of Net::IMAP::FetchData or nil (instead of an empty array) if there is no matching message.

For example:

p imap.fetch(6..8, "UID")
#=> [#<Net::IMAP::FetchData seqno=6, attr={"UID"=>98}>, \\
     #<Net::IMAP::FetchData seqno=7, attr={"UID"=>99}>, \\
     #<Net::IMAP::FetchData seqno=8, attr={"UID"=>100}>]
p imap.fetch(6, "BODY[HEADER.FIELDS (SUBJECT)]")
#=> [#<Net::IMAP::FetchData seqno=6, attr={"BODY[HEADER.FIELDS (SUBJECT)]"=>"Subject: test\r\n\r\n"}>]
data = imap.uid_fetch(98, ["RFC822.SIZE", "INTERNALDATE"])[0]
p data.seqno
#=> 6
p data.attr["RFC822.SIZE"]
#=> 611
p data.attr["INTERNALDATE"]
#=> "12-Oct-2000 22:40:59 +0900"
p data.attr["UID"]
#=> 98

Starts a POP3 session and iterates over each POPMail object, yielding it to the block. This method is equivalent to:

Net::POP3.start(address, port, account, password) do |pop|
  pop.each_mail do |m|
    yield m
  end
end

This method raises a POPAuthenticationError if authentication fails.

Example

Net::POP3.foreach('pop.example.com', 110,
                  'YourAccount', 'YourPassword') do |m|
  file.write m.pop
  m.delete if $DELETE
end
No documentation available

Searches key in id list. The result is returned or yielded if a block is given. If it isn’t found, nil is returned.

Completion for hash key.

Iterates the given block for each prime number.

Returns the cached prime numbers.

Iterate over the key/value pairs:

attlist_decl.each { |attribute_name, attribute_value| ... }

Iterates through all of the child Elements, optionally filtering them by a given XPath

xpath

optional. If supplied, this is a String XPath, and is used to filter the children, so that only matching children are yielded. Note that XPaths are automatically filtered for Elements, so that non-Element children will not be yielded

doc = Document.new '<a><b/><c/><d/>sean<b/><c/><d/></a>'
doc.root.elements.each {|e|p e}       #-> Yields b, c, d, b, c, d elements
doc.root.elements.each('b') {|e|p e}  #-> Yields b, b elements
doc.root.elements.each('child::node()')  {|e|p e}
#-> Yields <b/>, <c/>, <d/>, <b/>, <c/>, <d/>
XPath.each(doc.root, 'child::node()', &block)
#-> Yields <b/>, <c/>, <d/>, sean, <b/>, <c/>, <d/>

Iterates over each attribute of an Element, yielding the expanded name and value as a pair of Strings.

doc = Document.new '<a x="1" y="2"/>'
doc.root.attributes.each {|name, value| p name+" => "+value }

Evaluates whether the given string matches an entity definition, returning true if so, and false otherwise.

No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available

Enumerates rows of the Enumerable objects.

check for illegal characters

Iterates over nodes that match the given path, calling the supplied block with the match.

element

The context element

path

The xpath to search for. If not supplied or nil, defaults to ‘*’

namespaces

If supplied, a Hash which defines a namespace mapping

variables

If supplied, a Hash which maps $variables in the query to values. This can be used to avoid XPath injection attacks or to automatically handle escaping string values.

XPath.each( node ) { |el| ... }
XPath.each( node, '/*[@attr='v']' ) { |el| ... }
XPath.each( node, 'ancestor::x' ) { |el| ... }
XPath.each( node, '/book/publisher/text()=$publisher', {}, {"publisher"=>"O'Reilly"}) \
  {|el| ... }

Returns an array of nodes matching a given XPath.

No documentation available

Fetches item k from the tuple.

Search took: 3ms  ·  Total Results: 1119