るりまサーチ

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

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

検索結果

<< 1 2 3 ... > >>

NEWS for Ruby 3.0.0 (26072.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...s: Read ENV names and values as UTF-8 encoded Strings 12650
* Encoding
* Added new encoding IBM720. 16233
* Changed default for Encoding.default_external to UTF-8 on Windows 16604
* Fiber
* Fiber.new(blocking: true/false) allows you to create non-blocking execution contexts. 16786...
...ocking operations and Fiber.scheduler for accessing the current scheduler. See rdoc-ref:fiber.md for more details about what operations are supported and how to implement the scheduler hooks. 16786
* Fiber.blocking? tells whether the current execution context is blocking. 16786
* Thread#join...

NEWS for Ruby 2.0.0 (26048.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...メソッドです

* Enumerator
* 追加: Enumerator#size サイズを遅延評価するためのメソッドです
* 拡張: Enumerator.new サイズの遅延評価のための引数を一つ受け取るようになりました
* 新規クラス: Enumerator::Lazy 遅延列挙用の...
...acePoint
* new class. This class is replacement of set_trace_func.
Easy to use and efficient implementation.

* toplevel
* added method:
* added main.define_method which defines a global function.
* added main.using, which imports refinements into the current file or...

NEWS for Ruby 2.1.0 (26024.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...eton_method(Object#singleton_method)

* Module
* 追加: Module#using, which activates refinements of the specified module only
in the current class or module definition.
* 追加: Module#singleton_class? レシーバーが特異クラスであれば true を返します。
...
...ectSpace.#reachable_objects_from_root
* 追加: ObjectSpace.#dump
* 追加: ObjectSpace.#dump_all

* OpenSSL::BN
* 拡張: OpenSSL::BN.new Fixnum や Bignum を引数として取れるようになりました。

* open-uri
* 複数フィールドに同じ名前を使うことを...

ruby 1.6 feature (23276.0)

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

...00019>))

: 2002-09-11: Queue#((<Queue/pop>))

Queue#pop に競合状態の問題がありました ((<ruby-dev:17223>))

: 2002-09-11: SizedQueue.new

引数に 0 以下を受けつけるバグが修正されました。

: 2002-09-05: ((<リテラル/式展開>))

stable snapshot で、一...
...フォルト値 (((<Hash/default>))) も == で等しい
ときに等しいとみなされるようになりました。

p Hash.new("foo") == Hash.new("bar")

=> ruby 1.6.7 (2002-03-01) [i586-linux]
true
=> ruby 1.6.7 (2002-08-21) [i586-linux]
false...
.../lib/ruby/$ver/$arch/foo.so
./foo.rb
./foo.so

The previous behavior had a potential security risk because a
foo.rb (if exists) in the current directory is located prior to a
foo.so in $prefix/lib/ruby/site_ruby/$ver/$arch.

((<ruby-bugs:PR#140>)), ((<ruby-ext:01778>)), ((<ruby-dev:1...

ruby 1.8.4 feature (23174.0)

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

...ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]: 追加されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* on...
...* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4 feature/File.basename [change]>))
* ((<ruby 1.8...
...ruby-dev:27818>))

: optparse

#Tue Nov 22 23:52:06 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * lib/optparse.rb: match incomplete (in current enconding) multibyte
# string. http://inamode6.tokuhirom.dnsalias.org/show/1551

$KCODEで無効なマルチバイト文字列や、...

絞り込み条件を変える

Fiber.current -> Fiber (18125.0)

このメソッドが評価されたコンテキストにおける Fiber のインスタンスを返します。

...のメソッドが評価されたコンテキストにおける Fiber のインスタンスを返します。

//emlist[例:][ruby]{
fr = Fiber.new do
Fiber.current
end

fb = fr.resume
p fb.equal?(fr) # => true

p Fiber.current # => #<Fiber:0x91345e4>
p Fiber.current # => #<Fiber:0x91345e4>
//}...

ThreadsWait.new(*threads) -> ThreadsWait (18119.0)

指定されたスレッドの終了をまつための、スレッド同期オブジェクトをつくります。

...しくは複数指定します。

使用例
require 'thwait'

threads = []
5.times {|i|
threads << Thread.new { sleep 1; p Thread.current }
}

thall = ThreadsWait.new(*threads)
thall.all_waits{|th|
printf("end %s\n", th.inspect)
}

# 出力例
#=> #<Thread:0x214bc run>...

Thread.report_on_exception=(newstate) (112.0)

真の時は、いずれかのスレッドが例外によって終了した時に、その内容を $stderr に報告します。

...のスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトは false です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):...
...す。
* Thread#join や Thread#value でそのスレッドの終了を待つことが保証できるなら、
スレッド開始時に Thread.current.report_on_exception = false でレポートを無効化しても
安全です。しかし、この場合、例外をハンドルするのが...
...なかったりするかもしれません。

