ライブラリ
- ビルトイン (4740)
-
shell
/ command-processor (12)
クラス
- Array (60)
- Class (24)
- Complex (36)
- Data (21)
- Dir (414)
- Encoding (120)
-
Encoding
:: Converter (72) - Enumerator (25)
-
Enumerator
:: Chain (7) -
Enumerator
:: Lazy (12) -
Errno
:: EXXX (24) - Exception (32)
- Fiber (28)
- File (773)
-
File
:: Stat (12) - FrozenError (14)
- Hash (66)
- IO (516)
- Integer (12)
- KeyError (28)
- Module (60)
- Mutex (2)
- NameError (19)
- NoMethodError (19)
- Object (12)
- Proc (19)
- Random (125)
- Range (12)
- Regexp (96)
- RubyVM (1)
-
RubyVM
:: InstructionSequence (104) - Set (9)
-
Shell
:: CommandProcessor (12) - SignalException (36)
- String (43)
- Struct (64)
- Symbol (12)
- SystemCallError (48)
- SystemExit (12)
- Thread (210)
-
Thread
:: ConditionVariable (10) -
Thread
:: Mutex (10) -
Thread
:: Queue (14) -
Thread
:: SizedQueue (10) - ThreadGroup (12)
- Time (192)
- TracePoint (35)
モジュール
- GC (124)
-
GC
:: Profiler (96) - Process (104)
-
RubyVM
:: AbstractSyntaxTree (30) -
RubyVM
:: MJIT (21) - Warning (22)
キーワード
- === (12)
- DEBUG (12)
- DEBUG= (12)
- [] (87)
- []= (6)
- abort (24)
-
abort
_ on _ exception (12) -
absolute
_ path (12) -
absolute
_ path? (6) - aliases (12)
-
all
_ symbols (12) -
asciicompat
_ encoding (24) - assoc (12)
- at (53)
- atime (12)
-
auto
_ compact (4) - basename (12)
- binread (12)
- binwrite (12)
- birthtime (11)
- blockdev? (12)
- bytes (7)
- categories (1)
- chardev? (12)
- chdir (48)
- children (16)
- chmod (12)
- chown (12)
- chroot (12)
- clear (24)
- clone (12)
- compact (6)
- compatible? (12)
- compile (24)
-
compile
_ file (12) -
compile
_ option (12) - constants (12)
-
copy
_ stream (24) - count (12)
- ctime (12)
- current (16)
-
def
_ builtin _ commands (6) -
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)
- disable (24)
- disasm (12)
- disassemble (12)
- dup (4)
- each (24)
-
each
_ child (32) -
each
_ key (24) -
each
_ pair (24) -
each
_ value (24) - empty? (30)
- enable (24)
- enabled? (19)
- entries (24)
- escape (12)
- except (4)
- exception (12)
- exclusive (12)
- exec (12)
- executable? (12)
-
executable
_ real? (12) - exist? (24)
- exists? (18)
- exit (24)
- exit! (12)
- extname (12)
- fetch (36)
- file? (12)
- filter (14)
- filter! (14)
- find (12)
- fnmatch (12)
- fnmatch? (12)
-
for
_ fd (12) - foreach (72)
- fork (36)
- freeze (6)
- ftype (12)
- getwd (12)
- glob (24)
- gm (24)
- grpowned? (12)
-
handle
_ interrupt (12) -
has
_ key? (12) -
has
_ value? (12) - home (24)
- identical? (12)
- include (12)
- include? (12)
- index (7)
- inspect (24)
-
install
_ builtin _ commands (6) - invert (12)
- join (12)
-
keep
_ if (24) - key (12)
- 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)
- link (12)
- list (24)
-
load
_ from _ binary (10) -
load
_ from _ binary _ extra _ data (10) - local (24)
-
locale
_ charmap (12) - lstat (12)
- lutime (8)
- main (12)
- member? (12)
- members (15)
- merge! (12)
- mkdir (12)
- mkfifo (10)
- mktime (24)
- mtime (12)
-
name
_ list (12) - nesting (12)
- new (725)
-
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 (96)
- pipe? (12)
- polar (12)
- popen (168)
- private (27)
- produce (6)
- public (27)
- pwd (12)
- quote (12)
- rand (36)
- rassoc (12)
-
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)
- rehash (12)
- reject (24)
- reject! (24)
- rename (12)
- replace (12)
- report (12)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
resolve
_ feature _ path (1) - result (12)
- resume (7)
- rmdir (12)
-
ruby2
_ keywords _ hash? (6) -
search
_ convpath (12) - select (36)
- select! (24)
- setgid? (12)
- setuid? (12)
- shift (12)
- size (24)
- size? (12)
- slice (7)
- socket? (12)
- spawn (12)
- split (12)
- sqrt (8)
- srand (24)
- start (24)
- stat (47)
- state (12)
- sticky? (12)
- stop (12)
- store (12)
- stress (12)
- symlink (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)
-
used
_ modules (12) - using (12)
- utc (24)
- utime (12)
- value? (12)
- values (12)
-
values
_ at (12) -
verify
_ compaction _ references (6) - warn (9)
-
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - write (24)
- yield (12)
- zero? (12)
検索結果
先頭5件
- Encoding
:: Converter . search _ convpath(source _ encoding , destination _ encoding , options) -> Array - Encoding
:: Converter . new(convpath) -> Encoding :: Converter - Encoding
:: Converter . new(source _ encoding , destination _ encoding) -> Encoding :: Converter - Encoding
:: Converter . new(source _ encoding , destination _ encoding , options) -> Encoding :: Converter - Time
. at(time) -> Time
-
Encoding
:: Converter . search _ convpath(source _ encoding , destination _ encoding , options) -> Array (8281.0) -
引数で指定した文字エンコーディングの変換の経路を配列にして返します。
...ch_convpath("ISO-8859-1", "EUC-JP")
# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>]]
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true)
# or
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", newline: :u......# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
# "universal_newline"]
p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true)
# or
p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", newline: :unive......rsal)
# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# "universal_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-32BE>]]
//}
@see Encoding::Converter#convpath, Encoding::Converter.new... -
Encoding
:: Converter . new(convpath) -> Encoding :: Converter (8221.0) -
Encoding::Converter オブジェクトを作成します。
...t[][ruby]{
# UTF-16BE to UTF-8
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
# Usually, decorators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],......verter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
p ec.convpath #=> ["crlf_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
# Conversion path can be specified directly.
ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
p ec.c......onvpath #=> ["universal_newline",
# [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
//}... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding) -> Encoding :: Converter (8221.0) -
Encoding::Converter オブジェクトを作成します。
...t[][ruby]{
# UTF-16BE to UTF-8
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
# Usually, decorators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],......verter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
p ec.convpath #=> ["crlf_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
# Conversion path can be specified directly.
ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
p ec.c......onvpath #=> ["universal_newline",
# [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
//}... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding , options) -> Encoding :: Converter (8221.0) -
Encoding::Converter オブジェクトを作成します。
...t[][ruby]{
# UTF-16BE to UTF-8
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
# Usually, decorators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],......verter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
p ec.convpath #=> ["crlf_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
# Conversion path can be specified directly.
ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
p ec.c......onvpath #=> ["universal_newline",
# [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
//}... -
Time
. at(time) -> Time (8209.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(......e.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).......0000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: "UTC") # => 2020-02-26 12:58:19 UTC
Time.at(1582721899, in: "C") # => 2020-02-26 13:58:19 +0300
//}... -
Time
. at(time , in:) -> Time (8209.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(......e.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).......0000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: "UTC") # => 2020-02-26 12:58:19 UTC
Time.at(1582721899, in: "C") # => 2020-02-26 13:58:19 +0300
//}... -
Time
. at(time) -> Time (8185.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(T......# => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19......+0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
//}... -
Time
. at(time , in:) -> Time (8185.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(T......# => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19......+0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
//}... -
Time
. new(iso8601 , in: nil) -> Time (8183.0) -
引数で指定した地方時の Time オブジェクトを返します。
...#inspectの結果や制限されたISO-8601形式などの文字列を指定します。
@param in 協定世界時との時差を、秒を単位とする整数か、
"UTC" かミリタリータイムゾーンの文字列または
"+HH:MM" "-HH:MM" 形式の文字列で指定し......の場合に発生します。
//emlist[][ruby]{
p Time.new("2024-02-15 10:20:30") # => 2024-02-15 10:20:30 +0900
p Time.new("2024-02-15 10:20:30 UTC", in: "+0800") # => 2024-02-15 10:20:30 UTC
p Time.new("2024-02-15 10:20:30", in: "+0800") # => 2024-02-15 10:20:30 +0800
//}... -
Encoding
. list -> [Encoding] (8179.0) -
現在ロードされているエンコーディングのリストを返します。
...coding:ASCII-8BIT>, #<Encoding:EUC-JP>,
# #<Encoding:Shift_JIS>, #<Encoding:UTF-8>,
# #<Encoding:ISO-2022-JP (dummy)>]
Encoding.find("US-ASCII")
# => #<Encoding:US-ASCII>
Encoding.list
# => [#<Encoding:ASCII-8BIT>, #<Encoding:EUC-JP>,
# #<Encoding:Shift_JIS>, #<Encoding:UTF-8>,
# #......<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (8179.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...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)
# => (SCOPE@1:0-1:15
# tbl: [:x, :......y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (LIT@1:4-1:5 1)) (ERROR@1:7-1:11) (LASGN@1:12-1:15 :y (LIT@1:14-1:15 2))))
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (8179.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...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)
# => (SCOPE@1:0-1:15
# tbl: [:x, :......y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (LIT@1:4-1:5 1)) (ERROR@1:7-1:11) (LASGN@1:12-1:15 :y (LIT@1:14-1:15 2))))
//}... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (8161.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...8-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5......pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:21 :puts (LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (8161.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...8-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5......pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:21 :puts (LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}... -
Time
. at(time) -> Time (8161.0) -
time で指定した時刻の Time オブジェクトを返します。
...970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31... -
Encoding
. compatible?(obj1 , obj2) -> Encoding | nil (8149.0) -
2つのオブジェクトのエンコーディングに関する互換性をチェックします。 互換性がある場合はそのエンコーディングを、 ない場合は nil を返します。
...ます。
//emlist[例][ruby]{
Encoding.compatible?("\xa1".force_encoding("iso-8859-1"), "b")
#=> #<Encoding:ISO-8859-1>
Encoding.compatible?(
"\xa1".force_encoding("iso-8859-1"),
"\xa1\xa1".force_encoding("euc-jp"))
#=> nil
//}
引数が文字列でない場合でも、両方のオブジェ......ことができます。
//emlist[例][ruby]{
Encoding.compatible?(Encoding::UTF_8, Encoding::CP932)
# => nil
Encoding.compatible?(Encoding::UTF_8, Encoding::US_ASCII)
# => #<Encoding:UTF-8>
//}
@param obj1 チェック対象のオブジェクト
@param obj2 チェック対象のオブジェクト...