るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.061秒)
トップページ > クエリ:-[x] > クエリ:|[x] > クエリ:delete_if[x] > クエリ:tsort[x]

別のキーワード

  1. _builtin delete
  2. _builtin delete_if
  3. cgi delete
  4. pop delete_all
  5. pop3 delete_all

検索結果

tsort (38118.0)

tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。

...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],...
...のように実装できます。

//emlist[][ruby]{
require 'tsort'

class Make
def initialize
@dep = {}
@dep.default = []
end

def rule(outputs, inputs=[], &block)
triple = [outputs, inputs, block]
outputs.each {|f| @dep[f] = [triple]}
@dep[triple] = inputs
end

def b...
...nt_from(target) {|ns|
if ns.length != 1
fs = ns.delete_if {|n| Array === n}
raise TSort::Cyclic.new("cyclic dependencies: #{fs.join ', '}")
end
n = ns.first
if Array === n
outputs, inputs, block = n
inputs_time = inputs.map {|f| File.mtime f}.m...