ライブラリ
- ビルトイン (214)
- dbm (12)
- gdbm (12)
-
net
/ http (36) -
net
/ imap (84) - nkf (12)
- observer (12)
- pstore (12)
-
rinda
/ tuplespace (24) -
rubygems
/ commands / fetch _ command (12) -
rubygems
/ remote _ fetcher (216) -
rubygems
/ spec _ fetcher (168) -
rubygems
/ test _ utilities (24) - sdbm (12)
- socket (24)
- tsort (93)
-
yaml
/ dbm (24)
クラス
- Array (36)
- DBM (12)
- Data (6)
- GDBM (12)
-
Gem
:: RemoteFetcher (180) -
Gem
:: RemoteFetcher :: FetchError (24) -
Gem
:: SpecFetcher (156) - Hash (92)
- KeyError (16)
-
Net
:: IMAP (48) -
Net
:: IMAP :: FetchData (24) - PStore (12)
-
Rinda
:: TupleEntry (24) - SDBM (12)
- Socket (12)
- Thread (16)
-
YAML
:: DBM (24)
モジュール
-
Net
:: HTTPHeader (36) -
Socket
:: Constants (12) - TSort (93)
オブジェクト
- ENV (36)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - FakeFetcher (12)
- FetchCommand (12)
- FetchData (12)
- FetchError (12)
- KeyError (12)
-
MSG
_ ERRQUEUE (24) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 5 . 0 (8) - NKF (12)
- Observable (12)
- RemoteFetcher (12)
- SpecFetcher (12)
- [] (44)
- attr (12)
-
cache
_ dir (12) -
connection
_ for (12) - define (6)
- dir (12)
- download (12)
-
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) - escape (12)
-
fetch
_ path (12) -
fetch
_ size (12) -
fetch
_ spec (12) -
fetch
_ values (20) - fetcher (24)
- fetcher= (24)
-
file
_ uri? (12) -
find
_ matching (12) -
get
_ file _ uri _ path (12) -
get
_ proxy _ from _ env (12) - key (8)
-
latest
_ specs (12) -
legacy
_ repos (12) - list (12)
-
load
_ specs (12) -
net
/ http (12) -
net
/ imap (12) - new (36)
-
normalize
_ uri (12) -
open
_ uri _ or _ path (12) - receiver (8)
- request (12)
- reset (12)
-
rubygems
/ commands / fetch _ command (12) -
rubygems
/ remote _ fetcher (12) -
rubygems
/ spec _ fetcher (12) - seqno (12)
- specs (12)
- store (12)
-
strongly
_ connected _ components (12) - tsort (24)
-
tsort
_ each (23) -
uid
_ fetch (12) -
uid
_ store (12) - unescape (12)
- uri (12)
-
warn
_ legacy (12)
検索結果
先頭5件
-
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (6.0) -
node から到達可能な強連結成分についてのイテレータです。
...ードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (6.0) -
node から到達可能な強連結成分についてのイテレータです。
...ードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.... -
TSort
# strongly _ connected _ components -> Array (6.0) -
強連結成分の集まりを配列の配列として返します。 この配列は子から親に向かってソートされています。 各要素は強連結成分を表す配列です。
...。
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
p non_sort.strongly_connected_components
#=> [[4], [2, 3], [1]]
//}... -
TSort
# tsort -> Array (6.0) -
頂点をトポロジカルソートして得られる配列を返します。 この配列は子から親に向かってソートされています。 すなわち、最初の要素は子を持たず、最後の要素は親を持ちません。
...発生します。
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
sorted = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
p sorted #=> [3, 2, 1, 4]
//}
@see TSort.tsort... -
TSort
# tsort _ each -> Enumerator (6.0) -
TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
....
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}
non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|... -
TSort
# tsort _ each {|node| . . . } -> nil (6.0) -
TSort#tsort メソッドのイテレータ版です。 obj.tsort_each は obj.tsort.each と似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
....
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2, 3], 2=>[3], 3=>[], 4=>[]}
non_sort.tsort_each {|node|
non_sort.tsort_each_child(node){|child|... -
Thread
# [](name) -> object | nil (6.0) -
name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。
...rrent[:name]
# => nil if fiber-local
# => 2 if thread-local (The value 2 is leaked to outside of meth method.)
//}
Fiber を切り替えても同じ変数を返したい場合は
Thread#thread_variable_get と Thread#thread_variable_set
を使用してください。
@see Thread#fetch, Thread#[]=... -
YAML
:: DBM # [](key) -> object | nil (6.0) -
データベースからキーを探して対応する要素の値を返します。
...データベースからキーを探して対応する要素の値を返します。
対応する値が見つからなかった場合は nil を返します。DBM#[] とは異
なり、IndexError は発生しません。
@param key キーを文字列で指定します。
@see YAML::DBM#fetch... -
tsort (6.0)
-
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
...=== Example
//emlist[][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
{1=>[2, 3], 2=>[3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]
{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_co... -
Hash
. new(ifnone = nil) -> Hash (1.0) -
空の新しいハッシュを生成します。ifnone はキーに対 応する値が存在しない時のデフォルト値です。設定したデフォルト値はHash#defaultで参照できます。
空の新しいハッシュを生成します。ifnone はキーに対
応する値が存在しない時のデフォルト値です。設定したデフォルト値はHash#defaultで参照できます。
ifnoneを省略した Hash.new は {} と同じです。
デフォルト値として、毎回同一のオブジェクトifnoneを返します。
それにより、一箇所のデフォルト値の変更が他の値のデフォルト値にも影響します。
//emlist[][ruby]{
h = Hash.new([])
h[0] << 0
h[1] << 1
p h.default #=> [0, 1]
//}
これを避けるには、破壊的でないメソッドで再代入する...