種類
- インスタンスメソッド (38)
- 文書 (22)
- モジュール関数 (11)
- モジュール (11)
- 特異メソッド (11)
クラス
モジュール
- Kernel (11)
キーワード
- MonitorMixin (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) - append (11)
- empty? (8)
- warn (11)
- zero? (8)
検索結果
先頭5件
-
Rake
:: InvocationChain :: EmptyInvocationChain # to _ s -> String (21201.0) -
'TOP' という文字列を返します。
'TOP' という文字列を返します。 -
Rake
:: InvocationChain # to _ s -> String (18213.0) -
トップレベルのタスクから自身までの依存関係を文字列として返します。
...の依存関係を文字列として返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.to_s # => "TOP => task_a"
end
//}... -
Pathname
# empty? -> bool (6301.0) -
ディレクトリに対しては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
...ては Dir.empty?(self.to_s) と同じ、他に対しては FileTest.empty?(self.to_s) と同じです。
//emlist[例 ディレクトリの場合][ruby]{
require "pathname"
require 'tmpdir'
Pathname("/usr/local").empty? # => false
Dir.mktmpdir { |dir| Pathname(dir).empty? } # => tru......e
//}
//emlist[例 ファイルの場合][ruby]{
require "pathname"
require 'tempfile'
Pathname("testfile").empty? # => false
Tempfile.create("tmp") { |tmp| Pathname(tmp).empty? } # => true
//}
@see Dir.empty?, FileTest.#empty?, Pathname#zero?... -
NEWS for Ruby 3
. 0 . 0 (312.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...mlist{
def method_missing(meth, ...)
send(:"do_#{meth}", ...)
end
//}
* Pattern matching (`case/in`) is no longer experimental. 17260
* One-line pattern matching is redesigned. [EXPERIMENTAL]
* `=>` is added. It can be used like a rightward assignment.
17260
* `in......=== `--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
=== `--backtrace-limit` option
The `--backtrace-limit......test.rb
def foo(x)
if x > 10
x.to_s
else
nil
end
end
foo(42)
//}
//emlist{
$ typeprof test.rb
# Classes
class Object
def foo : (Integer) -> String?
end
//}
== Miscellaneous changes
* Methods using `ruby2_keywords` will no longer keep empty keyword splats, those are now removed... -
NEWS for Ruby 2
. 0 . 0 (144.0) -
NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 1.9.3 以降の変更
=== 言語仕様の変更
* キーワード引数を追加しました......たときの名前ではなく呼び出したときの名前を返します。
* 非互換: Object#inspect は #to_s を呼び出さなくなりました。再定義された #to_s を呼び出すためです。
* LoadError
* 追加: LoadError#path ロードできなかったファイル......A user-defined callback
may be set which gets called whenever a new handshake is negotiated. This
also allows to programmatically decline (client) renegotiation attempts.
* Support for "0/n" splitting of records as BEAST mitigation via
OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGME... -
NEWS for Ruby 2
. 5 . 0 (132.0) -
NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。
== 2.4.0 以降の変更
=== 言語仕様の変更
* トップレベルの定数参照を削除......11547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812
=== 組み込みクラスの更新
* Array
* Array#append を......引数を追加しました 13056
* Dir.chdir (ブロックなしで呼び出した場合), Dir.open, Dir.new, Dir.mkdir, Dir.rmdir,
Dir.empty? はGVLを解放するようになりました
* Dir.children を追加 11302
* Dir.each_child を追加 11302
* Enumerable
* Enume... -
Pathname
# zero? -> bool (122.0) -
FileTest.zero?(self.to_s) と同じです。
...FileTest.zero?(self.to_s) と同じです。
@see FileTest.#zero?
, Pathname#empty?... -
Kernel
. # warn(*message) -> nil (112.0) -
message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。
...が引数として与えられた場合には、
to_s メソッドにより文字列に変換してから出力します。
このメソッドは以下と同じです。
//emlist[][ruby]{
$stderr.puts(*message) if !$VERBOSE.nil? && !message.empty?
nil
//}
@param message 出力するオブジェ... -
Kernel
. # warn(*message , uplevel: nil) -> nil (112.0) -
message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。
...与えられた場合には、
to_s メソッドにより文字列に変換してから出力します。
uplevel を指定しない場合は、
このメソッドは以下と同じです。
//emlist[][ruby]{
$stderr.puts(*message) if !$VERBOSE.nil? && !message.empty?
nil
//}
@param message 出... -
Kernel
. # warn(*message , uplevel: nil , category: nil) -> nil (112.0) -
message を 標準エラー出力 $stderr に出力します。 $VERBOSE フラグ が nil のときは何も出力しません。
...与えられた場合には、
to_s メソッドにより文字列に変換してから出力します。
uplevel を指定しない場合は、
このメソッドは以下と同じです。
//emlist[][ruby]{
$stderr.puts(*message) if !$VERBOSE.nil? && !message.empty?
nil
//}
@param message 出... -
Rake
:: InvocationChain . append(task _ name , chain) -> Rake :: InvocationChain (112.0) -
与えられたタスク名を第二引数の Rake::InvocationChain に追加します。
...e::InvocationChain のインスタンスを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
chain = Rake::InvocationChain::EMPTY
b = Rake::InvocationChain.append("task_a", chain)
b.to_s # => "TOP => task_a"
end
//}... -
MonitorMixin (48.0)
-
スレッドの同期機構としてのモニター機能を提供するモジュールです。
...itorMixin) # 配列にモニタ機能を追加
empty_cond = buf.new_cond # 配列が空であるかないかを通知する条件変数
# consumer
Thread.start do
loop do
buf.synchronize do # ロックする
empty_cond.wait_while { buf.empty? } # 配列が空である間はロックを......ックを開放
end
end
# producer
while line = ARGF.gets
buf.synchronize do # ロックする
buf.push(line) # 配列を変更(追加)
empty_cond.signal # 配列に要素が追加されたことを条件変数を通して通知
end # ここでロックを開放
end
//}
=== 初期化......必要があります。
//emlist[include する例][ruby]{
require 'monitor'
class MyObject
include MonitorMixin
def initialize(val)
super()
@value = val
end
def to_s
synchronize {
@value.to_s
}
end
end
//}
以下も参考になります。
* 9384
* 9386...