クラス
- Matrix (11)
キーワード
- ConditionVariable (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) - NKF (11)
- Ruby用語集 (11)
-
net
/ pop (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) - 制御構造 (11)
検索結果
先頭5件
-
Matrix
. empty(row _ size=0 , column _ size=0) -> Matrix (18125.0) -
要素を持たない行列を返します。
..._size のいずれか一方は0である必要があります。
//emlist[例][ruby]{
require 'matrix'
m = Matrix.empty(2, 0)
m == Matrix[ [], [] ]
# => true
n = Matrix.empty(0, 3)
n == Matrix.columns([ [], [], [] ])
# => true
m * n
# => Matrix[[0, 0, 0], [0, 0, 0]]
//}
@param row_size 行列の... -
NEWS for Ruby 3
. 0 . 0 (72.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストはリンク先を参照してください。
== 言語仕様の変更
* Keyword arguments are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.......a warning.
== Command line options
=== `--help` option
When the environment variable `RUBY_PAGER` or `PAGER` is present and has
a non-empty value, and the standard input and output are tty, the `--help`
option shows the help message via the pager designated by the value.
16754
=== `--backtrac......e-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates
Outstanding ones only.
* Array
* The following methods now return Array instances instead of subclass instances when called on subclass instances: 6087
* Array#drop... -
ruby 1
. 8 . 4 feature (72.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...など(互換性のない変更)
* [obsolete]: 廃止された(される予定の)機能
* [platform]: 対応プラットフォームの追加
== 目次
* ((<ruby 1.8.4 feature/Ruby本体>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 feature/Symbol [bug]>))
* ((<ruby 1.8.4 f......((<ruby 1.8.4 feature/BeOS [bug]>))
* ((<ruby 1.8.4 feature/Sun [bug]>))
* ((<ruby 1.8.4 feature/IA64 [bug]>))
== Ruby本体
: Symbol [bug]
# * parse.y (dsym): prohibit empty symbol literal by interpolation.
# fixed: [ruby-talk:166529]
式展開で空のSymbolを作るこ......-:1: empty symbol literal
# => ruby 1.8.4 (2005-12-16) [i686-linux]
-:1: empty symbol literal
p :"#{""}"
# => ruby 1.8.3 (2005-09-21) [i686-linux]
:
# => ruby 1.8.4 (2005-12-16) [i686-linux]
-:1: empty symbol literal... -
Thread
:: ConditionVariable (48.0) -
スレッドの同期機構の一つである状態変数を実現するクラスです。
...。
以下も ConditionVariable を理解するのに参考になります。
https://ruby-doc.com/docs/ProgrammingRuby/html/tut_threads.html#UF
=== Condition Variable とは
あるスレッド A が排他領域で動いていたとします。スレッド A は現在空いていない
リソー......itionVariable.new
@empty = ConditionVariable.new
@mutex = Mutex.new
@q = []
end
def count
@q.size
end
def enq(v)
@mutex.synchronize{
@full.wait(@mutex) if count == @max
@q.push v
@empty.signal if count == 1
}
end......def deq
@mutex.synchronize{
@empty.wait(@mutex) if count == 0
v = @q.shift
@full.signal if count == (@max - 1)
v
}
end
alias send enq
alias recv deq
end
if __FILE__ == $0
q = TinyQueue.new(1)
foods = 'Apple Banana Strawberry Udon... -
Ruby用語集 (36.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......チャーの番号、
Ruby 2.7 で導入された番号指定ブロックパラメーター、
といったものは 1 オリジンである。
===[a:A] A
: AWK
テキスト処理に適したプログラミング言語。
名称は、開発者である Aho(エイホ)、Weinberger(ワ......っているが、「可変長引数」という用語の
ほうが普及している。
英語の variadic は形容詞である。
: 空
: empty
Array や Hash、Struct のような要素を持つクラスでは、要素が無いことを
「空(から)」と呼ぶ。
また、Str... -
ruby 1
. 8 . 2 feature (36.0) -
ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。
...来再考して欲しいもの?)
* [obsolete]: 廃止された(される予定の)機能
* [platform]: 対応プラットフォームの追加
== 1.8.1 (2003-12-25) -> 1.8.2 (2004-12-25)
* cgi/session においてクライアントからセッション ID を指定できてしまうバグ......182>))
を参照して下さい。
* rss, rdoc, yaml の変更点は収録していません。
=== 日時未詳
: CGI#server_port [lib] [bug]
常に 0 を返すバグが修正されました。
=== 2004-12-19
: OpenSSL::X509::Store#time= [lib] [new]
: OpenSSL::X509::StoreContext#t......23014>))
=== 2004-02-20
: irb [lib] [new]
-I オプションが使えるようになりました。((<ruby-list:39243>))
=== 2004-02-18
: StringScanner#peep [lib] [obsolete]
$VERVOSE が設定されている時に警告がでるようになりました。use #peek.
: StringScanner#empty? [lib]... -
NEWS for Ruby 2
. 4 . 0 (30.0) -
NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.3.0 以降の変更
=== 言語仕様の変更
* 条件式での多重代入ができるようになりました 10617
* Symbol#to_proc でメソッド呼......cue をメソッドの引数内に書けるようになりました 12686
* トップレベルで return を書けるようになりました 4840
=== 組み込みクラスの更新
* Array
* Array#concat 12333
複数の引数を取れるようになりました。
* Array#max, A......Enumerable#sum と違って each メソッドに依存しません。
* Comparable
* Comparable#clamp を追加 10594
* Dir
* Dir.empty? を追加 10121
* Enumerable
* Enumerable#chunk ブロックを省略した場合 Enumerator を返すようになりました。2172... -
net
/ pop (24.0) -
このライブラリは、POP3 (Post Office Protocol version 3) を 用いてPOPサーバからメールを受信する機能を提供するライブラリです。
...ラリです。
POP3 の実装は 1939 に基いています。
2449 で定義されているPOP3拡張には対応していません。
=== 使用例
==== メールの受信
以下のコードは、メールを受信してファイル 'inbox/1' 'inbox/2'... に
書きこみ、サーバ上から......et/pop'
pop = Net::POP3.new('pop.example.com', 110)
pop.start('YourAccount', 'YourPassword') # POPのセッションを開始
if pop.mails.empty?
$stderr.puts 'no mail.'
else
pop.mails.each_with_index do |m, idx| # 各メッセージにアクセスする
File.open("inbox/#{......ls はこの Net::POPMail オブジェクトの配列であり、
Net::POP3#each_mail はさらに pop.mails.each のショートカットです。
==== 短くする
上の例はあえて省略や短縮用メソッドを避けたためにかなり冗長です。
まず、ブロック付きの Net:... -
制御構造 (24.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
...御構造をクラス設計者が定義する事が出来るものです.
=== 条件分岐
====[a:if] if
//emlist[例][ruby]{
if age >= 12 then
print "adult fee\n"
else
print "child fee\n"
end
gender = if foo.gender == "male" then "male" else "female" end
//}
文法:
if 式 [then]......価されます。
==== if 修飾子
//emlist[例][ruby]{
print "debug\n" if $DEBUG
//}
文法:
式 if 式
右辺の条件が成立する時に、左辺の式を評価してその結果を返します。
条件が成立しなければ nil を返します。
====[a:unless] unless
//e......し、引数を指定した場合はループの戻り値はその引数になります。
====[a:next] next
//emlist[例][ruby]{
# 空行を捨てるcat
ARGF.each_line do |line|
next if line.strip.empty?
print line
end
//}
文法:
next
next val
nextはもっとも内... -
NEWS for Ruby 2
. 0 . 0 (18.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました
* %i, %I をシンボルの配列作成のために追加し......ーディングを US-ASCII から UTF-8 に変更しました
* '_' で始まる使用されていない変数は警告しなくなりました
=== 組み込みクラスの更新
* ARGF.class
* 追加: ARGF.class#codepoints, ARGF.class#each_codepoint
IO にある同名のメソッ......ing of records as BEAST mitigation via
OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS.
* The default options for OpenSSL::SSL::SSLContext have changed to
OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
instead of OpenSSL::SSL::OP_ALL only. This enables the co...