るりまサーチ

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

別のキーワード

  1. psych load_stream
  2. psych safe_load
  3. irb/cmd/load execute
  4. psych load
  5. json load

検索結果

Random#marshal_load(array) -> Random (27264.0)

Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。

...
Random
#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。

@param array 三要素以下からなる配列を指定します。
何を指定するかはRandom#marshal_dumpを参考にしてください。

@raise ArgumentError array が3より大...
...きい場合に発生します。

//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
r3 = r2.marshal_load(a1)

p r1 == r2 # => true
p r1 == r3 # => true
//}

@see Random#marshal_dump...

Random#marshal_dump -> Array (21050.0)

Random#marshal_load で復元可能な配列を返します。

...Random#marshal_load で復元可能な配列を返します。

//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
p r1 == r2 # => false
r3 = r2.marshal_load(a1)

p r1 == r2 # => true
p r1 == r3 # => true
//}...

OpenSSL::Random (18054.0)

OpenSSL が利用する擬似乱数生成器関連のモジュールです。

...下のものがあります。
* OpenSSL::PKey::RSA.generate
* OpenSSL::PKey::DSA.generate
* OpenSSL::PKey::DH.generate
* OpenSSL::Cipher#random_key
そのような乱数は適切な実装を持つ擬似乱数生成器に適切なシードを渡す
ことによって実現できます。

Op...
...penSSL::Cipher#random_iv
などでも利用されます。

擬似乱数生成器は適切なシードを与えられなければ正しく動作しません。
OpenSSL にはそのための API
* OpenSSL::Random.#random_add
* OpenSSL::Random.#seed
* OpenSSL::Random.#load_random_file
が存在...
...ならばシードとして利用できますが、
通常はもっと良いエントロピー源があるはずです。
Linux であれば /dev/random が適当なエントロピー源となるでしょう。

OpenSSL では EGD(Entropy Gathering Daemon)からエントロピーを取得するこ...

OpenSSL::Random.#load_random_file(filename) -> true (15220.0)

ファイルを読み込み、その内容をエントロピー源として 乱数生成器に渡します。

...バイト数と同じであると見なします。

OpenSSL::Random.seed(File.read(filename)) と同じです。

@param filename 読み込むファイル名
@raise OpenSSL::Random::RandomError ファイルの読み込みに失敗した場合に発生します
@raise OpenSSL::Random::RandomError...

NEWS for Ruby 3.1.0 (60.0)

NEWS for Ruby 3.1.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* Kernel#load が第2引数にモジュールを渡せるようになり、渡されたモジュールをトップレベルのモジュールとしてファイルを読み込むようになりました。 6210

* Marshal
* 変更されたメソッド
* Marshal.load が freeze: tru...
...* TracePoint のコールバック中に再入を許す TracePoint.allow_reentry が追加されました。 15912

* $LOAD_PATH
* 変更されたメソッド
* $LOAD_PATH.resolve_feature_path が失敗時に例外を発生させなくなりました。 16043

* Fiber Scheduler
*...
...6.4.0
* readline 0.0.3
* readline-ext 0.1.4
* reline 0.3.0
* resolv 0.2.1
* rinda 0.1.1
* ruby2_keywords 0.0.5
* securerandom 0.1.1
* set 1.0.2
* stringio 3.0.1
* strscan 3.0.1
* tempfile 0.1.2
* time 0.2.0
* timeout 0.2.0
* tmpdir 0.1.2
*...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (54.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* Random
* `Random::DEFAULT` now refers to the `Random` class instead of being a `Random` instance, so it can work with `Ractor`. 17322
* `Random::DEFAULT` is deprecated since its value is now confusing and it is no longer global, use `Kernel.rand`/`Random.rand` directly, or create a `Random...
...` instance with `Random.new` instead. 17351
* String
* The following methods now return or yield String instances instead of subclass instances when called on subclass instances: 10845
* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop...
...pes of classes and modules with advanced types including union types, overloading, generics, and _interface types_ for duck typing.
* Ruby ships with type definitions for core/stdlib classes.
* `rbs` gem is bundled to load and process RBS files.

=== TypeProf

* TypeProf is a type analysis too...

NEWS for Ruby 2.5.0 (30.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* Convert fallback option to a keyword argument
https://github.com/ruby/psych/pull/342
* Add :symbolize_names option to Psych.load, Psych.safe_load like JSON.parse
https://github.com/ruby/psych/pull/333, https://github.com/ruby/psych/pull/337
* Add Psych::Handler#event_lo...
.../ruby/psych/pull/312

* rbconfig
* RbConfig::LIMITS is added to provide the limits of C types.
This is available when rbconfig/sizeof is loaded.

* ripper
* Ripper::EXPR_BEG and so on for Ripper#state.
* Ripper#state を追加。スキャナーの状態を伝えるためです...
...* https://blog.rubygems.org/2017/10/09/2.6.14-released.html
* https://blog.rubygems.org/2017/08/27/2.6.13-released.html

* securerandom
* SecureRandom.alphanumeric を追加

* set
* Set#to_s を Set#inspect の別名として追加 13676
* Set#=== を Set#include? の別名...

NEWS for Ruby 2.0.0 (12.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...ッドに対応します

* Array
* 追加: Array#bsearch 二分探索します
* 非互換:
* Array#shuffle! と Array#sample の random パラメータには最大値のみを指定することが可能になりました
* Array#values_at に Range オブジェクトを与え...
...非互換: Object#inspect は #to_s を呼び出さなくなりました。再定義された #to_s を呼び出すためです。

* LoadError
* 追加: LoadError#path ロードできなかったファイルのパスを返します

* Module
* 追加: Module#prepend 指定したモジ...
...のタグメーカーを呼び出すと CGI#header を header 要素を生成するために上書きします。

* csv
* CSV.dump と CSV.load を削除しました。ユーザーを危険なシリアライゼーションに関する脆弱性から保護するためです。

* iconv
*...

test/unit (12.0)

ユニットテストを行うためのライブラリです。

...用意した test_foo.rb を実行します。
デフォルトではすべてのテストが実行されます。

$ ruby test_foo.rb

Load
ed suite test_foo
Started
F.
Finished in 0.022223 seconds.

1) Failure:
test_bar(TC_Foo) [test_foo.rb:1...
...kips

test_bar だけテストしたい場合は以下のようなオプションを与えます。

$ ruby test_foo.rb --name test_bar

Load
ed suite test_foo
Started
F
Finished in 0.019573 seconds.

1) Failure:
test_bar(TC_Foo) [test_foo.rb:...
...Usage: test_foo [options]
minitest options:
-h, --help Display this help.
-s, --seed SEED Sets random seed
-v, --verbose Verbose. Show progress processing files.
-n, --name PATTERN Filter test names on...