るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. openssl n
  5. pop n_mails

ライブラリ

モジュール

検索結果

<< 1 2 3 ... > >>

Pathname#join(*args) -> Pathname (27308.0)

与えられたパス名を連結します。

...す。

@param args 連結したいディレクトリ名やファイル名を文字列で与えます。

//emlist[例][ruby]{
require "pathname"

path0 = Pathname("/usr") # Pathname:/usr
path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
# 上記の path0 の処理...
...は下記の path1 と同様のパスになります
path1 = Pathname("/usr") + "bin/ruby" # Pathname:/usr/bin/ruby
path0 == path1 #=> true
//}...

ThreadsWait#join(*threads) -> () (27308.0)

終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。

...eads で指定されたスレッドを指定します。

@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.n...
...ew
p thall.threads #=> []
thall.join(*threads)
p thall.threads
#=> [#<Thread:0x216ec dead>, #<Thread:0x21660 dead>, #<Thread:0x215d4 dead>, #<Thread:0x214bc dead>]...

Thread#join -> self (27275.0)

スレッド self の実行が終了するまで、カレントスレッドを停止し ます。self が例外により終了していれば、その例外がカレントス レッドに対して発生します。

...場合、nil を返します。

@param limit タイムアウトする時間を整数か小数で指定します。単位は秒です。

@raise ThreadError join を実行することによってデッドロックが起きる場合に発生します。またカレントスレッドを join したと...
...

以下は、生成したすべてのスレッドの終了を待つ例です。

threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })

threads.each {|t| t.join}...

Thread#join(limit) -> self | nil (27275.0)

スレッド self の実行が終了するまで、カレントスレッドを停止し ます。self が例外により終了していれば、その例外がカレントス レッドに対して発生します。

...場合、nil を返します。

@param limit タイムアウトする時間を整数か小数で指定します。単位は秒です。

@raise ThreadError join を実行することによってデッドロックが起きる場合に発生します。またカレントスレッドを join したと...
...

以下は、生成したすべてのスレッドの終了を待つ例です。

threads = []
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })
threads.push(Thread.new { n = rand(5); sleep n; n })

threads.each {|t| t.join}...

Array#join(sep = $,) -> String (27232.0)

配列の要素を文字列 sep を間に挟んで連結した文字列を返します。

...)
join
した文字列を連結します。
ただし、配列要素が自身を含むような無限にネストした配列に対しては、以下
のような結果になります。

//emlist[例][ruby]{
a
ry = [1,2,3]
a
ry.push ary
p ary # => [1, 2, 3, [...]]
p ary.join # => Argum...
...entError: recursive array join
//}

@param sep 間に挟む文字列を指定します。nil のときは空文字列を使います。
文字列以外のオブジェクトを指定した場合は to_str メソッドによ
る暗黙の型変換を試みます。

@raise TypeErr...
...を指定した場合に発生します。

@raise ArgumentError 配列要素が自身を含むような無限にネストした配列に対
して join を呼んだ場合に発生します。

//emlist[例][ruby]{
[1, 2, 3].join('-') #=> "1-2-3"
//}

@see Array#*, $,...

絞り込み条件を変える

Shell::CommandProcessor#join(*item) -> String (27208.0)

File クラスにある同名のクラスメソッドと同じです.

...File クラスにある同名のクラスメソッドと同じです.

@param item 連結したいディレクトリ名やファイル名を文字列で与えます。

@see File.join...

ThreadsWait#join_nowait(*threads) -> () (18308.0)

終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。 しかし、実際には終了をまちません。

...threads で指定されたスレッドを指定します。
しかし、実際には終了をまちません。

@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。

require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { s...
...leep 1; p Thread.current }
}

thall = ThreadsWait.new
p thall.threads #=> []
thall.join_nowait(*threads)
p thall.threads #=> [#<Thread:0x21638 sleep>, #<Thread:0x215ac sleep>, #<Thread:0x21520 sleep>, #<Thread:0x21494 sleep>, #<Thread:0x21408 sleep>]
# 実際には終了を待ってい...

Thread#add_trace_func(pr) -> Proc (15207.0)

スレッドにトレース用ハンドラを追加します。

...@param pr トレースハンドラ(Proc オブジェクト)

//emlist[例][ruby]{
th = Thread.new do
class Trace
end
43.to_s
end
th.add_trace_func lambda {|*arg| p arg }
th.join

# => ["line", "example.rb", 4, nil, #<Binding:0x00007f98e107d0d8>, nil]
# => ["c-call", "example.rb", 4, :inherit...
...<Binding:0x00007f98e1087448>, Class]
# => ["c-return", "example.rb", 4, :inherited, #<Binding:0x00007f98e1085d00>, Class]
# => ["class", "example.rb", 4, nil, #<Binding:0x00007f98e108f210>, nil]
# => ["end", "example.rb", 5, nil, #<Binding:0x00007f98e108e5e0>, nil]
# => ["line", "example.rb", 6, nil...
..., #<Binding:0x00007f98e108d4b0>, nil]
# => ["c-call", "example.rb", 6, :to_s, #<Binding:0x00007f98e1097aa0>, Integer]
# => ["c-return", "example.rb", 6, :to_s, #<Binding:0x00007f98e1095cc8>, Integer]
//}

@see Thread#set_trace_func Kernel.#set_trace_func...

Array#shelljoin -> String (15201.0)

配列の各要素である文字列に対して、Bourne シェルのコマンドライン中で安全に 使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド ライン文字列を生成します。

...て、Bourne シェルのコマンドライン中で安全に
使えるためのエスケープを適用し、空白文字を介してそれらを連結したコマンド
ライン文字列を生成します。

a
rray.shelljoin は、Shellwords.shelljoin(array) と等価です。

@return エスケ...
...ープ結果を連結した文字列を返します。
@see Shellwords.#shelljoin...

String#unpack(template) -> Array (12987.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...
A
rray#pack で生成された文字列を
テンプレート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。

@param template pack テンプレート文字列
@return オブジェクトの配列


以下にあげるもの...
...は、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで「残り全て」
を表すこともできます。

長さの意味はテ...
...字のシステム依存性

各テンプレート文字の説明の中で、
short や long はシステムによらずそれぞれ 2, 4バイトサ
イズの数値(32ビットマシンで一般的なshort, longのサイズ)を意味していま
す。s, S, l, L に対しては直後に _ または...
...は、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで「残り全て」
を表すこともできます。

長さ...

絞り込み条件を変える

TSort#each_strongly_connected_component_from(node, id_map={}, stack=[]) -> Enumerator (12313.0)

node から到達可能な強連結成分についてのイテレータです。

...
n
ode から到達可能な強連結成分についてのイテレータです。

返す値は規定されていません。

each_strongly_connected_component_from は
tsort_each_node を呼びません。

@param node ノードを指定します。

//emlist[例 到達可能なノードを表示...
...class Hash
include TSort
a
lias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end

n
on_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}

n
on_sort.each_strongly_connected_component{|nodes|
p nodes
n
odes.each {|node|
n
on_sort.each_strongly_connec...
...ted_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}

#出力
#=> [4]
#=> 4 -> 4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=> 1 -> 2,3
#=> 1 -> 1
//}

@see TSort.each_strongly_connected_component_from...
<< 1 2 3 ... > >>