128件ヒット
[1-100件を表示]
(0.029秒)
種類
- インスタンスメソッド (80)
- 文書 (32)
- 関数 (11)
- 特異メソッド (5)
ライブラリ
- ビルトイン (49)
-
shell
/ command-processor (36)
クラス
- IO (11)
- Method (11)
- Proc (11)
-
Shell
:: CommandProcessor (36) - UnboundMethod (11)
モジュール
- Warning (5)
キーワード
-
NEWS for Ruby 2
. 2 . 0 (10) - [] (5)
-
close
_ on _ exec= (11) - concat (6)
- echo (6)
- glob (6)
-
rb
_ catch (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
source
_ location (33) - tee (6)
- truncate (6)
検索結果
先頭5件
-
Proc
# source _ location -> [String , Integer] | nil (27124.0) -
ソースコードのファイル名と行番号を配列で返します。
...by]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ["(eval)", 1]
method(:p).to_proc.source_location # => nil
//}
@see Method#source_location... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (21113.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
....
@param files シェルコマンド cat に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) |... -
Shell
:: CommandProcessor # concat(*jobs) -> Shell :: Concat (9200.0) -
@todo
@todo -
Shell
:: CommandProcessor # truncate(path , length) -> 0 (9100.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param path パスを表す文字列を指定します。
@param length 変更したいサイズを整数で与えます。
@see File.truncate... -
VALUE rb
_ catch(const char *tag , VALUE (*proc)() , VALUE data) (6212.0) -
catch と同等の動作を実行します。
...
catch と同等の動作を実行します。
まず proc に、yield された値と data を渡して実行します。
その途中で tag が throw されたら rb_catch 全体を終了します。
throw が発生した場合はその値を返します。
throw が発生しなかったとき......は proc の返り値を返します。
static 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", Qn......il);
}
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);
}... -
Method
# source _ location -> [String , Integer] | nil (6106.0) -
ソースコードのファイル名と行番号を配列で返します。
...す。
@see Proc#source_location
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----
require '/tmp/foo'
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]
method(:puts).source_location # => nil... -
UnboundMethod
# source _ location -> [String , Integer] | nil (6106.0) -
ソースコードのファイル名と行番号を配列で返します。
...nil を返します。
//emlist[例][ruby]{
require 'time'
Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}
@see Proc#source_location, Method#source_location... -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}... -
Shell
:: CommandProcessor # glob(pattern) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...Dir.[] を参照してください。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}
@see Dir.[]... -
Shell
:: CommandProcessor # tee(file) -> Shell :: Filter (3006.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...るファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}... -
Warning
. [](category) -> bool (106.0) -
...
category の種類の警告を表示するかどうかのフラグを返します。
@param category 警告の種類を指定します。
サポートされている category は以下の通りです。
: :deprecated
非推奨の警告。
例: nil ではない値を $, や $; に設定す......る、キーワード引数、ブロックなしで proc / lambda を呼び出す、等
: :experimental
実験的な機能。
例: パターンマッチング... -
ruby 1
. 6 feature (84.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...d>))
サイズが 0 で中身のあるファイル(Linux の /proc ファイルシステムでこ
のような場合があります)が File#read などで読めないバグが修正されまし
た。
p File.open("/proc/#$$/cmdline").read
=> ruby 1.6.7 (2002-03-01) [i586-li......くなりました。((<ruby-bugs-ja:PR#205>))
* ((<Enumerable/each_with_index>)) が self を返すようになった(以前は nil)
* ((<Process/Process.setpgrp>)) が返す値が不定だった。
* ((<String/ljust>)), ((<String/rjust>)), ((<String/center>)) の結果に
変化がな.......6 の stable-snapshot を使用している方は、2002/1/30
の以下の変更(ChangeLog)
* re.c (rb_reg_search): should set regs.allocated.
で、メモリリークが起こるようになってることに注意してください。
2002/2/13 以降の修正版で直ってま... -
NEWS for Ruby 2
. 2 . 0 (36.0) -
NEWS for Ruby 2.2.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...)
* 改善: Kernel.#throw は、対応する catch ブロックがないとき ArgumentError ではなく
ArgumentError のサブクラスである UncaughtThrowError を発生させるようになりました
* Process
* 拡張: Process.spawn のような外部プロセスを起......によって返される多くのシンボルがGC可能になりました
* Method
* 追加: Method#curry([arity]) はカリー化された Proc オブジェクトを返します
* 追加: Method#super_method はスーパクラスの同名のメソッドの Method オブジェクトを......大が指定されたとき C99 で期待されるような値を返します。
* Proc
* 非互換: ArgumentError は発生しなくなりました。
* ArgumentError is no longer raised when lambda Proc is passed as a
block, and the number of yielded arguments does not match the f...