るりまサーチ

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

別のキーワード

  1. matrix l
  2. _builtin $-l
  3. kernel $-l
  4. lupdecomposition l
  5. l matrix

ライブラリ

キーワード

検索結果

Rake::Application#init(app_name = 'rake') (24107.0)

コマンドラインオプションとアプリケーション名を初期化します。

...ンドラインオプションとアプリケーション名を初期化します。

//emlist[例][ruby]{
# Rakefile での記載例とする

task default: :test
task :test

Rake.application.name # => "rake"
Rake.application.init("MyApp") # => ["default"]
Rake.application.name # => "MyApp"
//}...

Gem::Specification#yaml_initialize (15200.0)

@todo

@todo

MiniTest::Unit#location(exception) -> String (15200.0)

与えられた例外の発生した場所を返します。

与えられた例外の発生した場所を返します。

Thread::Backtrace::Location (12018.0)

Ruby のフレームを表すクラスです。

...el.#caller_locations から生成されます。

//emlist[例1][ruby]{
# caller_locations.rb
def a(skip)
caller_locations(skip)
end
def b(skip)
a(skip)
end
def c(skip)
b(skip)
end

c(0..2).map do |call|
puts call.to_s
end
//}

例1の実行結果:

caller_locations.rb:2:in `a'
caller_lo...
...caller_locations.rb:8:in `c'

//emlist[例2][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts call.to_s
end
//}

例2の実行結果:

init
.rb:4:in `initialize'
init
.rb:8...
...:in `new'
init
.rb:8:in `<main>'

=== 参考

* Ruby VM アドベントカレンダー #4 vm_backtrace.c: https://www.atdot.net/~ko1/diary/201212.html#d4...

VALUE rb_catch(const char *tag, VALUE (*proc)(), VALUE data) (6406.0)

catch と同等の動作を実行します。

...
cat
ch と同等の動作を実行します。

まず proc に、yield された値と data を渡して実行します。
その途中で tag が throw されたら rb_catch 全体を終了します。

throw が発生した場合はその値を返します。
throw が発生しなかったとき...
...VALUE
foo_yield(VALUE a, VALUE b)
{
return rb_yield(b);
}

static VALUE
foo_catch(VALUE obj)
{
return rb_catch("footag", foo_yield, INT2FIX(2));
}

static VALUE
foo_abort(VALUE obj)
{
return rb_throw("footag", Qnil);
}

void
Init
_foo(void)
{
VALUE...
...Foo = rb_define_class("Foo", rb_cObject);
rb_define_method(Foo, "catch", foo_catch, 0);
rb_define_method(Foo, "abort", foo_abort, 0);
}...

絞り込み条件を変える

Rake::Application#run (6006.0)

Rake アプリケーションを実行します。

...下の 3 ステップを実行します。

* コマンドラインオプションを初期化します。Rake::Application#init
* タスクを定義します。Rake::Application#load_rakefile
* コマンドラインで指定されたタスクを実行します。Rake::Application#top_level...