るりまサーチ

最速Rubyリファレンスマニュアル検索!
14360件ヒット [1-100件を表示] (0.080秒)
トップページ > クエリ:Ruby[x] > クエリ:require[x]

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (23106.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...クトを元に
Ruby
VM::InstructionSequence オブジェクトを作成して返します。

@param body Proc、Method オブジェクトを指定します。

例1:irb で実行した場合

# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSe...
...> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>

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

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

$a_global_proc = proc { str = 'a' + 'b' }

# 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>...

RubyVM.resolve_feature_path (23050.0)

require を呼んだときに読み込まれるファイルを特定します。 このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

...require を呼んだときに読み込まれるファイルを特定します。
このメソッドはRuby 2.7 で $LOAD_PATH の特異メソッドに移動しました。

//emlist[][ruby]{
p RubyVM.resolve_feature_path('set')
# => [:rb, "/build-all-ruby/2.6.0/lib/ruby/2.6.0/set.rb"]
//}...

RubyVM::InstructionSequence#to_a -> Array (23018.0)

self の情報を 14 要素の配列にして返します。

...配列。

: args

引数の指定が必須のメソッド、ブロックの引数の個数。あるいは以下のよう
な配列。

[required_argc, [optional_arg_labels, ...],
splat_index, post_splat_argc, post_splat_index,
block_index, simple]

より詳細な情報につい...
...命令シーケンスを構成する命令とオペランドの配列の配列。


//emlist[例][ruby]{
require
'pp'

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_...

RubyVM::InstructionSequence.compile_option -> Hash (23012.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返
します。

//emlist[例][ruby]{
require
"pp"
pp RubyVM::InstructionSequence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :...
...>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trace_instruction=>true,
# :frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

RubyVM::InstructionSequence#first_lineno -> Integer (23006.0)

self が表す命令シーケンスの 1 行目の行番号を返します。

...の 1 行目の行番号を返します。

例1:irb で実行した場合

Ruby
VM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1

例2:

# /tmp/method.rb
require
"foo-library"
def foo
p :foo
end

Ruby
VM::InstructionSequence.of(method(:foo)).first_lineno
# => 2...

絞り込み条件を変える

Kernel.#require(feature) -> bool (18159.0)

Ruby ライブラリ feature をロードします。拡張子補完を行い、 同じファイルの複数回ロードはしません。

...
Ruby
ライブラリ feature をロードします。拡張子補完を行い、
同じファイルの複数回ロードはしません。

feature が絶対パスのときは feature からロードします。
feature が相対パスのときは組み込み変数 $:
に示されるパスを順番...
...境変数 HOME の値に展開されます。
また `~USER' はそのユーザのホームディレクトリに展開されます。

Ruby
ライブラリとは Ruby スクリプト (*.rb) か拡張ライブラリ
(*.so,*.o,*.dll など) であり、feature の拡張子が省略された場合は...
...ードに失敗した場合に発生します。

//emlist[例][ruby]{
$LOADED_FEATURES.grep(/prime/).size # => 0
require
"prime" # => true
$LOADED_FEATURES.grep(/prime/).size # => 1
require
"prime" # => false
begin
require
"invalid"
rescue LoadError => e
e.message # => "cannot load...

Kernel#require(path) -> bool (18145.0)

RubyGems を require すると、Kernel#require が Gem を 要求されたときにロードするように置き換えます。

...
Ruby
Gems を require すると、Kernel#require が Gem を
要求されたときにロードするように置き換えます。

再定義された Kernel#require を呼び出すと以下の事を行います。
Ruby
のロードパスに存在するライブラリを指定した場合はその...

Gem::Specification#required_ruby_version -> Gem::Requirement (12317.0)

この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。

...この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。...

Gem::Specification#required_ruby_version=(requirement) (12317.0)

この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。

...この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。

@param requirement Gem::Requirement.create が受け付ける形式のオブジェクトを指定します。

@see Gem::Requirement...

Gem::Specification#required_rubygems_version -> Gem::Requirement (12300.0)

この Gem パッケージを動作させるのに必要な RubyGems のバージョンを返します。

...この Gem パッケージを動作させるのに必要な RubyGems のバージョンを返します。...

絞り込み条件を変える

<< 1 2 3 ... > >>