るりまサーチ

最速Rubyリファレンスマニュアル検索!
168件ヒット [101-168件を表示] (0.136秒)

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 >>

Net::SMTP#send_message(mailsrc, from_addr, *to_addrs) -> () (107.0)

メールを送信します。

...ach イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。

from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_a
ddrs には送信先メールアドレスを文字列で渡します。

require 'net/smtp'

Net::SM...
...'to2@example.net'
}

sendmail は obsolete です。

@param mailsrc メールの内容
@param from_addr 送信元のメールアドレス
@param to_addrs 送信先のメールアドレス(複数可、少なくとも1個)

@raise IOError すでにセッションが終了している場合に発...

Net::SMTP#sendmail(mailsrc, from_addr, *to_addrs) -> () (107.0)

メールを送信します。

...ach イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。

from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_a
ddrs には送信先メールアドレスを文字列で渡します。

require 'net/smtp'

Net::SM...
...'to2@example.net'
}

sendmail は obsolete です。

@param mailsrc メールの内容
@param from_addr 送信元のメールアドレス
@param to_addrs 送信先のメールアドレス(複数可、少なくとも1個)

@raise IOError すでにセッションが終了している場合に発...

Shell#echo(*strings) -> Shell::Filter (31.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

Shell#glob(pattern) -> Shell::Filter (31.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Dir.[] を参照してください。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (31.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

絞り込み条件を変える

Shell::CommandProcessor#glob(pattern) -> Shell::Filter (31.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Dir.[] を参照してください。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

Shell::Filter#echo(*strings) -> Shell::Filter (31.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...与える引数を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

Shell::Filter#glob(pattern) -> Shell::Filter (31.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...Dir.[] を参照してください。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file
.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}

@see Dir.[]...

Enumerable#chunk {|elt| ... } -> Enumerator (19.0)

要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。

...指定した場合は例外が発生します。

//emlist[例][ruby]{
[1, 2].chunk { |item| :_underscore }.to_a
# => RuntimeError: symbols beginning with an underscore are reserved

# 「.to_a」無しだと Enumerator を返すのみで例外は発生しない
//}

nil、 :_separator はある要...
...s.\n",
# "\n"]
# ...
//}

テキストを空行で区切られた段落に分けたい場合にも nil が使えます。

//emlist[例][ruby]{
File
.foreach("README").chunk {|line|
/\A\s*\z/ !~ line || nil
}.each {|_, lines|
pp lines
}
//}

「:_alone」は要素を素通ししたい場合...
...連続している場合のみ
チャンク化し、それ以外は素通しします。

//emlist[例][ruby]{
pat = /\A[A-Z][A-Za-z0-9_]+\#/
open(filename) {|f|
f.chunk {|line| pat =~ line ? $& : :_alone }.each {|key, lines|
if key != :_alone
print lines.sort.join('')
else
pri...
<< < 1 2 >>