種類
- インスタンスメソッド (153)
- 文書 (108)
- 特異メソッド (59)
- ライブラリ (22)
- クラス (11)
ライブラリ
- ビルトイン (160)
- optparse (11)
- pathname (11)
- shell (6)
-
shell
/ command-processor (6) -
shell
/ filter (6) - thwait (12)
- uri (11)
クラス
- Array (57)
- BasicObject (22)
- Dir (21)
- File (11)
- OptionParser (11)
- Pathname (11)
- Shell (6)
-
Shell
:: CommandProcessor (6) -
Shell
:: Filter (6) - String (11)
- Thread (16)
- ThreadsWait (12)
モジュール
- Enumerable (11)
- URI (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - DOSISH 対応 (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Thread (11)
- [] (7)
-
_ _ send _ _ (22) - cgi (11)
- chunk (11)
- drb (11)
- glob (14)
-
join
_ nowait (6) -
on
_ tail (11) - pack (19)
- pack テンプレート文字列 (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) - sum (16)
- unpack (11)
- スレッド (11)
- セキュリティモデル (11)
検索結果
先頭5件
-
URI
. join(uri _ str , *path) -> object (21432.0) -
文字列 uri_str と path ... を URI として連結して得られる URI オブジェクトを返します。
...文字列 uri_str と path ... を URI として連結して得られる
URI オブジェクトを返します。
2396 の Section 5.2 の
仕様に従って連結します。
以下と等価です
require 'uri'
URI.parse(uri_str) + path + ...
@param uri_str URI 文字列
@param path 後ろ......@raise URI::InvalidComponentError 各要素が適合しない場合に発生します。
@raise URI::InvalidURIError パースに失敗した場合に発生します。
例:
require 'uri'
p URI.join('http://www.ruby-lang.org/', '/ja/man-1.6/')
=> #<URI::HTTP:0x2010017a URL:http://www.ruby-l......ang.org/ja/man-1.6/>... -
Shell
:: CommandProcessor # join(*item) -> String (21407.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join... -
Shell
:: Filter # join(*item) -> String (21407.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join... -
ThreadsWait
# join(*threads) -> () (21407.0) -
終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。
...、threads で指定されたスレッドを指定します。
@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。
require 'thwait'
threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}
thall = Threads......Wait.new
p thall.threads #=> []
thall.join(*threads)
p thall.threads
#=> [#<Thread:0x216ec dead>, #<Thread:0x21660 dead>, #<Thread:0x215d4 dead>, #<Thread:0x214bc dead>]... -
Array
# *(sep) -> String (21329.0) -
指定された sep を間にはさんで連結した文字列を生成して返します。Array#join(sep) と同じ動作をします。
...します。Array#join(sep) と同じ動作をします。
@param sep 文字列を指定します。
文字列以外のオブジェクトを指定した場合は to_str メソッドによ
る暗黙の型変換を試みます。
//emlist[例][ruby]{
p [1,2,3] * ","
# => "1,2,3......"
//}
@see Array#join... -
Array
# *(times) -> Array (21309.0) -
配列の内容を times 回 繰り返した新しい配列を作成して返します。 値はコピーされないことに注意してください。
...注意してください。
@param times 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによ
る暗黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の......型変換が行えない)オブジェクトを
指定した場合に発生します。
@raise ArgumentError 引数に負の数を指定した場合に発生します。
//emlist[例][ruby]{
p [1, 2, 3] * 3 #=> [1, 2, 3, 1, 2, 3, 1, 2, 3]
//}... -
File
. join(*item) -> String (18465.0) -
File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。
...File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。
@param item 連結したいディレクトリ名やファイル名を文字列(もしくは文字列を要素に持つ配列)で与えます。
文字列A......とBを連結する際に、Aの末尾の文字とBの先頭の文字がFile::SEPARATORであった場合には、
まずこれらを削除した上で改めてFile::SEPARATORを間に入れて連結します。
引数の中に配列がある場合は配列要素を再帰的......ブジェクトを指定した場合は、まず to_str メソッド、次に to_path メソッドにより暗黙の型変換を試みます。
引数がない場合には空文字列を生成して返します。
@raise TypeError 引数の中に文字列以外の(暗黙の型変... -
Pathname
# join(*args) -> Pathname (18407.0) -
与えられたパス名を連結します。
...連結します。
@param args 連結したいディレクトリ名やファイル名を文字列で与えます。
//emlist[例][ruby]{
require "pathname"
path0 = Pathname("/usr") # Pathname:/usr
path0 = path0.join("bin/ruby") # Pathname:/usr/bin/ruby
# 上記の path......0 の処理は下記の path1 と同様のパスになります
path1 = Pathname("/usr") + "bin/ruby" # Pathname:/usr/bin/ruby
path0 == path1 #=> true
//}... -
Shell
# join(*item) -> String (18407.0) -
File クラスにある同名のクラスメソッドと同じです.
...File クラスにある同名のクラスメソッドと同じです.
@param item 連結したいディレクトリ名やファイル名を文字列で与えます。
@see File.join... -
ThreadsWait
# join _ nowait(*threads) -> () (9407.0) -
終了を待つスレッドの対象として、threads で指定されたスレッドを指定します。 しかし、実際には終了をまちません。
...、threads で指定されたスレッドを指定します。
しかし、実際には終了をまちません。
@param threads 複数スレッドの終了を待つスレッドに指定されたthreadsを加えます。
require 'thwait'
threads = []
5.times {|i|
threads << Thread.new......{ sleep 1; p Thread.current }
}
thall = ThreadsWait.new
p thall.threads #=> []
thall.join_nowait(*threads)
p thall.threads #=> [#<Thread:0x21638 sleep>, #<Thread:0x215ac sleep>, #<Thread:0x21520 sleep>, #<Thread:0x21494 sleep>, #<Thread:0x21408 sleep>]
# 実際には終了を待って... -
Thread
. report _ on _ exception -> bool (9236.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を $stderr に報告します。
デフォルトは false です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block......in>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:
* 例外が意図し......にする方法が最善です。
* 例外が意図したものの場合、例外が発生する場所により近い場所で rescue して、
その例外でスレッドが終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの......容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `blo... -
Thread
. report _ on _ exception=(newstate) (9136.0) -
真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。
...を $stderr に報告します。
デフォルトは false です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `block......in>'
1: from -e:1:in `times'
これによってスレッドのエラーを早期に捕捉できるようになります。
いくつかのケースでは、この出力を望まないかもしれません。
出力を抑制するには複数の方法があります:
* 例外が意図し......にする方法が最善です。
* 例外が意図したものの場合、例外が発生する場所により近い場所で rescue して、
その例外でスレッドが終了しないようにするのがより良い方法です。
* Thread#join や Thread#value でそのスレッドの......容を $stderr に報告します。
デフォルトは true です。
Thread.new { 1.times { raise } }
は $stderr に以下のように出力します:
#<Thread:...> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
2: from -e:1:in `blo...