るりまサーチ

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

別のキーワード

  1. shell/builtin-command new
  2. shell/builtin-command each
  3. rubygems/command command
  4. irb/extend-command def_extend_command
  5. irb/extend-command install_extend_commands

種類

検索結果

tsort (38112.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],...
...3], 3=>[], 4=>[]}.tsort
#=> [3, 2, 1, 4]

{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_components
#=> [[4], [2, 3], [1]]
//}

=== より現実的な例

非常に単純な `make' に似たツールは以下のように実装できます。

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

class Make
de...
...end
}
end

def tsort_each_child(node, &block)
@dep[node].each(&block)
end
include TSort
end

def command(arg)
print arg, "\n"
system arg
end

m = Make.new
m.rule(%w[t1]) { command 'date > t1' }
m.rule(%w[t2]) { command 'date > t2' }
m.rule(%w[t3]) { command 'date > t3' }
m.rule(...

NEWS for Ruby 3.0.0 (12.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...from the toplevel scope is now a RuntimeError.
14541
* Assigning to a numbered parameter is now a SyntaxError instead of
a warning.

== Command line options

=== `--help` option

When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard i...
...esolv-replace
* resolv
* rinda
* set
* securerandom
* shellwords
* tempfile
* tmpdir
* time
* tsort
* un
* weakref
* The following extensions are promoted to default gems from stdlib.
* digest
* io-nonblock
* io-...