るりまサーチ

最速Rubyリファレンスマニュアル検索!
36件ヒット [1-36件を表示] (0.011秒)

別のキーワード

  1. _builtin <
  2. bigdecimal <
  3. float <
  4. module <
  5. integer <

ライブラリ

キーワード

検索結果

Kernel.#print(*arg) -> nil (20.0)

引数を順に標準出力 $stdout に出力します。引数が与えられない時には変数 $_ の値を出力します。

...た場合に発生します。

//emlist[例][ruby]{
print "Hello, world!"
print "Regexp is",/ant/
print nil
print "\n"
#=> Hello, world!Regexp is(?-mix:ant)

$_ = "input"
$, = "<and>"
$\ = "<end>\n"
print
print "AA","BB"
#=> input<end>
#=> AA<and>BB<end>
//}

@see Kernel.#puts,Kernel.#p,IO#print...

Kernel.#test(cmd, file1, file2) -> bool (8.0)

2ファイル間のファイルテストを行います。

...終更新時刻が新しい
: ?<
ファイル1の方がファイル2より最終更新時刻が古い
: ?-
ファイル1とファイル2が同一のファイルである

//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = tes...
...t(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}

# => =: true
# => <: false
# => >: false
# => -: false...

Kernel.#test(cmd, file) -> bool | Time | Integer | nil (3.0)

単体のファイルでファイルテストを行います。

単体のファイルでファイルテストを行います。

@param cmd 以下に示す文字リテラル、文字列、あるいは同じ文字を表す数値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していないものは、真偽値を返します。

以下は cmd として指定できる文字リテラルとその意味です。

: ?r
ファイルを実効 uid で読むことができる
: ?w
ファイルに実効 uid で書くことができる
: ?x
ファイルを...