クラス
- Array (24)
- Class (24)
- Complex (36)
- Data (21)
- Dir (402)
- Encoding (96)
-
Encoding
:: Converter (72) - Enumerator (25)
-
Enumerator
:: Chain (7) -
Enumerator
:: Lazy (12) - Exception (32)
- Fiber (16)
- File (739)
-
File
:: Stat (12) - Hash (48)
- IO (504)
- Integer (12)
- Module (24)
- Mutex (2)
- NoMethodError (19)
- Object (12)
- Random (113)
- Range (12)
- Regexp (96)
- RubyVM (1)
-
RubyVM
:: InstructionSequence (116) - Set (9)
- SignalException (36)
- String (43)
- Struct (64)
- SystemCallError (48)
- SystemExit (12)
- Thread (222)
-
Thread
:: ConditionVariable (10) -
Thread
:: Mutex (10) -
Thread
:: Queue (14) -
Thread
:: SizedQueue (10) - ThreadGroup (12)
- Time (192)
- TracePoint (35)
モジュール
- GC (116)
-
GC
:: Profiler (48) - Process (92)
-
RubyVM
:: AbstractSyntaxTree (30) -
RubyVM
:: MJIT (21) - Warning (17)
キーワード
- === (12)
- DEBUG (12)
- DEBUG= (12)
- [] (75)
- []= (6)
- abort (24)
-
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) -
absolute
_ path (12) -
absolute
_ path? (6) -
asciicompat
_ encoding (24) - at (53)
- atime (12)
-
auto
_ compact (4) -
auto
_ compact= (4) - basename (12)
- binread (12)
- binwrite (12)
- birthtime (11)
- blockdev? (12)
- bytes (7)
- categories (1)
- chardev? (12)
- chdir (36)
- children (16)
- chmod (12)
- chown (12)
- chroot (12)
- clone (12)
- compact (6)
- compatible? (12)
- compile (24)
-
compile
_ file (12) -
compile
_ option (12) -
compile
_ option= (12) - constants (12)
-
copy
_ stream (24) - count (12)
- ctime (12)
- current (16)
-
default
_ external (12) -
default
_ external= (12) -
default
_ internal (12) -
default
_ internal= (12) - define (6)
-
define
_ method (24) - delete (48)
-
delete
_ if (24) - directory? (12)
- dirname (12)
- disasm (12)
- disassemble (12)
- each (12)
-
each
_ child (32) -
each
_ key (12) -
each
_ pair (12) -
each
_ value (12) - empty? (30)
- enabled? (7)
- entries (24)
- escape (12)
- except (4)
- exception (12)
- exclusive (12)
- executable? (12)
-
executable
_ real? (12) - exist? (24)
- exists? (18)
- exit (24)
- exit! (12)
- extname (12)
- fetch (36)
- file? (12)
- filter (14)
- filter! (14)
- fnmatch (12)
- fnmatch? (12)
-
for
_ fd (12) - foreach (72)
- fork (36)
- ftype (12)
- getwd (12)
- glob (24)
- gm (24)
- grpowned? (12)
-
handle
_ interrupt (12) - home (24)
- identical? (12)
- index (7)
- inspect (24)
- invert (12)
- join (12)
-
keep
_ if (19) - key (12)
- keys (12)
-
keyword
_ init? (4) - kill (12)
-
last
_ match (24) -
last
_ status (8) -
latest
_ gc _ info (24) - lchmod (12)
- lchown (12)
- left (12)
- length (12)
- list (24)
-
load
_ from _ binary (10) -
load
_ from _ binary _ extra _ data (10) - local (24)
-
locale
_ charmap (12) - lstat (12)
- lutime (8)
- main (12)
- members (15)
- merge! (12)
- mkdir (12)
- mktime (24)
- mtime (12)
-
name
_ list (12) - nesting (12)
- new (537)
-
new
_ seed (12) - now (12)
- of (22)
- open (96)
- owned? (12)
- parse (10)
-
parse
_ file (10) - pass (12)
- path (12)
- pause (7)
-
pending
_ interrupt? (12) - pipe (84)
- pipe? (12)
- polar (12)
- popen (168)
- private (27)
- produce (6)
- public (5)
- pwd (12)
- quote (12)
- rand (36)
-
raw
_ data (12) -
raw
_ seed (2) - read (36)
- readable? (12)
-
readable
_ real? (12) - readlines (36)
- readlink (12)
- realdirpath (12)
- realpath (12)
- rect (12)
- rectangular (12)
- reject (24)
- reject! (24)
- rename (12)
- report (12)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
resolve
_ feature _ path (1) - result (12)
- resume (7)
- rmdir (12)
-
search
_ convpath (12) - select (36)
- select! (24)
- setgid? (12)
- setuid? (12)
- shift (12)
- size (24)
- size? (12)
- socket? (12)
- spawn (12)
- split (12)
- sqrt (8)
- srand (24)
- start (24)
- stat (47)
- state (12)
- sticky? (12)
- stop (12)
- store (12)
- stress (12)
- stress= (12)
- symlink? (12)
- sysopen (12)
-
to
_ a (12) -
to
_ h (19) -
to
_ hash (12) -
to
_ s (24) -
to
_ tty? (8) -
total
_ time (12) - trace (12)
- truncate (12)
-
try
_ convert (64) - umask (24)
- union (12)
- unlink (24)
- update (24)
- urandom (8)
- utc (24)
- utime (12)
- values (12)
-
values
_ at (12) -
verify
_ compaction _ references (6) - warn (4)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (24)
- yield (12)
- zero? (12)
検索結果
先頭5件
-
Exception
. exception(error _ message = nil) -> Exception (9203.0) -
例外オブジェクトを生成して返します。
...属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}
//emlist[例][ruby]{
e = Exception.exception("some messa......ge")
p e # => #<Exception: some message>
p e.message # => "some message"
//}... -
RubyVM
:: InstructionSequence . load _ from _ binary _ extra _ data(binary) -> String (9203.0) -
バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。
...埋め込まれたextra_dataを取り出します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}
@see RubyVM::InstructionSequence#to_binary... -
String
. try _ convert(obj) -> String | nil (9203.0) -
obj を String に変換しようと試みます。変換には Object#to_str メソッ ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ た場合は nil が返されます。
...bj を String に変換しようと試みます。変換には Object#to_str メソッ
ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ
た場合は nil が返されます。
@param obj 変換する任意のオブジェクト
@return......変換後の文字列または nil
//emlist[例][ruby]{
String.try_convert("str") # => "str"
String.try_convert(/re/) # => nil
//}... -
TracePoint
. trace(*events) {|obj| . . . } -> TracePoint (9203.0) -
新しい TracePoint オブジェクトを作成して自動的にトレースを開始し ます。TracePoint.new のコンビニエンスメソッドです。
...新しい TracePoint オブジェクトを作成して自動的にトレースを開始し
ます。TracePoint.new のコンビニエンスメソッドです。
@param events トレースするイベントを String か Symbol で任
意の数指定します。指定できる値に......ついては
TracePoint.new を参照してください。
//emlist[例][ruby]{
trace = TracePoint.trace(:call) { |tp| [tp.lineno, tp.event] }
# => #<TracePoint:0x007f786a452448>
trace.enabled? # => true
//}
@raise ThreadError ブロックを指定しなかった場合に発生し... -
File
. lutime(atime , mtime , *filename) -> Integer (6303.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。 シンボリックリンクに対しては File.utime と違って、 シンボリックそのものを変更します。
...リックリンクに対しては File.utime と違って、
シンボリックそのものを変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数......を数値で指定します。
@param filename ファイル名を表す文字列を指定します。複数指定できます。
@return 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
@see File.utime... -
File
. utime(atime , mtime , *filename) -> Integer (6303.0) -
ファイルの最終アクセス時刻と更新時刻を変更します。
...ァイルの最終アクセス時刻と更新時刻を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒数を数値で指定します。
@param fil......eturn 変更したファイルの数を返します。
@raise Errno::EXXX 変更に失敗した場合に発生します。
//emlist[例: Time を指定][ruby]{
atime = Time.new(2018, 1, 2, 3, 4, 5)
mtime = Time.new(2018, 2, 3, 4, 5, 6)
File.utime(atime, mtime, "testfile") # => 1
File.atime("testf......2018-01-02 03:04:05 +0900
File.mtime("testfile") # => 2018-02-03 04:05:06 +0900
//}
//emlist[例: 経過秒数で指定][ruby]{
File.utime(1, 2, "testfile") # => 1
File.atime("testfile") # => 1970-01-01 09:00:01 +0900
File.mtime("testfile") # => 1970-0......ックリンクに対しては File.lutime と違って、
シンボリックのリンク先を変更します。
@param atime 最終アクセス時刻を Time か、起算時からの経過秒数を数値で指定します。
@param mtime 更新時刻を Time か、起算時からの経過秒... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (6303.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...@param string パースする対象の Ruby のコードを文字列で指定します。
@raise SyntaxError string が Ruby のコードとして正しくない場合に発生します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
#......args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
//}......string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定すると、 Node#to......rror_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとして正しくない場合に発生します。
//emlist[][ru......ubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant: true)
# =>... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (6303.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定すると、 Node#to......rror_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError string が Ruby のコードとして正しくない場合に発生します。
//emlist[][ru......ubyVM::AbstractSyntaxTree.parse("x = 1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant: true)
# =>... -
File
. lstat(filename) -> File :: Stat (6221.0) -
File.statと同様ですが、シンボリックリンクに関してリンクそのものの 情報を File::Stat として返します。lstat(2) を実装していないシステムでは、File.stat と同じです。
...File.statと同様ですが、シンボリックリンクに関してリンクそのものの
情報を File::Stat として返します。lstat(2) を実装していないシステムでは、File.stat と同じです。
@param filename ファイル名を表す文字列を指定します。
@ra......ise Errno::EXXX 情報の取得に失敗した場合に発生します。
//emlist[例][ruby]{
# link.rb は t.rb のシンボリックリンク
File.lstat("link.rb") == File.stat("t.rb") # => false
File.stat("link.rb") == File.stat("t.rb") # => true
//}
@see IO#stat, File#lstat... -
Dir
. entries(path) -> [String] (6203.0) -
ディレクトリ path に含まれるファイルエントリ名の 配列を返します。
...ディレクトリ path に含まれるファイルエントリ名の
配列を返します。
@param path ディレクトリのパスを文字列で指定します。
@param encoding ディレクトリのエンコーディングを文字列か
Encoding オブジェクトで指定......します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
Dir.entries('.') #=> [".", "..", "bar", "foo"]
//}
@see Dir.foreach......します。省略した場合は
ファイルシステムのエンコーディングと同じになります。
@raise Errno::EXXX 失敗した場合に発生します。
//emlist[例][ruby]{
Dir.entries('.') #=> [".", "..", "bar", "foo"]
//}
@see Dir.foreach
@see Dir.children...