985件ヒット
[1-100件を表示]
(0.120秒)
種類
- インスタンスメソッド (398)
- モジュール関数 (387)
- 特異メソッド (189)
- モジュール (11)
クラス
オブジェクト
- ENV (22)
キーワード
- FileTest (11)
- atime (11)
-
backtrace
_ locations (33) - binmode (11)
- blockdev? (11)
-
caller
_ locations (22) - chardev? (11)
- chomp (11)
- chop (11)
- chown (11)
- chr (11)
- clone (11)
- close (11)
- closed? (11)
-
const
_ source _ location (5) - ctime (22)
- delete (33)
- directory? (11)
- dup (11)
-
each
_ char (22) -
each
_ codepoint (22) - empty? (8)
- encoding (11)
- executable? (11)
-
executable
_ real? (11) - exist? (11)
- exists? (9)
- fdatasync (11)
- file? (11)
- flush (11)
- getc (11)
- gets (33)
- grpowned? (11)
- gsub (22)
- hash (11)
- identical? (11)
-
inplace
_ mode (11) - inspect (16)
-
internal
_ encoding (11) -
latest
_ gc _ info (22) - lchmod (11)
- lchown (11)
- length (11)
- link (11)
- mtime (11)
- new (35)
- open (22)
- owned? (11)
- path (11)
- pipe? (11)
- puts (11)
- read (11)
- readable? (11)
-
readable
_ real? (11) - readlink (11)
-
set
_ backtrace (11) - setgid? (11)
- setuid? (11)
- size (22)
- size? (11)
- socket? (11)
-
source
_ location (6) - sticky? (11)
- symlink? (11)
-
to
_ s (5) - unlink (11)
- warn (7)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (7)
- zero? (11)
検索結果
先頭5件
-
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (26331.0) -
単体のファイルでファイルテストを行います。
...値
です。文字列の場合はその先頭の文字だけをコマンドとみなします。
@param file テストするファイルのパスを表す文字列か IO オブジェクトを指定します。
@return 下表に特に明記していないものは、真偽値を返しま......イルを実効 uid で読むことができる
: ?w
ファイルに実効 uid で書くことができる
: ?x
ファイルを実効 uid で実行できる
: ?o
ファイルの所有者が実効 uid である
: ?G
ファイルのグループ所有者が実効 gid である
: ?R......ファイルを実 uid で読むことができる
: ?W
ファイルに実 uid で書くことができる
: ?X
ファイルを実 uid で実行できる
: ?O
ファイルの所有者が実 uid である
: ?e
ファイルが存在する
: ?z
ファイルサイズが 0 である
:... -
Kernel
. # test(cmd , file1 , file2) -> bool (26326.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... -
ARGF
. class # internal _ encoding -> Encoding | nil (20314.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('u......tf-8','ascii')
ARGF.internal_encoding # => #<Encoding:US-ASCII>
例:
ARGF.binmode
ARGF.internal_encoding # => nil
@see IO, ARGF.class#external_encoding... -
FileTest
. # file?(file) -> bool (20202.0) -
ファイルが通常ファイルである時に真を返します。そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。
...file ファイル名を表す文字列か IO オブジェクトを指定します。
@raise IOError 指定された IO オブジェクト file が既に close されていた場合に発生します。
例:
FileTest.file?('/bin/bash') # => true
FileTest.file?('/bin') # => false
FileTest.fil......e?('/no_such_file') # => false... -
GC
. latest _ gc _ info(key) -> object (20202.0) -
最新のGCの情報を返します。
...します。
//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_by) # => :... -
GC
. latest _ gc _ info(result _ hash = {}) -> Hash (20202.0) -
最新のGCの情報を返します。
...します。
//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_by) # => :... -
FileTest (20002.0)
-
ファイルの検査関数を集めたモジュールです。
...めたモジュールです。
=== 注意
FileTest で定義された各メソッドは、システムコールに失敗しても例外を発生させません。
真を返した時のみ、返り値は意味をもちます。
例えば、
File.exist?('/root/.bashrc')
が false を返しても、... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (17232.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if D......aise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:i......n `<main>'"]
//}
@see Exception#backtrace... -
String
# encoding -> Encoding (17208.0) -
文字列のエンコーディング情報を表現した Encoding オブジェクトを返します。
...列のエンコーディング情報を表現した Encoding オブジェクトを返します。
//emlist[例][ruby]{
# encoding: utf-8
utf8_str = "test"
euc_str = utf8_str.encode("EUC-JP")
utf8_str.encoding # => #<Encoding:UTF-8>
euc_str.encoding # => #<Encoding:EUC-JP>
//}
@see Encoding... -
TracePoint
# inspect -> String (17208.0) -
self の状態を人間に読みやすい文字列にして返します。
...self の状態を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.inspect # "#<TracePoint:call `foo'@/path/to/test.rb:1>"
end
trace.enable
foo 1
//}...