別のキーワード
ライブラリ
- ビルトイン (2554)
- bigdecimal (36)
- coverage (39)
- csv (264)
- date (36)
- erb (12)
- fiddle (36)
- fileutils (24)
- json (84)
-
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - logger (12)
- matrix (204)
-
net
/ http (60) - openssl (540)
- optparse (48)
- pathname (60)
- pp (36)
- prettyprint (12)
- prime (12)
- psych (186)
- pty (12)
- rake (108)
-
rake
/ packagetask (12) - rbconfig (12)
-
rdoc
/ parser / ruby (12) - resolv (36)
-
rexml
/ document (156) - ripper (24)
-
ripper
/ filter (12) -
ripper
/ lexer (36) -
ripper
/ sexp (24) -
rubygems
/ installer (12) -
rubygems
/ requirement (36) -
rubygems
/ source _ index (24) -
rubygems
/ specification (12) -
rubygems
/ version (36) - securerandom (8)
- set (27)
- socket (84)
- stringio (36)
- strscan (12)
-
syslog
/ logger (12) -
test
/ unit (1) - tsort (93)
- uri (158)
-
webrick
/ ssl (12) - win32ole (72)
クラス
- Addrinfo (12)
- Array (48)
- BigDecimal (36)
- CSV (240)
-
CSV
:: Row (12) -
CSV
:: Table (12) - Class (24)
- Complex (36)
- Coverage (39)
- Data (18)
- Date (48)
- DateTime (12)
- Dir (405)
- ERB (12)
- Encoding (72)
-
Encoding
:: Converter (72) - Enumerator (25)
-
Enumerator
:: Lazy (12) - Exception (36)
- Fiber (12)
-
Fiddle
:: Closure :: BlockCaller (12) -
Fiddle
:: Pointer (24) - File (447)
-
File
:: Stat (12) - FrozenError (14)
-
Gem
:: Installer (12) -
Gem
:: Requirement (36) -
Gem
:: SourceIndex (24) -
Gem
:: Specification (12) -
Gem
:: Version (36) - Hash (54)
- IO (192)
- IPSocket (12)
- Integer (24)
-
JSON
:: Parser (12) -
JSON
:: State (24) - KeyError (28)
- Logger (12)
- Matrix (160)
- Module (12)
-
Net
:: HTTP (60) - Object (12)
-
OpenSSL
:: ASN1 :: BMPString (24) -
OpenSSL
:: ASN1 :: BitString (24) -
OpenSSL
:: ASN1 :: Boolean (24) -
OpenSSL
:: ASN1 :: Enumerated (24) -
OpenSSL
:: ASN1 :: GeneralString (24) -
OpenSSL
:: ASN1 :: GeneralizedTime (24) -
OpenSSL
:: ASN1 :: GraphicString (24) -
OpenSSL
:: ASN1 :: IA5String (24) -
OpenSSL
:: ASN1 :: ISO64String (24) -
OpenSSL
:: ASN1 :: Integer (24) -
OpenSSL
:: ASN1 :: Null (24) -
OpenSSL
:: ASN1 :: NumericString (24) -
OpenSSL
:: ASN1 :: OctetString (24) -
OpenSSL
:: ASN1 :: PrintableString (24) -
OpenSSL
:: ASN1 :: Sequence (24) -
OpenSSL
:: ASN1 :: Set (24) -
OpenSSL
:: ASN1 :: T61String (24) -
OpenSSL
:: ASN1 :: UTCTime (24) -
OpenSSL
:: ASN1 :: UTF8String (24) -
OpenSSL
:: ASN1 :: UniversalString (24) -
OpenSSL
:: ASN1 :: VideotexString (24) -
OpenSSL
:: BN (36) - OptionParser (48)
- PP (36)
- Pathname (60)
- PrettyPrint (12)
- Proc (19)
-
Psych
:: Visitors :: YAMLTree (12) -
RDoc
:: Parser :: Ruby (12) -
REXML
:: CData (12) -
REXML
:: Document (48) -
REXML
:: Entity (12) -
REXML
:: Text (24) -
REXML
:: XPath (36) -
Rake
:: FileList (12) -
Rake
:: InvocationChain (24) -
Rake
:: NameSpace (12) -
Rake
:: PackageTask (12) -
Rake
:: TaskArguments (12) - Random (65)
- Range (24)
- Regexp (96)
- Resolv (24)
-
Resolv
:: DNS (12) - Ripper (84)
-
Ripper
:: Filter (12) -
RubyVM
:: InstructionSequence (116) - Set (36)
- SignalException (36)
- Socket (48)
- String (43)
- StringIO (36)
- StringScanner (12)
- Struct (60)
-
Syslog
:: Logger (12) - SystemCallError (12)
- TCPSocket (12)
- Thread (60)
-
Thread
:: Queue (8) - Time (204)
- TracePoint (24)
-
URI
:: FTP (12) - Vector (44)
-
WEBrick
:: GenericServer (12) - WIN32OLE (24)
-
WIN32OLE
_ TYPE (24) -
WIN32OLE
_ VARIANT (24)
モジュール
- FileUtils (24)
- GC (96)
-
GC
:: Profiler (36) - JSON (36)
-
JSON
:: Generator :: GeneratorMethods :: String :: Extend (12) - PTY (12)
- Process (8)
- Psych (162)
-
REXML
:: Security (24) - Rake (24)
- RakeFileUtils (24)
- RbConfig (12)
-
RubyVM
:: AbstractSyntaxTree (30) -
RubyVM
:: MJIT (21) - SecureRandom (8)
- TSort (93)
-
Test
:: Unit (1) - URI (146)
- Warning (9)
キーワード
- === (12)
- DEBUG (12)
- DEBUG= (12)
- Proxy (12)
- [] (150)
- []= (12)
-
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) -
absolute
_ path (12) -
absolute
_ path? (6) - accept (12)
- alphanumeric (8)
- append (12)
- application (12)
- application= (12)
- array (12)
-
asciicompat
_ encoding (24) - at (53)
- atime (12)
- basename (12)
- basis (12)
- binread (12)
- binwrite (12)
- birthtime (11)
- build (24)
- bytes (7)
- chdir (48)
- check (12)
- children (16)
- chown (12)
- chroot (12)
- civil (12)
- clone (12)
- codepage (12)
-
collect
_ method (12) - columns (12)
- combine (16)
- compatible? (12)
- compile (24)
-
compile
_ file (12) -
compile
_ option (12) -
compile
_ option= (12) -
const
_ load (12) - constants (12)
-
copy
_ stream (24) - correct? (12)
- create (24)
-
create
_ id (12) -
create
_ id= (12) - ctime (12)
-
decode
_ www _ form _ component (12) -
default
_ external (12) -
default
_ external= (12) -
default
_ internal= (12) - define (6)
- delete (48)
- diagonal (12)
- dirname (12)
- disable (12)
- disasm (12)
- disassemble (12)
- dump (24)
-
dump
_ stream (12) - each (12)
-
each
_ child (32) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) - elements (12)
- empty (12)
- empty? (9)
- enable (12)
- enabled? (7)
- encode (7)
-
encode
_ www _ form _ component (12) -
entity
_ expansion _ limit (12) -
entity
_ expansion _ limit= (12) -
entity
_ expansion _ text _ limit (24) -
entity
_ expansion _ text _ limit= (24) - entries (24)
- escape (19)
- except (4)
- exception (12)
- exist? (12)
- extname (12)
- extract (48)
- filter (36)
- find (12)
- first (12)
- fnmatch (12)
- fnmatch? (12)
-
for
_ fd (12) - foreach (96)
- format (12)
-
from
_ gems _ in (12) -
from
_ prime _ division (12) -
from
_ state (12) -
from
_ yaml (12) - ftype (12)
- generate (12)
-
generate
_ line (12) -
get
_ print (24) - getaddress (24)
- getaddrinfo (12)
- gethostbyname (24)
- getname (12)
- getwd (24)
- glob (48)
- gm (24)
- home (24)
- hstack (12)
- include (12)
- instance (24)
- join (24)
-
json
_ create (96) -
last
_ match (24) -
last
_ status (8) -
latest
_ gc _ info (24) - lchmod (12)
- lchown (12)
- lex (12)
- limit (12)
-
line
_ stub (7) - link (12)
- load (15)
-
load
_ documents (8) -
load
_ file (12) -
load
_ from _ binary (10) -
load
_ from _ binary _ extra _ data (10) -
load
_ specification (12) -
load
_ stream (24) - local (24)
-
locale
_ charmap (12) - lstat (12)
- match (12)
- matches? (12)
- mkdir (12)
- mkfifo (10)
- mktime (24)
- mode (24)
- mtime (12)
- new (1452)
- now (12)
-
nowrite
_ flag= (12) - of (22)
-
ole
_ classes (12) - open (168)
- parse (82)
-
parse
_ file (10) -
parse
_ line (12) -
parse
_ stream (24) - path (12)
- pause (7)
-
peek
_ result (12) - polar (12)
- pp (12)
- produce (6)
- pwd (24)
- quote (12)
- rand (36)
-
raw
_ data (12) -
raw
_ seed (2) - read (12)
- readlines (48)
- readlink (12)
- realpath (12)
- rect (12)
- rectangular (12)
- regexp (24)
- reject (12)
- rename (12)
- report (12)
- result (24)
- resume (7)
- rmdir (12)
- rows (12)
-
ruby2
_ keywords _ hash? (6) -
safe
_ load (19) - scalar (12)
-
search
_ convpath (12) -
setup
_ argv (1) - sexp (12)
-
sexp
_ raw (12) -
sharing
_ detection (12) -
sharing
_ detection= (12) - slice (19)
- split (24)
- sqrt (8)
- start (44)
- stat (36)
- stop (12)
- store (12)
- stress= (12)
-
strongly
_ connected _ components (12) - symlink (12)
- sysopen (12)
- table (12)
- tcp (24)
-
to
_ json (12) -
to
_ ptr (12) - today (12)
- tokenize (12)
- trace (12)
- truncate (12)
-
try
_ convert (16) - tsort (12)
-
tsort
_ each (23) - typelibs (12)
- umask (24)
- union (12)
- unlink (24)
- unnormalize (12)
- urandom (8)
- using (12)
- utc (24)
- utime (12)
-
verbose
_ flag= (12) - vstack (12)
- warn (9)
-
world
_ readable? (12) -
world
_ writable? (12) - write (24)
-
yaml
_ tag (12) - yield (12)
- zero (32)
検索結果
先頭5件
- Hash
. ruby2 _ keywords _ hash?(hash) -> bool - RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node
-
Hash
. ruby2 _ keywords _ hash?(hash) -> bool (6198.0) -
Module#ruby2_keywordsやProc#ruby2_keywordsによる ruby2_keywords フラグが設定されているかどうかを返します。
...Module#ruby2_keywordsやProc#ruby2_keywordsによる
ruby2_keywords フラグが設定されているかどうかを返します。
このメソッドはデバッグや調査、シリアライゼーションのために本当に必要な場合のために
用意されていて、普通のプログ......れていません。
ruby 2.7.1 で追加されたため、ruby 2.7.0 では定義されていません。
//emlist[][ruby]{
ruby2_keywords def foo(*args)
Hash.ruby2_keywords_hash?(args.last)
end
foo(k: 1) # => true
foo({k: 1}) # => false
//}
@see Module#ruby2_keywords, Proc#ruby2_keywords... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (3227.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...ドを返します。
@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true......Node#token が利用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@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))))
pp RubyVM::AbstractSyntaxTree.parse("x... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (3227.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...ドを返します。
@param string パースする対象の Ruby のコードを文字列で指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true......Node#token が利用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@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))))
pp RubyVM::AbstractSyntaxTree.parse("x... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (3191.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...では動作しません。
@param proc Procもしくはメソッドオブジェクトを指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を......きます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
#......gs: 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:9
# pre_num: 0
#... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (3191.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...では動作しません。
@param proc Procもしくはメソッドオブジェクトを指定します。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を......きます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
#......gs: 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:9
# pre_num: 0
#... -
RubyVM
:: AbstractSyntaxTree . parse _ file(pathname) -> RubyVM :: AbstractSyntaxTree :: Node (3191.0) -
pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。
...ノードを返します。
@param pathname パースする対象のファイルパスを指定します
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指......用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError pathname から取得された文字列が Ruby のコードとし......す。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree... -
RubyVM
:: AbstractSyntaxTree . parse _ file(pathname , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (3191.0) -
pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。
...ノードを返します。
@param pathname パースする対象のファイルパスを指定します
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指......用できます。
@param error_tolerant true を指定すると、構文エラーが発生した際にエラー箇所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
@raise SyntaxError pathname から取得された文字列が Ruby のコードとし......す。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (3173.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...。
@param proc Procもしくはメソッドオブジェクトを指定します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-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:9
# 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 . parse _ file(pathname) -> RubyVM :: AbstractSyntaxTree :: Node (3173.0) -
pathname のファイルを読み込み、その内容を抽象構文木にパースし、その木の根ノードを返します。
...。
@param pathname パースする対象のファイルパスを指定します
@raise SyntaxError pathname から取得された文字列が Ruby のコードとして正しくない場合に発生します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.parse_file(__FILE__)
# => (SCOPE@1:0-1......:50
# tbl: []
# args: nil
# body:
# (FCALL@1:0-1:50 :pp
# (LIST@1:3-1:50
# (CALL@1:3-1:50
# (COLON2@1:3-1:29 (CONST@1:3-1:9 :RubyVM) :AbstractSyntaxTree)
# :parse_file (LIST@1:41-1:49 (STR@1:41-1:49 "") nil)) nil)))
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (3167.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))))
//}... -
RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (3159.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path......列で指定します。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.com......pile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (3159.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path......列で指定します。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.com......pile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (3135.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...e で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file ファ......イル名を文字列で指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してくださ......い。
# /tmp/hello.rb
puts "Hello, world!"
# irb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
RDoc
:: Parser :: Ruby . new(top _ level , file _ name , body , options , stats) -> RDoc :: Parser :: Ruby (3132.0) -
自身を初期化します。
...す。
@param top_level RDoc::TopLevel オブジェクトを指定します。
@param file_name ファイル名を文字列で指定します。
@param body ソースコードの内容を文字列で指定します。
@param options RDoc::Options オブジェクトを指定します。
@param s... -
RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence (3113.0) -
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
...
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起......りません。自分が変換したバイナリデータを使うべきです。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (3107.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...クトを元に
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param body Proc、Method オブジェクトを指定します。
例1:irb で実行した場合
# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSe......quence:block in irb_binding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/iseq_of.rb
def hello
puts "hello, wor......rb
> require '/tmp/iseq_of.rb'
# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>
# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSequence:0x007fb73d7caf78>......irb
> require '/tmp/iseq_of.rb'
# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>
# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSequence:0x007fb73d7caf78>...