クラス
-
Psych
:: Handler (12) -
Psych
:: Nodes :: Mapping (24) -
RubyVM
:: InstructionSequence (12)
モジュール
キーワード
-
NEWS for Ruby 3
. 0 . 0 (5) -
block
_ append (12) - new (12)
- of (10)
- parse (6)
-
ruby 1
. 8 . 5 feature (12) -
start
_ mapping (12) -
to
_ a (12) - tsort (12)
検索結果
先頭5件
-
Psych
:: Nodes :: Mapping :: BLOCK -> Integer (21117.0) -
block style を表します。
...block style を表します。
@see Psych::Nodes::Mapping.new,
Psych::Nodes::Mapping#style,
Psych::Handler#start_mapping... -
static NODE * block
_ append(NODE *head , NODE *tail) (12248.0) -
head と tail を NODE_BLOCK のリストとして連結し、 先頭ノードを返します。head または tail が NODE_BLOCK でない場合は NODE_BLOCK に入れたうえでそれを連結します。 head もしくは tail が NULL なら連結はせず、 NULL でないほうを返します。
...head と tail を NODE_BLOCK のリストとして連結し、
先頭ノードを返します。head または tail が NODE_BLOCK
でない場合は NODE_BLOCK に入れたうえでそれを連結します。
head もしくは tail が NULL なら連結はせず、
NULL でないほうを返しま... -
Psych
:: Handler # start _ mapping(anchor , tag , implicit , style) -> () (6106.0) -
mapping の開始を見付けたときに呼び出されます。
...mapping の開始を見付けたときに呼び出されます。
anchor には map に関連付けられた anchor の名前が文字列で渡されます。
anchor がない場合には nil が渡されます。
tag には map に関連付けられた tag の名前が文字列で渡されます......ch::Nodes::Mapping::BLOCK
* Psych::Nodes::Mapping::FLOW
必要に応じてこのメソッドを override してください。
@param anchor 関連付けられた anchor の名前
@param tag タグ名
@param implicit mapping が implicit に開始されかどうか
@param style mapping のスタ......p { hello: world }
v: &pewpew
hello: world
この YAML ドキュメントには3つの mapping が含まれています。
外側の map の中に 2 つの map が含まれています。
start_mapping メソッドは 順に以下の引数で呼び出されます。
# anchor tag... -
Psych
:: Nodes :: Mapping . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Mapping (3207.0) -
新たな mapping オブジェクトを生成します。
...新たな mapping オブジェクトを生成します。
anchor には mapping に付加されている anchor を文字列で指定します。
anchor を付けない場合には nil を指定します。
tag には mapping に付加されている tag を文字列で指定します。
tag を......mapping が implicit に開始されたかどうかを
真偽値で指定します。
style には YAML ドキュメント上の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Mapping::ANY
* Psych::Nodes::Mapping::BLOCK
* Psych::Nodes::Mappi......ng::FLOW
@param anchor mapping に付加された anchor
@param tag mapping に付加された tag
@param implicit mapping が implicit に開始されたかどうか
@param style YAML ドキュメント上の style... -
tsort (54.0)
-
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
...xample
//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_componen......][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 build(target)
each_strongly_connected_com......分に関するアルゴリズムを使っているからです。
とはいえ strongly_connected_components という正確な名前は長過ぎます。
=== References
R. E. Tarjan,
Depth First Search and Linear Graph Algorithms,
SIAM Journal on Computing, Vol. 1, No. 2, pp. 146-160, June 1972.... -
NEWS for Ruby 3
. 0 . 0 (42.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...[[[1]], {}]
pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}
* Arguments forwarding (`...`) now supports leading arguments.
16378
//emlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is......ERIMENTAL]
16828
//emlist{
case ["a", 1, "b", "c", 2, "d", "e", "f", 3]
in [*pre, String => x, String => y, *post]
p pre #=> ["a", 1]
p x #=> "b"
p y #=> "c"
p post #=> [2, "d", "e", "f", 3]
end
//}
* Endless method definition is added. [EXPERIMENTAL]
16746
//emlist{
def......nd `1` for `__LINE__` in the evaluated code. 4352 17419
* ConditionVariable
* ConditionVariable#wait may now invoke the `block`/`unblock` scheduler hooks in a non-blocking context. 16786
* Dir
* Dir.glob and Dir.[] now sort the results by default, and accept the `sort:` keyword option.... -
RubyVM
:: InstructionSequence # to _ a -> Array (24.0) -
self の情報を 14 要素の配列にして返します。
...合は nil。
: #first_lineno
命令シーケンスの 1 行目の行番号。
: type
命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main、
:defined_guard のいずれか。
: locals
全ての引数名、ローカル変数名から......あるいは以下のよう
な配列。
[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]
より詳細な情報については、vm_core.h を参照。
: catch_table
例外や制御構造のオペレータ(rescue......命令シーケンスを構成する命令とオペランドの配列の配列。
//emlist[例][ruby]{
require 'pp'
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:a... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (18.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...す。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxT......pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:21 :puts (LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (18.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...す。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxT......pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:21 :puts (LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (18.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...発生します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x......= 1; p(x; y=2", error_tolerant: true)
# => (SCOPE@1:0-1:15
# tbl: [:x, :y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (LIT@1:4-1:5 1)) (ERROR@1:7-1:11) (LASGN@1:12-1:15 :y (LIT@1:14-1:15 2))))
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (18.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...発生します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x......= 1; p(x; y=2", error_tolerant: true)
# => (SCOPE@1:0-1:15
# tbl: [:x, :y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (LIT@1:4-1:5 1)) (ERROR@1:7-1:11) (LASGN@1:12-1:15 :y (LIT@1:14-1:15 2))))
//}... -
ruby 1
. 8 . 5 feature (12.0) -
ruby 1.8.5 feature ruby 1.8.4 から ruby 1.8.5 までの変更点です。
...b/ruby/stable-snapshot.tar.gz>))
=== 2006-06-18
: BasicSocket#recv_nonblock [new]
: UDPSocket#recvfrom_nonblock [new]
追加
=== 2006-06-17
: Pathname(path) [new]
pathname で追加
: Kernel#pretty_inspect [new]
pp で追加
: RSS::TaxonomyTopicModel [new]
: RSS::TaxonomyTopicsModel [......: RSS::Maker::TaxonomyTopicsModel [new]
RSS Parser/RSS MakerがTaxonomyモジュールをサポートしました。
: RSS::Maker xxx.new_yyy(&block) [compat]
maker.items.new_itemなどがブロックをとれるようになりました。((<ruby-talk:197284>))
今まで
item = ma......block [new]
#: UNIXSocket#recvfrom_nonblock [new]
: TCPServer#accept_nonblock [new]
: UNIXServer#accept_nonblock [new]
((<ruby-core:7925>))
=== 2006-05-22
: IO#read_nonblock [new]
: IO#write_nonblock [new]
: Socket#connect_nonblock [new]
: Socket#accept_nonblock [new]
: Socket#recvfrom_nonblock...