スレッドごとに設定する方法は Thread#report_on_exception= を参照してください。

@param newstate スレッド実行中に例外発生した場合、その内容を報告するかどうかを true か false で指定します。...
...のスレッドが例外によって終了した時に、その内容を $stderr に報告します。

デフォルトは true です。

Thread.new { 1.times { raise } }

は $stderr に以下のように出力します:

#<Thread:...> terminated with exception (report_on_exception is true):...

Thread#[](name) -> object | nil (66.0)

name に対応したスレッドに固有のデータを取り出します。 name に対応するスレッド固有データがなければ nil を返し ます。

...ータのキーを文字列か Symbol で指定します。

//emlist[例][ruby]{
[
Thread.new { Thread.current["name"] = "A" },
Thread.new { Thread.current[:name] = "B" },
Thread.new { Thread.current["name"] = "C" }
].each do |th|
th.join
puts "#{th.inspect}: #{th[:name]}"
end

# => #<Th...
...異なる変数を返す事に注意してください。

//emlist[][ruby]{
def meth(newvalue)
begin
oldvalue = Thread.current[:name]
Thread.current[:name] = newvalue
yield
ensure
Thread.current[:name] = oldvalue
end
end
//}

この関数に与えるブロックがFiberを切...
...える場合は動的スコープとしては
正しく動作しません。

//emlist[][ruby]{
f = Fiber.new {
meth(1) {
Fiber.yield
}
}
meth(2) {
f.resume
}
f.resume
p Thread.current[:name]
# => nil if fiber-local
# => 2 if thread-local (The value 2 is leaked to outside of meth method.)...

Data.define(*args) -> Class (60.0)

Data クラスに新しいサブクラスを作って、それを返します。

...[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}

メンバの値を書き換えることはできません。

//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fred.age = 6 # => NoMethodError
//}

...
...e.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end

def fetch(url)
fetcher = HTTPFetcher.new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end

p fetch("http://example.com/") # => "Current...
...にも渡されます。

//emlist[例][ruby]{
Customer = Data.define(:name, :address) do
def greeting
"Hello #{name}!"
end
end
p Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

なお、Dataのサブクラスのインスタンスを生成する際にオプション引数...

絞り込み条件を変える

Data.define(*args) {|subclass| block } -> Class (60.0)

Data クラスに新しいサブクラスを作って、それを返します。

...[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}

メンバの値を書き換えることはできません。

//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
fred.age = 6 # => NoMethodError
//}

...
...e.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end

def fetch(url)
fetcher = HTTPFetcher.new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end

p fetch("http://example.com/") # => "Current...
...にも渡されます。

//emlist[例][ruby]{
Customer = Data.define(:name, :address) do
def greeting
"Hello #{name}!"
end
end
p Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

なお、Dataのサブクラスのインスタンスを生成する際にオプション引数...

Observable (48.0)

Observer パターンを提供するモジュールです。

...alize(symbol)
@symbol = symbol
end

def run
last_price = nil
loop do
price = Price.fetch(@symbol)
print "Current price: #{price}\n"
if price != last_price
changed # notify observers
last_price = price
not...
...t: #{price}\n"
end
end
end

ticker = Ticker.new("MSFT")
WarnLow.new(ticker, 80)
WarnHigh.new(ticker, 120)
ticker.run

# => Current price: 126
# => +++ 2017-11-02 12:09:36 +0900: Price above 120: 126
# => Current price: 102
# => Current price: 87
# => Current price: 121...

ThreadGroup (42.0)

スレッドグループを表すクラスです。グループに属する Thread をまとめて 操作することができます。

...: 例:

生成したすべてのThreadが終了するのを待つ

5.times {
Thread.new { sleep 1; puts "#{Thread.current} finished" }
}

(ThreadGroup::Default.list - [Thread.current]).each {|th| th.join}

puts "all threads finished"

対象の Thread が Thread を起...
...hreadGroup::Default.list - [Thread.current]).each {|th| th.join}
end

=== ThreadGroup#freeze と ThreadGroup#enclose の違い

どちらのメソッドでも ThreadGroup#add によるスレッドの追加ができなくなる点は同じですが、
Thread.new に関して違いがあります...
...。現在のスレッドが属する ThreadGroup が freeze
されている場合、Thread.new{ ... } はエラーになります。ThreadGroup が enclose されているだけでは、
Thread.new{ ... } はエラーになりません。生成されたスレッドは従来通り 親スレッドの...
<< 1 2 3 ... > >>