710件ヒット
[1-100件を表示]
(0.053秒)
別のキーワード
ライブラリ
クラス
- Array (4)
- Dir (12)
- ERB (24)
-
Encoding
:: Converter (24) -
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) - Enumerator (24)
-
JSON
:: State (72) - MatchData (12)
- Method (12)
- Module (24)
- Object (24)
- OptionParser (36)
- Regexp (24)
-
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (72) - Set (20)
- SignalException (12)
- String (120)
- StringIO (12)
- StringScanner (60)
-
Thread
:: Backtrace :: Location (48) - TracePoint (7)
-
WIN32OLE
_ TYPE (12) -
WIN32OLE
_ TYPELIB (12)
モジュール
キーワード
- === (24)
- =~ (12)
-
absolute
_ path (24) -
alias
_ method (12) -
base
_ label (24) - convert (12)
- disasm (12)
- disassemble (12)
- dump (12)
-
error
_ bytes (12) -
error
_ char (12) -
eval
_ script (7) - gsub (48)
- help (12)
- helpfile (12)
-
insert
_ output (12) - inspect (55)
- label (12)
-
object
_ nl (12) -
object
_ nl= (12) - path (24)
- peek (12)
- peep (12)
- pointer= (12)
- pos= (12)
- read (12)
- result (12)
- signm (12)
-
source
_ location (12) - space (12)
- space= (12)
-
space
_ before (12) -
space
_ before= (12) - src (12)
- sub (36)
-
to
_ csv (4) -
to
_ json (12) -
to
_ s (44) -
undef
_ method (12) - unscan (12)
- upto (12)
- ver (12)
-
with
_ object (24)
検索結果
先頭5件
-
RubyVM
:: AbstractSyntaxTree :: Node # inspect -> String (23114.0) -
self のデバッグ用の情報を含んだ文字列を返します。
...self のデバッグ用の情報を含んだ文字列を返します。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
puts node.inspect
# => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:5>
//}... -
RubyVM
:: InstructionSequence # base _ label -> String (23114.0) -
self が表す命令シーケンスの基本ラベルを返します。
...た場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end......# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label... -
RubyVM
:: InstructionSequence # label -> String (23114.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
... RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@see RubyVM::InstructionSequence#base_label... -
RubyVM
:: InstructionSequence # disasm -> String (23109.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1......( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
@see RubyVM::InstructionSequence.disasm... -
RubyVM
:: InstructionSequence # disassemble -> String (23109.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1......( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 leave
@see RubyVM::InstructionSequence.disasm... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (23108.0) -
self が表す命令シーケンスの絶対パスを返します。
...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # path -> String (23108.0) -
self が表す命令シーケンスの相対パスを返します。
...= RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> iseq = Ruby......VM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"
@see RubyVM::InstructionSequence#absolute_path... -
StringIO
# puts(*obj) -> nil (21136.0) -
obj と改行を順番に自身に出力します。引数がなければ改行のみを出力します。 詳しい仕様は Kernel.#puts を参照して下さい。
...は Kernel.#puts を参照して下さい。
@param obj 書き込みたいオブジェクトを指定します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("", 'r+')
a.puts("hoge", "bar......", "foo")
a.string #=> "hoge\nbar\nfoo\n"
//}... -
String
# gsub(pattern , replace) -> String (9174.0) -
文字列中で pattern にマッチする部分全てを 文字列 replace で置き換えた文字列を生成して返します。
...場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した文字列と置き換える文字列
//emlist[例][ruby]{
p 'abcdefg'.gsub(/def/, '!!') # => "abc!!g"
p 'abcabc'.gsub(/b/, '<<\&>>') # => "a<<b>>ca<<b>>c"
p 'xxbbxbb'.gsub(/x+(b+)/, 'X<<......二重にエスケープしなければなりません。
//emlist[ひとつめの括弧の内容に置き換えるときによくある間違い][ruby]{
p 'xbbb-xbbb'.gsub(/x(b+)/, "#{$1}") # => "-" # NG
p 'xbbb-xbbb'.gsub(/x(b+)/, "\1") # => "1-1" # NG
p 'xbbb-xbbb'.gsub(/x(b+)......バックスラッシュを倍にするときによくある間違い][ruby]{
puts '\n'.gsub(/\\/, "\\\\") # => \n # NG
puts '\n'.gsub(/\\/, '\\\\') # => \n # NG
puts '\n'.gsub(/\\/, "\\\\\\\\") # => \\n # OK
puts '\n'.gsub(/\\/, '\\\\\\\\') # => \\n # OK
//}
このような間違...