るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. module >
  4. float >
  5. comparable >

ライブラリ

クラス

モジュール

検索結果

Module#autoload(const_name, feature) -> nil (24361.0)

定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。

...ernel.#require するように設定します。

const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload
する対象を置き換えます。
const_name が(autoloadではなく)既に定義されているときは何もしませ...
...ture Kernel.#require と同様な方法で autoload する対象を指定する。

//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
autoload
:Bar, '/tmp/foo'
end
p Foo::Bar #=> Foo::Bar
//}

以下のようにモジュ...
...-- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
end
Foo.autoload :Bar, '/tmp/foo'
p Foo::Bar #=> Foo::Bar
//}

以下のように、autoload したライブラリがネストした定数を定義しない場
合、一見、正常に動作してい...
...-- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
end
Foo.autoload :Bar, '/tmp/foo'
p Foo::Bar #=> Foo::Bar
//}

以下のように、autoload したライブラリがネストした定数を定義しない場
合、NameError が発生します。

/...

Kernel.#autoload(const_name, feature) -> nil (24349.0)

定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。

...数を指定する方法は Module#autoload を参照してください。

const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload
する対象を置き換えます。
const_name が(autoloadではなく)既に定義されてい...
... autoload する対象を指定します。
@raise LoadError featureのロードに失敗すると発生します。

//emlist[][ruby]{
# ------- /tmp/foo.rb ---------
class Bar
end
# ----- end of /tmp/foo.rb ----

autoload
:Bar, '/tmp/foo'
p Bar #=> Bar
//}

@see Kernel.#autoload?,Module#autoload,K...

Kernel.#autoload?(const_name) -> String | nil (12365.0)

const_name が Kernel.#autoload 設定されているか調べます。

...const_name が Kernel.#autoload 設定されているか調べます。

autoload
設定されていて、autoload 定数がまだ定義されてない(ロードされていない)
ときにそのパス名を返します。

autoload
設定されていないか、ロード済みなら nil を返し...
...lass Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----

class Foo
end
p Foo.autoload?(:Bar) #=> nil
Foo.autoload :Bar, '/tmp/foo'
p Foo.autoload?(:Bar) #=> "/tmp/foo"
p Foo::Bar #=> Foo::Bar
p Foo.autoload?(:Bar) #=> nil
//}

@see Kernel.#autoload...

Module#autoload?(const_name) -> String | nil (12347.0)

autoload 定数がまだ定義されてない(ロードされていない) ときにそのパス名を返します。 また、ロード済みなら nil を返します。

...autoload 定数がまだ定義されてない(ロードされていない) ときにそのパス名を返します。
また、ロード済みなら nil を返します。

@param const_name String または Symbol で指定します。

@see Kernel.#autoload?

//emlist[例][ruby]{
autoload
:Date, '...
...date'

autoload
?(:Date) # => "date"
Date
autoload
?(:Date) # => nil
autoload
?(:Foo) # => nil
//}...

ruby 1.8.4 feature (456.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...e/Ruby本体>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/super [bug]>))
* ((<ruby 1.8.4 feature/正規表現 [bug]>))
* ((<ruby 1.8.4 feature/シグナル [bug]>))
* ((<ruby 1.8.4 feature/組み込みライブラリ>))
* ((<r...
...渡すとFile.joinがSEGVすることがあった
バグの修正。((<ruby-core:06326>))

: Thread#pass [bug]

#Sun Oct 16 03:38:07 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
#
# * eval.c (load_wait): need not to call rb_thread_schedule()
# explicitly. [ruby-core:04039]
#
#...
...core:04039>))

: Module#const_missing [bug]

#Thu Sep 29 00:57:35 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * eval.c (ev_const_get), variable.c (rb_const_get_0): retry only when
# autoload succeeded.
#
# * variable.c (rb_autoload_load): now return true if autoload
#...

絞り込み条件を変える

ruby 1.6 feature (174.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) -> stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOUL...
...atchData:0x401b1be4>
#<MatchData:0x401b198c>
#<MatchData:0x401b1644>
#<MatchData:0x401b1414>
=> ruby 1.6.7 (2002-03-19) [i586-linux]
nil
nil
nil
nil

: 2002-03-14 拡張ライブラリの autoload

拡張ライブ...
...ラリに対して autoload が効いていませんでした。((<ruby-dev:16379>))

autoload
:Fcntl, "fcntl"
require "fcntl"

=> -:2:in `require': uninitialized constant Fcntl (NameError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]

=> ruby 1.6.7 (2002-03-15) [...

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

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

... LoadError ロードに失敗した場合に発生します。

//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 such file -- invalid"
end
//}

@see Kernel.#load,Kernel.#autoload,Kernel.#require_relative...

1.6.8から1.8.0への変更点(まとめ) (96.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...インタプリタの変更>))
* ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>))
* ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>))
* ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>))
* ((<1.6.8から1.8.0...
...read>)) [new]

追加。((<ruby-talk:9460>))が実装に至った経緯だと思う

=== LocalJumpError

: ((<LocalJumpError#exit_value|LocalJumpError/exit_value>)) [new]
: ((<LocalJumpError#reason|LocalJumpError/reason>)) [new]

追加

=== Marshal

: ((<Marshal/Object#marshal_load>))...
...ath.atan>)) [new]
: ((<Math/Math.cosh>)) [new]
: ((<Math/Math.sinh>)) [new]
: ((<Math/Math.tanh>)) [new]
: ((<Math/Math.hypot>)) [new]
追加

=== Method

: ((<Method#==|Method/==>)) [new]

追加

=== Module

: ((<組み込み関数/autoload>)) [ch...