るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 > >>

Array#pop -> object | nil (18138.0)

自身の末尾から要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。

...場合に発生します。

//emlist[例][ruby]{
array = [1, [2, 3], 4]
p array.pop # => 4
p array.pop # => [2, 3]
p array # => [1]

p array.pop # => 1
p array.pop # => nil
p array # => []
array = [1, 2, 3]
p array.pop(2) #=> [2, 3]
p array #=> [1]
/...

Array#pop(n) -> Array (18138.0)

自身の末尾から要素を取り除いてそれを返します。 引数を指定した場合はその個数だけ取り除き、それを配列で返します。

...場合に発生します。

//emlist[例][ruby]{
array = [1, [2, 3], 4]
p array.pop # => 4
p array.pop # => [2, 3]
p array # => [1]

p array.pop # => 1
p array.pop # => nil
p array # => []
array = [1, 2, 3]
p array.pop(2) #=> [2, 3]
p array #=> [1]
/...

Thread::SizedQueue#pop(non_block = false) -> object (15137.0)

キューからひとつ値を取り出します。 キューに push しようと待っているスレッドがあれば、実行を再開させます。

...mlist[例][ruby]{
require 'thread'

q = SizedQueue.new(4)

th1 = Thread.start do
while resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

th1.join
# => resource1
# resource2
# resource3
//}

//emlist[例: nonblock = true][ruby]{
require...
...resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each{|r|
q.push(r)
}

begin
th1.join
q.pop(true)
rescue => e
p e
p e.message
end

# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}

@see Thread::Queue#pop...

Thread::Queue#pop(non_block = false) -> object (15131.0)

キューからひとつ値を取り出します。キューが空の時、呼出元のスレッドは停止します。

...発生します。

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

q = Queue.new

th1 = Thread.start do
while resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each { |r|
q.push(r)
}

th1.join
//}

//emlist[例: nonblock = true][ruby]{
require 'thread'

q = Queue.ne...
...w

th1 = Thread.start do
while resource = q.pop
puts resource
end
end

[:resource1, :resource2, :resource3, nil].each { |r|
q.push(r)
}

begin
th1.join
q.pop(true)
rescue => e
p e
end

# => resource1
# resource2
# resource3
# => #<ThreadError: queue empty>
# => "queue empty"
//}...

VALUE rb_ary_pop(VALUE ary) (6118.0)

配列 ary の末尾の要素をとりのぞき返します。 空配列のときは Qnil を返します。

...配列 ary の末尾の要素をとりのぞき返します。
空配列のときは Qnil を返します。

対応するRubyコード

val = ary.pop

使用例

last_error = rb_ary_pop(err_ary);
VALUE str = rb_funcall(last_error, rb_intern("to_s"), 0);...

絞り込み条件を変える

ruby 1.6 feature (5167.0)

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

...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) ->...
...EWOULDBLOCK

=> ruby 1.6.7 (2002-03-01) [i586-linux]
Errno::EAGAIN
Errno::EWOULDBLOCK

=> ruby 1.6.8 (2002-12-24) [i586-linux]
Errno::EAGAIN
-:2: uninitialized constant EWOULDBLOCK at Errno (NameError)

=> ruby 1.6.8 (2003-02-13) [i...
...れたスレッドの状態がおかしくなることがありま
した((<ruby-talk:40337>)), ((<ruby-core:00019>))

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

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

: 2002-09-11: SizedQueue.new

引数に 0 以下を受けつけ...

ruby 1.8.4 feature (4493.0)

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

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

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。...
...以下は各変更点に付けるべきタグです。

記号について(特に重要なものは大文字(主観))

# * カテゴリ
# * [ruby]: ruby インタプリタの変更
# * [api]: 拡張ライブラリ API
# * [lib]: ライブラリ
* レベル
* [bug]: バグ修正
* [new]:...
...ro Matsumoto <matz@ruby-lang.org>
#
# * array.c (rb_ary_fill): should adjust array length correctly when
# an array is expanded in the fill process. [ruby-core:06625]

Arrayに対してfillとpopを繰り返すとSEGVするバグを修正しました。((<ruby-core:06625>))

: St...

NEWS for Ruby 2.7.0 (3489.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

* パターンマッチが実験的機能として導入されました。 14912

//emlist[][ruby]{
case [0, [1, 2, 3]]
in [a, [b...
...rubygems.orgで公開されました。
* benchmark
* cgi
* delegate
* getoptlong
* net-pop
* net-smtp
* open3
* pstore
* readline
* readline-ext
* singleton
* 以下のdefault gemはruby-coreでの変更のみで、まだrubygems...

NEWS for Ruby 3.1.0 (3243.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...。単一代入では、Rubyは左から右への評価順序を使用します。このコードでは、

//emlist[][ruby]{
foo[0] = bar
//}

* 次の評価順序になります。

//emlist{
1. `foo`
2. `bar`
3. `[]=` called on the result of `foo`
//}

* Ruby 3.1.0より前は、多重...
...コアメソッドです。このメソッドを直接呼び出さないでください。既存のforkメソッド(Kernel.#fork、Process.fork、IO.popen("-"))によって呼び出されます。アプリケーションモニタリングライブラリは、このメソッドを上書きしてfork...

NEWS for Ruby 3.0.0 (3195.0)

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

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

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting a single rest argument and no keywords.
16166

//emlist[][ruby]{...
...now defined and will return true for separate Proc instances if the procs were created from the same block. 14267
* Queue / SizedQueue
* Queue#pop, SizedQueue#push and related methods may now invoke the `block`/`unblock` scheduler hooks in a non-blocking context. 16786
* Ractor
* New cla...

絞り込み条件を変える

irb (212.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

=== irb の使い方

Ruby
さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン...
...プトが表れます。

$ irb
irb(main):001:0>

あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。

irb(main):001:0> 1+2
3
irb(main):002:0> class Foo
irb(main):003:1> def foo
irb(main):004:2> print 1
irb(main):005:2> en...
...j)
: irb_pushb(*obj)
: pushb(*obj)

UNIX シェルコマンドの pushd と同じです。

: popws
: irb_popws
: irb_pop_workspace
: irb_pop_binding
: irb_popb
: popb

UNIX シェルコマンドの popd と同じです。

: irb
: irb(obj)

新しいサブ irb インタプリタを起動し...
<< 1 2 3 > >>