種類
- 文書 (77)
- インスタンスメソッド (47)
- 特異メソッド (34)
- モジュール関数 (33)
ライブラリ
- ビルトイン (66)
- mkmf (11)
- shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) -
test
/ unit (1)
クラス
- File (33)
- Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12)
モジュール
- FileTest (11)
- Kernel (33)
-
Test
:: Unit (1)
キーワード
-
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) - Ruby用語集 (11)
- [] (18)
-
create
_ makefile (11) - identical? (11)
- new (11)
- open (22)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
setup
_ argv (1) - クラス/メソッドの定義 (11)
検索結果
先頭5件
- Kernel
. # test(cmd , file1 , file2) -> bool - Kernel
. # test(cmd , file) -> bool | Time | Integer | nil - Kernel
# create _ makefile(target , srcprefix = nil) -> true - Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil - Shell
:: CommandProcessor # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil
-
Kernel
. # test(cmd , file1 , file2) -> bool (39340.0) -
2ファイル間のファイルテストを行います。
...文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file1 テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@param file2 テストするファイルのパスを表す文字列か IO オブジェクトを指定......ァイル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
# => -: fals... -
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (39240.0) -
単体のファイルでファイルテストを行います。
...るいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していない......me
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time
//emlist[例][ruby]{
IO.write("testfile", "test")
test("r", "testfile") # => true
test("s", "testfile") # => 4
test("M", "testfile") # => 2018-03-31 07:38:40 +0900
//}... -
Kernel
# create _ makefile(target , srcprefix = nil) -> true (27148.0) -
@todo
...@todo
Kernel#have_library などの各種検査の結果を元に、拡張ライブラリを
ビルドするための Makefile を生成します。
extconf.rb は普通このメソッドの呼び出しで終ります。
@param target ターゲットとなる拡張ライブラリの名前を指......トリ名と見
なされ、生成された Makefile はそのディレクトリ構造に従い
ます。
例えば、'test/foo' を指定した場合、拡張ライブラリは
'test' ディレクトリにインストールされます。こ......の拡張ライブ
ラリを Ruby スクリプトから使用するときは
"require 'test/foo'" とする必要があります。
@param srcprefix ソースコードがあるディレクトリ名を指定します。
省略した場合は extconf.rb... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15373.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......m file1 文字列でファイルへのパスを指定します。
@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 (15373.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......m file1 文字列でファイルへのパスを指定します。
@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
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15373.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...
Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......m file1 文字列でファイルへのパスを指定します。
@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... -
File
. new(path , mode = "r" , perm = 0666) -> File (9209.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......す。Kernel.#open と同じです。
@param perm ファイルを生成する場合のファイルのパーミッションを整数で指定します。Kernel.#open と同じです。
@raise Errno::EXXX ファイルのオープンに失敗した場合に発生します。
//emlist[例: File.new......ァイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による書き込みモード... -
File
. open(path , mode = "r" , perm = 0666) -> File (9209.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......す。Kernel.#open と同じです。
@param perm ファイルを生成する場合のファイルのパーミッションを整数で指定します。Kernel.#open と同じです。
@raise Errno::EXXX ファイルのオープンに失敗した場合に発生します。
//emlist[例: File.new......ァイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による書き込みモード... -
File
. open(path , mode = "r" , perm = 0666) {|file| . . . } -> object (9209.0) -
path で指定されるファイルをオープンし、File オブジェクトを生成して 返します。
...、File オブジェクトを生成して
返します。
path が整数の場合はファイルディスクリプタとして扱い、それに対応する
File オブジェクトを生成して返します。IO.open と同じです。
ブロックを指定して呼び出した場合は、File オ......す。Kernel.#open と同じです。
@param perm ファイルを生成する場合のファイルのパーミッションを整数で指定します。Kernel.#open と同じです。
@raise Errno::EXXX ファイルのオープンに失敗した場合に発生します。
//emlist[例: File.new......ァイルオープン][ruby]{
f = File.new("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による読み込みモードでのファイルオープン][ruby]{
f = File.open("testfile", "r")
f.class # => File
f.close
//}
//emlist[例: File.open による書き込みモード... -
FileTest
. # identical?(file1 , file2) -> bool (6324.0) -
file1 と file2 が同じファイルを指している時に真を返します。 そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
...
file1 と file2 が同じファイルを指している時に真を返します。
そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
ruby 1.8.3 以前ではKernel.#test(?-, file1, file2)を使......p File.identical?("a", "a") #=> true
p File.identical?("a", "./a") #=> true
File.link("a", "b")
p File.identical?("a", "b") #=> true
File.symlink("a", "c")
p File.identical?("a", "c") #=> true
open("d", "w") {}
p File.identical?("a", "d") #=> false
@param file1......ァイル名を表す文字列か IO オブジェクトを指定します。
@param file2 ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file1, file2 が既に close されていた場合に発生します。... -
Test
:: Unit . setup _ argv(original _ argv = ARGV) { |files| . . . } -> [String] (3136.0) -
original_argvで指定されたオプションを解析して、テスト対象になるファイル をrequireします。
...にあるtest_*.rbを全てrequireします。
このメソッド自体は、オプションを解析してrequireを行う以外の処理は行いま
せんが、test/unit.rbをrequireして呼び出すメソッドのため、結果的にユニッ
トテストが実行されます。testrbコマ......使えます。なお、--name=test_fooのような指定は行えません。--name test_foo
のように指定してください。
: -x
指定されたファイルを除外します。ファイルの指定に正規表現も使えます。
: -s, --seed
Kernel.#rand の乱数の種を指定......ess に true を設定します。
: --no-gc-stress
GC.stress に false を設定します。
===== 注意
Test::Unit.setup_argvはoriginal_argvの指定に関わらず、ARGVをfilesで置き
換えます。置き換えられたARGVはminitest/unitによってもう1度解析されます。... -
ruby 1
. 8 . 4 feature (540.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4 feature/File.basename [change]>))
* ((<ruby 1.8.4 feature/File.dirname [change]>))
*......1.8.4 feature/File.basename (Win全般) [change]>))
* ((<ruby 1.8.4 feature/File.dirname (Win全般) [bug]>))
* ((<ruby 1.8.4 feature/File::Stat#pipe? [bug]>))
* ((<ruby 1.8.4 feature/Array#fill [bug]>))
* ((<ruby 1.8.4 feature/String#scan [bug]>))
* ((<ruby 1.8.4 feature/File.join [bug]>)......from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.
: super [bug]
Kernelのメソッド内でsuperを呼んだ時に、存在しないsuperclass
にアクセスしようとするバグの修正。
module Kernel...