種類
- インスタンスメソッド (645)
- 特異メソッド (176)
- モジュール関数 (128)
- 文書 (25)
- 定数 (1)
ライブラリ
- ビルトイン (320)
- csv (44)
- erb (11)
-
irb
/ inspector (11) - json (22)
- logger (44)
-
minitest
/ unit (20) - mkmf (11)
- objspace (11)
- openssl (11)
- optparse (24)
- rake (88)
- set (22)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - strscan (220)
- syslog (22)
- tracer (11)
- win32ole (22)
クラス
-
ARGF
. class (55) - CSV (44)
- Dir (11)
- ERB (11)
- Exception (11)
- File (22)
- IO (66)
-
IRB
:: Inspector (11) - Logger (44)
-
MiniTest
:: Unit (1) -
MiniTest
:: Unit :: TestCase (1) - Module (5)
-
OpenSSL
:: BN (11) - OptionParser (24)
-
Rake
:: Application (11) -
Rake
:: FileList (11) -
Rake
:: TaskArguments (11) - Set (22)
- Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - StringScanner (220)
- Thread (22)
- Tracer (11)
- WIN32OLE (11)
-
WIN32OLE
_ VARIANT (11)
モジュール
- FileTest (33)
- GC (22)
- JSON (11)
-
JSON
:: Generator :: GeneratorMethods :: String (11) - Kernel (62)
-
MiniTest
:: Assertions (18) - ObjectSpace (11)
- Rake (22)
-
Rake
:: TaskManager (33) - Syslog (22)
オブジェクト
- ENV (22)
キーワード
- Rubyの起動 (3)
- Ruby用語集 (11)
-
SUPPORTS
_ INFO _ SIGNAL (1) - [] (40)
-
allocation
_ sourcefile (11) - application (11)
- application= (11)
- assert (1)
-
assert
_ block (1) -
assert
_ empty (1) -
assert
_ equal (1) -
assert
_ in _ delta (1) -
assert
_ in _ epsilon (1) -
assert
_ includes (1) -
assert
_ instance _ of (1) -
assert
_ match (1) -
assert
_ nil (1) -
assert
_ operator (1) -
assert
_ respond _ to (1) -
assert
_ same (1) -
assert
_ send (1) -
assert
_ throws (1) -
backtrace
_ locations (22) -
caller
_ locations (22) - check (11)
-
check
_ until (11) - chown (11)
- clear (11)
- clone (11)
- close (22)
- closed? (11)
-
const
_ source _ location (5) -
create
_ makefile (11) -
datetime
_ format (11) -
datetime
_ format= (11) -
def
_ inspector (11) - delete (22)
-
delete
_ if (11) - dump (11)
- dup (11)
- exist? (11)
- flunk (1)
- formatter (11)
- getc (11)
- gets (33)
-
inplace
_ mode (11) -
internal
_ encoding (11) - invoke (11)
-
latest
_ gc _ info (22) - lchown (11)
- lookup (11)
- mask (11)
- mask= (11)
- match? (11)
- matched (11)
- matched? (11)
-
matched
_ size (11) - new (22)
- on (11)
- open (44)
- parse (16)
- parse! (8)
- pass (1)
- pathmap (11)
-
post
_ match (11) -
pre
_ match (11) -
prime
_ fasttest? (11) - puts (11)
- read (11)
- reject! (11)
- reset (11)
-
ruby 1
. 8 . 2 feature (11) - run (12)
- scan (11)
-
scan
_ full (11) -
scan
_ until (11) -
search
_ full (11) -
set
_ backtrace (11) - size? (11)
- skip (12)
-
skip
_ until (11) -
synthesize
_ file _ task (11) - terminate (11)
-
to
_ json (11) - unscan (11)
- warn (7)
-
world
_ readable? (11) -
world
_ writable? (11)
検索結果
先頭5件
-
Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (21933.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...el.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param fil......@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "......foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (21548.0) -
単体のファイルでファイルテストを行います。
...値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していないものは、真偽値を返しま......イルを実 uid で実行できる
: ?O
ファイルの所有者が実 uid である
: ?e
ファイルが存在する
: ?z
ファイルサイズが 0 である
: ?s
ファイルサイズが 0 でない (ファイルサイズを返す、0 ならば nil) -> Integer|nil
: ?f
ファ......ticky ビットがセットされている
: ?M
ファイルの最終更新時刻を返す -> Time
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time
//emlist[例][ruby]{
IO.write("testfile", "test")
test("r", "testfile... -
Kernel
. # test(cmd , file1 , file2) -> bool (21528.0) -
2ファイル間のファイルテストを行います。
...の文字だけをコマンドとみなします。
@param file1 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@param file2 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 真偽値を......イル1とファイル2が同一のファイルである
//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}
# => =: true
# => <: false
# => >: false
# => -: false... -
MiniTest
:: Assertions # assert _ nil(object , message = nil) -> true (21524.0) -
与えられたオブジェクトが nil である場合、検査にパスしたことになります。
...与えられたオブジェクトが nil である場合、検査にパスしたことになります。
@param object 任意のオブジェクトを指定します。
@param message 検査に失敗した場合に表示するメッセージを指定します。
文字列か Proc......を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 与えられたオブジェクトが nil でない場合に発生します。... -
MiniTest
:: Unit :: TestCase :: SUPPORTS _ INFO _ SIGNAL -> Fixnum | nil (21401.0) -
Signal が INFO というシグナルをサポートしているかどうかを 調べるための定数です。内部で使用します。
...Signal が INFO というシグナルをサポートしているかどうかを
調べるための定数です。内部で使用します。... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (18933.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...el.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param fil......@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "......foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: CommandProcessor # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (18933.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...el.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@param fil......@param file2 文字列でファイルへのパスを指定します。
require 'shell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "......foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
ARGF
. class # internal _ encoding -> Encoding | nil (18535.0) -
ARGF から読み込んだ文字列の内部エンコーディングを返します。 内部エンコーディングが指定されていない場合は nil を返します。
...は nil を返します。
まだ読み込み処理を始めていない場合は Encoding.default_external を返します。
ARGF.class#set_encoding で設定します。
例:
# $ ruby -Eutf-8 test.rb
# test.rb
ARGF.internal_encoding # => #<Encoding:UTF-8>
ARGF.set_encoding......('utf-8','ascii')
ARGF.internal_encoding # => #<Encoding:US-ASCII>
例:
ARGF.binmode
ARGF.internal_encoding # => nil
@see IO, ARGF.class#external_encoding... -
MiniTest
:: Assertions # assert _ in _ delta(expected , actual , delta = 0 . 001 , message = nil) -> true (18401.0) -
期待値と実際の値の差の絶対値が与えられた絶対誤差以下である場合、検査にパスしたことになります。
...param actual 実際の値を指定します。
@param delta 許容する絶対誤差を指定します。
@param message 検査に失敗した場合に表示するメッセージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した......結果を使用します。
@raise MiniTest::Assertion 与えられた期待値と実際の値の差の絶対値が与えられた差分を越える場合に発生します。... -
MiniTest
:: Assertions # assert _ in _ epsilon(actual , expected , epsilon = 0 . 001 , message = nil) -> true (18401.0) -
与えられた期待値と実際の値の相対誤差が許容範囲内である場合、検査にパスしたことになります。
...が真である場合、検査をパスします。
[expected, actual].min * epsilon >= (extected - actual).abs
@param expected 期待値を指定します。
@param actual 実際の値を指定します。
@param epsilon 許容する相対誤差を指定します。
@param message 検査に......失敗した場合に表示するメッセージを指定します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 検査に失敗した場合に発生します。... -
GC
. latest _ gc _ info(key) -> object (18306.0) -
最新のGCの情報を返します。
...最新のGCの情報を返します。
@param result_hash 戻り値のためのハッシュを指定します。省略した場合は新
しくハッシュを作成します。result_hash の内容は上書き
されます。
@param key 得られる情報か......Symbol で指定します。
//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}
stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true
GC.latest_gc_info(:... -
GC
. latest _ gc _ info(result _ hash = {}) -> Hash (18306.0) -
最新のGCの情報を返します。
...最新のGCの情報を返します。
@param result_hash 戻り値のためのハッシュを指定します。省略した場合は新
しくハッシュを作成します。result_hash の内容は上書き
されます。
@param key 得られる情報か......Symbol で指定します。
//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}
stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true
GC.latest_gc_info(:... -
MiniTest
:: Assertions # assert _ includes(collection , object , message = nil) -> true (18301.0) -
与えられたコレクションにオブジェクトが含まれている場合、検査にパスしたことになります。
...与えられたコレクションにオブジェクトが含まれている場合、検査にパスしたことになります。
@param collection 任意のコレクションを指定します。
@param object 任意のオブジェクトを指定します。
@param message 検査に失敗した......。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 第一引数のオブジェクトが include? メソッドを持たない場合に発生します。... -
FileTest
. # world _ writable?(path) -> bool (18216.0) -
path が全てのユーザから書き込めるならば、そのファイルのパーミッションを表す 整数を返します。そうでない場合は nil を返します。
...ンを表す
整数を返します。そうでない場合は nil を返します。
整数の意味はプラットフォームに依存します。
@param path パスを表す文字列を指定します。
m = FileTest.world_writable?("/tmp")
"%o" % m #=> "777... -
ARGF
. class # inplace _ mode -> String | nil (15543.0) -
c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。
...#inplace で書き換えるファイルのバックアップに付加される拡
張子を返します。拡張子が設定されていない場合は空文字列を返します。イン
プレースモードでない場合は nil を返します。
Ruby 起動時の -i オプション や ARGF.cl......ass#inplace_mode= で設定します。
例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"
# test.rb
ARGF.inplace_mode # => ".bak"
ARGF.each_line {|e|print e.upcase} # => "TEST"
例:
# $......echo "test" > test.txt
# $ ruby test.rb test.txt
# $ cat test.txt # => "test"
# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"
@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=...