るりまサーチ

最速Rubyリファレンスマニュアル検索!
59件ヒット [1-59件を表示] (0.032秒)
トップページ > クエリ:DEFAULT[x] > クエリ:print[x] > 種類:文書[x]

別のキーワード

  1. uri default_port
  2. _builtin default
  3. socket ai_default
  4. generic default_port
  5. socket ip_default_multicast_ttl

検索結果

Rubyの起動 (175.0)

Rubyの起動 * cmd_option * shebang

...Encoding.default_internal は nil になります。また、:エンコーディ
ング のように外部エンコーディングを省略した場合は内部エンコーディング
のみを変更します。

//emlist{
# 変更しない場合

$ ruby -e 'p Encoding.default_external; p En...
...ding.default_external; p Encoding.default_internal'
#<Encoding:EUC-JP>
nil

$ ruby --encoding EUC-JP -e 'p Encoding.default_external; p Encoding.default_internal'
#<Encoding:EUC-JP>
nil


# 内部エンコーディングをWindows-31Jにする場合

$ ruby -E :Windows-31J -e 'p Encoding.default_ext...
...ernal; p Encoding.default_internal'
#<Encoding:Windows-31J>
#<Encoding:UTF-8>

$ ruby --encoding :Windows-31J -e 'p Encoding.default_external; p Encoding.default_internal'
#<Encoding:UTF-8>
#<Encoding:Windows-31J>


# 外部エンコーディングをEUC-JP、内部エンコーディングをWindows...

NEWS for Ruby 3.0.0 (79.0)

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

...l:label-TypeProf] is experimentally bundled. It is a
type analysis tool for Ruby programs.
* Deprecation warnings are no longer shown by default (since Ruby 2.7.2).
Turn them on with `-W:deprecated` (or with `-w` to show other warnings too).
16345
* `$SAFE` and `$KCODE` are now n...
...it may now invoke the `block`/`unblock` scheduler hooks in a non-blocking context. 16786
* Dir
* Dir.glob and Dir.[] now sort the results by default, and accept the `sort:` keyword option. 8709
* ENV
* ENV.except has been added, which returns a hash excluding the given keys and their va...
...* Windows: 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 context...

クラス/メソッドの定義 (43.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...list[例][ruby]{
def fact(n)
if n == 1 then
1
else
n * fact(n-1)
end
end
//}

文法:

def メソッド名 ['(' [arg0 ['=' default0]] ... [',' '*' rest_args [, post ...]] [',' key1: [val1]] ... [',' '**'kwrest] [',' '&' block_arg]`)']
式.. (body)
[rescu...
...][ruby]{
def foo(cnt, &block_arg)
cnt.times { block_arg.call } # ブロックに収まったProcオブジェクトはcallで実行
end
foo(3) { print "Ruby! " } #=> Ruby! Ruby! Ruby!
//}

メソッド定義において、仮引数はその種類毎に以下の順序でしか指定すること
...
...foo
print
"foo\n"
end
//}

は未定義メソッドの呼び出しで例外 NameError を発生させます。

===[a:singleton_method] 特異メソッド定義

//emlist[例][ruby]{
def foo.test
print
"this is foo\n"
end
//}

文法:

def 式 `.' 識別子 [`(' [引数 [`=' default]]...

ruby 1.8.3 feature (31.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...: URI::HTTP#proxy_open [lib][new]

(({:http_basic_authentication})) オプションの追加
((<ruby-core:4416>))

: OpenSSL::X509::Store#set_default_paths [lib][new]

追加 ((<ruby-dev:25670>))

=== 2005-02-06
: Resolv::DNS::Resource::TXT#strings [lib] [new]
: Resolv::DNS::Message::MessageE...
...として
ruby 1.8.3 に IO#((<IO/readpartial>)) が追加されました。
((<ruby-dev:25430>)) ((<ruby-dev:25443>))

$ ruby -e 'sleep 1; print "hoge"' | ruby-1.8.2 -rio/nonblock -we '
io = IO.open(0)
io.no...
...p io.read(4)'
-e:4:in `read': Resource temporarily unavailable (Errno::EAGAIN)
from -e:4

$ ruby -e 'sleep 1; print "hoge"' | ruby-1.8.3 -rio/nonblock -we '
io = IO.open(0)
io.no...

1.6.8から1.8.0への変更点(まとめ) (25.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...merge は、hash.dup.update と同じ。
Hash#merge! は、Hash#update の別名 ((<ruby-talk:59777>)), ((<ruby-dev:19463>))

: ((<Hash#default_proc|Hash/default_proc>)) [new]

追加 ((<ruby-dev:17966>))

=== IO

: ((<IO/IO.sysopen>)) [new]
: ((<Socket#sysaccept|Socket/sysaccept>)) [new]
: ((<T...
...み込み関数/sprintf>)) [new]

"%p" が追加されました。inspect の結果が利用されます。((<RCR#69>))

: ((<組み込み関数/trap>)) [compat]

あるシグナルに対して、SIG_DFL や SIG_IGN が割り当てられていた場合、
文字列 "DEFAULT" や "IGNORE" を...
...e Twister|URL:http://www.math.keio.ac.jp/~matumoto/mt.html>))
を使用するようになりました。

: ((<組み込み関数/sprintf>))('%u') [compat]

sprintf の '%u' で、最上位ビットの繰り返しをあらわす ".." は、付加
されないようになりました。((<ruby...

絞り込み条件を変える

ruby 1.6 feature (25.0)

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

...合が修正されたのだそうです。
((<ruby-win32:273>))

: 2002-08-12 Hash#==

Hash オブジェクトはデフォルト値 (((<Hash/default>))) も == で等しい
ときに等しいとみなされるようになりました。

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

=>...
...1.6.7 (2002-07-30) [i586-linux]

: 2002-06-03 sprintf()

"%d" で引数を整数にするときに、((<組み込み関数/Integer>)) と同じ規則を
使用するようになりました。

p sprintf("%d", nil)

=> -:1:in `sprintf': no implicit conversion from nil (TypeError)...
...ソッドの戻り値

以下のメソッドの戻り値が正しくなりました。
((<ruby-bugs-ja:PR#182>)), ((<rubyist:1016>))

* Hash#default= が右辺を返すようになった(以前は self を返していた)。

* Dir#pos= が右辺を返すようになった(以前は self を...