別のキーワード
ライブラリ
- ビルトイン (432)
- csv (12)
- matrix (24)
-
net
/ smtp (84) - rake (12)
-
rexml
/ document (24) - shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (24)
クラス
-
ARGF
. class (60) - Array (120)
-
CSV
:: Table (12) - Enumerator (48)
- MatchData (60)
- Matrix (24)
-
Net
:: SMTP (84) -
REXML
:: Element (12) -
REXML
:: Elements (12) -
Rake
:: FileList (12) - Regexp (24)
- Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (24) - String (48)
モジュール
- Enumerable (72)
キーワード
- << (12)
- == (12)
- [] (48)
- cat (18)
- combination (24)
- each (72)
-
each
_ line (24) - echo (18)
- entries (12)
-
get
_ elements (12) - glob (18)
- lines (24)
- match (24)
-
max
_ by (48) - permutation (24)
- rcptto (12)
-
rcptto
_ list (12) - readlines (24)
- ready (12)
-
repeated
_ combination (24) -
repeated
_ permutation (24) - sample (24)
-
send
_ mail (12) - sendmail (12)
- tee (18)
-
values
_ at (12)
検索結果
先頭5件
-
REXML
:: Elements # to _ a(xpath = nil) -> [REXML :: Element] (24220.0) -
すべての子要素の配列を返します。
...ます。
xpath を指定した場合は、その XPath 文字列に
マッチする要素の配列を返します。
REXML::Elements#each と同様、REXML::XPath.match などと
異なり、要素以外の子ノードは無視されます。
@param xpath XPath文字列
//emlist[][ruby]{
requir......e 'rexml/document'
require 'rexml/xpath'
doc = REXML::Document.new '<a>sean<b/>elliott<c/></a>'
doc.root.elements.to_a # => [<b/>, <c/>]
doc.root.elements.to_a("child::node()") # => [<b/>, <c/>]
REXML::XPath.match(doc.root, "child::node()") # => ["sean", <b/>, "elliott", <c/>]
//}... -
Enumerable
# to _ a(*args) -> [object] (21220.0) -
全ての要素を含む配列を返します。
...列を返します。
@param args each の呼び出し時に引数として渡されます。
//emlist[例][ruby]{
(1..7).to_a #=> [1, 2, 3, 4, 5, 6, 7]
{ 'a'=>1, 'b'=>2, 'c'=>3 }.to_a #=> [["a", 1], ["b", 2], ["c", 3]]
require 'prime'
Prime.entries 10 #=>... -
ARGF
. class # to _ a(limit) -> Array (18216.0) -
ARGFの各行を配列に読み込んで返します。rsがnilの場合は要素に各ファイルを すべて読み込んだ配列を返します。
...。rsがnilの場合は要素に各ファイルを
すべて読み込んだ配列を返します。
@param rs 行区切り文字
@param limit 最大の読み込みバイト数
lines = ARGF.readlines
lines[0] # => "This is line one\n"
@see $/, Kernel.#readlines, IO#readlines... -
ARGF
. class # to _ a(rs = $ / ) -> Array (18216.0) -
ARGFの各行を配列に読み込んで返します。rsがnilの場合は要素に各ファイルを すべて読み込んだ配列を返します。
...。rsがnilの場合は要素に各ファイルを
すべて読み込んだ配列を返します。
@param rs 行区切り文字
@param limit 最大の読み込みバイト数
lines = ARGF.readlines
lines[0] # => "This is line one\n"
@see $/, Kernel.#readlines, IO#readlines... -
ARGF
. class # to _ a(rs , limit) -> Array (18216.0) -
ARGFの各行を配列に読み込んで返します。rsがnilの場合は要素に各ファイルを すべて読み込んだ配列を返します。
...。rsがnilの場合は要素に各ファイルを
すべて読み込んだ配列を返します。
@param rs 行区切り文字
@param limit 最大の読み込みバイト数
lines = ARGF.readlines
lines[0] # => "This is line one\n"
@see $/, Kernel.#readlines, IO#readlines... -
Shell
:: Filter # tee(file) -> Shell :: Filter (9213.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...lter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
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"
}
}
}... -
Regexp
# match(str , pos = 0) -> MatchData | nil (6249.0) -
指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ チングを行います。マッチした場合には結果を MatchData オブジェクトで返し ます。 マッチしなかった場合 nil を返します。
...指定された文字列 str に対して位置 pos から自身が表す正規表現によるマッ
チングを行います。マッチした場合には結果を MatchData オブジェクトで返し
ます。
マッチしなかった場合 nil を返します。
省略可能な第二引数 pos......//emlist[例][ruby]{
p(/(.).(.)/.match("foobar", 3).captures) # => ["b", "r"]
p(/(.).(.)/.match("foobar", -3).captures) # => ["b", "r"]
//}
pos を指定しても MatchData#offset 等の結果
には影響しません。つまり、
//emlist[][ruby]{
re.match(str[pos..-1])
//}
と
//emlist[][rub......y]{
re.match(str, pos)
//}
は異なります。
ブロックを渡すと、マッチした場合に限り MatchData オブジェクトがブロック引数に渡されて実行されます。
マッチした場合はブロックの値を返し、マッチしなかった場合は nil を返しま... -
Net
:: SMTP # open _ message _ stream(from _ addr , *to _ addrs) {|f| . . . . } -> () (6213.0) -
メール書き込みの準備をし、書き込み先のストリームオブジェクトを ブロックに渡します。ブロック終了後、書きこんだ結果が 送られます。
...持っています。
* puts(str = '') strを出力して CR LFを出力
* print(str) strを出力
* printf(fmt, *args) sprintf(fmt,*args) を出力
* write(str):: str を出力して書き込んだバイト数を返す
* <<(str):: str を出力してストリー......、
to_addrs には送信先メールアドレスを文字列で渡します。
require 'net/smtp'
Net::SMTP.start('smtp.example.com', 25) {|smtp|
smtp.open_message_stream('from@example.com', 'to@example.net') {|f|
f.puts 'From: from@example.com'
f.puts 'To: to@example.net'......f.puts 'Subject: test mail'
f.puts
f.puts 'This is test mail.'
}
}
ready は obsolete です。
@param from_addr 送信元のメールアドレス
@param to_addrs 送信先のメールアドレス(複数可、少なくとも1個)
@raise IOError すでにセッションが終... -
Shell
# tee(file) -> Shell :: Filter (6213.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...lter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
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 # tee(file) -> Shell :: Filter (6213.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...lter オブジェクトを返します.
@param file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
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"
}
}
}...