56件ヒット
[1-56件を表示]
(0.083秒)
種類
- インスタンスメソッド (34)
- 関数 (11)
- クラス (11)
ライブラリ
- ビルトイン (11)
-
minitest
/ unit (1) - rake (22)
-
rubygems
/ specification (11)
クラス
-
Gem
:: Specification (11) -
MiniTest
:: Unit (1) -
Rake
:: Application (22)
キーワード
- Location (11)
- location (1)
-
rb
_ catch (11) - run (11)
-
yaml
_ initialize (11)
検索結果
先頭5件
-
Rake
:: Application # init(app _ name = & # 39;rake& # 39;) (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 と同等の動作を実行します。
...
catch と同等の動作を実行します。
まず 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...