るりまサーチ

最速Rubyリファレンスマニュアル検索!
4528件ヒット [1-100件を表示] (0.131秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< 1 2 3 ... > >>

RubyVM::InstructionSequence#base_label -> String (29119.0)

self が表す命令シーケンスの基本ラベルを返します。

...ラベルを返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.base_label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/me...
...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


Ruby
VM::InstructionSequence.of(method(:hello)).base_label
# => "hello"

@
see RubyVM::InstructionSeq...

RubyVM::InstructionSequence#label -> String (29119.0)

self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。

..."<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.label
# => "<compiled>"...
...M::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, world"
end


# irb
> iseq = RubyVM::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#absolute_path -> String | nil (29113.0)

self が表す命令シーケンスの絶対パスを返します。

...していた場合は nil を返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合...
...# /tmp/method.rb
def hello
puts "hello, world"
end


# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"

@
see RubyVM::InstructionSequence#path...

RubyVM::InstructionSequence#path -> String (29113.0)

self が表す命令シーケンスの相対パスを返します。

...いた
場合は "<compiled>" を返します。

例1:irb で実行した場合

i
seq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
i
seq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場...
...

# /tmp/method.rb
def hello
puts "hello, world"
end


# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@
see RubyVM::InstructionSequence#absolute_path...

MatchData#end(n) -> Integer | nil (18268.0)

n 番目の部分文字列終端のオフセットを返します。

...nil を返します。

@
param n 部分文字列を指定する数値。

@
raise IndexError 範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end...
...(4) # => `end': index 4 out of matches (IndexError)
//}

@
see MatchData#begin...

絞り込み条件を変える

Gem::Specification#add_runtime_dependency(gem, *requirements) -> [Gem::Dependency] (12331.0)

この gem の RUNTIME 依存性を追加します。 実行時に必要となる gem を指定します。

...IME 依存性を追加します。
実行時に必要となる gem を指定します。

//emlist[][ruby]{
# https://github.com/rurema/bitclust/blob/v1.2.3/bitclust-core.gemspec#L25
s.add_runtime_dependency "progressbar", ">= 1.9.0", "< 2.0"
//}

@
param gem 依存する gem の名前か Gem::Depend...
...ency のインスタンスを指定します。

@
param requirements バージョンの必要条件を 0 個以上指定します。デフォルトは ">= 0" です。

@
see Gem::Specification#add_development_dependency, Gem::Dependency...

Rake::InvocationChain#append(task_name) -> Rake::InvocationChain (12331.0)

与えられたタスク名を追加して新しい Rake::InvocationChain を返します。

...ク名を追加して新しい Rake::InvocationChain を返します。

@
param task_name 追加するタスク名を指定します。

@
raise RuntimeError 循環したタスクの呼び出しを検出した場合に発生します。

//emlist[][ruby]{
# Rakefile での記載例とする

task def...
...ault: :test_rake_app
task :test_rake_app do
i
nvocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
i
nvocation_chain.append("task_b") # => LL("task_b", "task_a")
end

//}...

Object#define_singleton_method(symbol) { ... } -> Symbol (12279.0)

self に特異メソッド name を定義します。

...す。

@
param symbol メソッド名を String または Symbol で指定します。

@
param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@
return メソッド名を表す Symbol を返します。

//emlist[][ruby]{
class...
...A
class << self
def class_name
to_s
end

end

end

A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end

A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}...

Object#define_singleton_method(symbol, method) -> Symbol (12279.0)

self に特異メソッド name を定義します。

...す。

@
param symbol メソッド名を String または Symbol で指定します。

@
param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@
return メソッド名を表す Symbol を返します。

//emlist[][ruby]{
class...
...A
class << self
def class_name
to_s
end

end

end

A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end

A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}...
<< 1 2 3 ... > >>