るりまサーチ

最速Rubyリファレンスマニュアル検索!
540件ヒット [201-300件を表示] (0.031秒)

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file mtime
  4. file atime
  5. file size

検索結果

<< < 1 2 3 4 5 ... > >>

ruby 1.9 feature (138.0)

ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。

...
* [platform]: 対応プラットフォームの追加

== 1.9.0

=== 2006-09-16

: Struct#inspect

=== 2006-09-14

: digest.rb
: Digest::Base.file

=== 2006-09-13

: Hash#compare_by_identity
: Hash#compare_by_identity?
: Hash#identical
: Hash#identical?

=== 2006-09-12

: Hash#compare_by_ident...
...-05-22

: accept

((<ruby-core:7917>))

=== 2006-03-21

: MatchData#[] [compat]

名前による参照
((<ruby-dev:28446>))

=== 2006-03-03

: FileUtils.cp_r [lib] [compat]

remove_destination オプションの追加
((<ruby-dev:28417>))

=== 2006-02-15

: instance_eval

((<ruby-core:73...
...ソッドを呼び出せなくなりました。

=== 2005-06-09
: ENV.[]= [change]

ENV[key] = nil で要素を削除する機能は失われ、TypeError になるようになりました。

((<ruby-list:40865>))

=== 2005-06-08
: Array#nitems [compat]

Array#nitems にブロックを渡せ...

Kernel.#fail(error_type, message = nil, backtrace = caller(0), cause: $!) -> () (126.0)

例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。

...ist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}

引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。

error_type として例外ではないクラスや...
...生する例外にします。
その際、exception メソッドに引数として変数 message を渡すことができます。

@param error_type 発生させる例外を例外クラスまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージと...
...す。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。

例外の捕捉の例を示します。

//emlist[例1][ruby]{
begin
raise NameError,"!!error!!"
rescue ArgumentError => err
rescue NameError => err
rescue TypeError => err
en...

Kernel.#raise(error_type, message = nil, backtrace = caller(0), cause: $!) -> () (126.0)

例外を発生させます。 発生した例外は変数 $! に格納されます。また例外が 発生した時のスタックトレースは変数 $@ に格納され ます。発生した例外は rescue 節で捕捉できます。

...ist")
rescue
raise #=> `open': No such file or directory - "nonexist" (Errno::ENOENT)
end
//}

引数を渡した場合は、例外メッセージ message を持った error_type の示す例外(省略時 RuntimeError)を
発生させます。

error_type として例外ではないクラスや...
...生する例外にします。
その際、exception メソッドに引数として変数 message を渡すことができます。

@param error_type 発生させる例外を例外クラスまたは例外クラスのインスタンスで指定します。
@param message 例外のメッセージと...
...す。
@raise TypeError exception メソッドが例外オブジェクトを返さなかった場合に発生します。

例外の捕捉の例を示します。

//emlist[例1][ruby]{
begin
raise NameError,"!!error!!"
rescue ArgumentError => err
rescue NameError => err
rescue TypeError => err
en...

Kernel.#open(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO | Tempfile | IO (106.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

name...
...ame が http:// や ftp:// で
始まっている文字列なら URI のリソースを取得した上で StringIO オブジェクト
または Tempfile オブジェクトを引数としてブロックを評価します。後は同様です。
引数のオブジェクトは OpenURI::Meta モジュ...
...ブクラスが発生します。詳しくは net/ftp
を参照して下さい。

例:

require 'open-uri'
sio = open('http://www.example.com') { |sio|
p sio.is_a?(OpenURI::Meta) # => true
p sio.content_type
puts sio.read
}

@see OpenURI.open_uri, URI.open...

ruby 1.8.3 feature (90.0)

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

...=== 2005-09-19
: FileUtils.remove_entry_secure [lib] [new]
: FileUtils.remove_entry [lib] [new]
: FileUtils.chmod_R [lib] [new]
: FileUtils.chown [lib] [new]
: FileUtils.chown_R [lib] [new]
: FileUtils.commands [lib] [new]
: FileUtils.options...
...[lib] [new]
: FileUtils.have_option? [lib] [new]
: FileUtils.options_of [lib] [new]
: FileUtils.collect_method [lib] [new]

追加。

: FileUtils.rm_r [lib] [compat]
: FileUtils.rm_rf [lib] [compat]
: FileUtils.cd [lib] [compat]
: FileUtils.cp_r [lib] [compat]...
...: File.join [ruby] [compat]

型チェックを厳密にするようになりました。

$ ruby-1.8.2 -e 'p File.join(1, 2)'
"1/2"

$ ruby-1.8.3 -e 'p File.join(1, 2)'
-e:1:in `join': can't convert Fixnum into String (TypeError)
from -e:1

=== 2005-09-16
: File.e...

絞り込み条件を変える

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

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

...[`<' superclass ]
式..
end

文法:

class 識別子 [`<' superclass ]
式..
[rescue [error_type,..] [=> evar] [then]
式..]..
[else
式..]
[ensure
式..]
end

クラスを定義...
...ス定義を書くとク
ラスの定義の追加になります。
ただし、元のクラスと異なるスーパークラスを指定すると TypeError が発生します。

//emlist[][ruby]{
class Foo < Array
def foo
end
end

# 定義を追加(スーパークラス Array を明示的に...
... File::Constants を include することで、
# File::RDONLY などと書かずに直接 RDONLY と書くことができる。
class File
module Constants
RDONLY = 0
WRONLY = 1
end
include Constants
end

File
.open("foo", File::RDONLY)

# あるいは

include File::Constants
File
.ope...

cgi/session (66.0)

CGI のセッション管理を行うライブラリ。

...
セッション情報から構成されます。
デフォルトでは CGI::Session::FileStore が使用され、
記録できるのは文字列のみです。

セッション情報は CGI::Session::FileStore か
CGI::Session::PStore を使用した場合は
サーバのローカルファイル...
...ension#form を使い、<INPUT TYPE="submit"> でページ遷移をするようにすれば、
クッキーが使えない環境でのセッション維持に利用できます。

#!/usr/bin/ruby
require 'cgi'
require 'cgi/session'

cgi = CGI.new('html3')
File
.umask(0077)
session = CGI:...
...!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<BODY>
<FORM METHOD="post" ENCTYPE="application/x-www-form-urlencoded" action="/sample.rb">
<P>
あなたの名前は?
<INPUT NAME="name" SIZE="40" TYPE="text">
<INPUT NAME="cmd" TYPE="h...

制御構造 (66.0)

制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END

...# 最後の例外の再発生
//}

文法:

raise
raise messageまたはexception
raise error_type, message
raise error_type, message, traceback

例外を発生させます。第一の形式では直前の例外を再発生させます。
第二の形...
...場所を示します。

発生した例外は後述の begin 式の rescue 節で捕らえることができます。
その場合 rescue error_type => var の形式を使えば
例外オブジェクトを得られます。このオブジェクトは組み込み
変数 $! でも得られます。...
...ure 節を定義でき、これにより例外を処理することが
できます。

==== rescue修飾子

//emlist[例][ruby]{
open("nonexistent file") rescue STDERR.puts "Warning: #$!"
//}

文法:

式1 rescue 式2

式1で例外が発生したとき、式2を評価します。
...

NEWS for Ruby 3.0.0 (60.0)

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

...is
introduced.
* {RBS}[rdoc-label:label-RBS] is introduced. It is a type definition
language for Ruby programs.
* {TypeProf}[rdoc-label:label-TypeProf] is experimentally bundled. It is a
type
analysis tool for Ruby programs.
* Deprecation warnings are no longer show...
...e each second element
# => ["data1", "data2", "data3"]
//}

* Binding
* Binding#eval when called with one argument will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352 17419
* ConditionVariable
* ConditionVariable#wait may now invoke the `block`/`unblock`...
..., and will return a frozen copy even if the receiver is unfrozen. 16175
* Kernel#eval when called with two arguments will use `"(eval)"` for `__FILE__` and `1` for `__LINE__` in the evaluated code. 4352
* Kernel#lambda now warns if called without a literal block. 15973
* Kernel.sleep inv...

NEWS for Ruby 2.2.0 (48.0)

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

...93

=== 組み込みクラスの更新

* Binding
* 追加: Binding#local_variables
* 追加: Binding#receiver

* Dir
* 追加: Dir#fileno

* Enumerable
* 追加: Enumerable#slice_after
* 追加: Enumerable#slice_when
* 拡張: Enumerable#min, Enumerable#min_by, Enumera...
...ポートしました


* Float
* 追加: Float#next_float
* 追加: Float#prev_float

* File
* 追加: File.birthtime
* 追加: File#birthtime

* File::Stat
* 追加: File::Stat#birthtime

* GC
* GC.latest_gc_info は現在のGCのステータスを再現するため...
...* rb_quad_unpack -> rb_integer_unpack
* rb_read_check : access struct FILE internal. no replacement.
* rb_struct_iv_get : internal function. no replacement.
* struct rb_blocking_region_buffer : internal type. no replacement.
* rb_thread_blocking_region_begin -> rb_thread_call_wit...

絞り込み条件を変える

<< < 1 2 3 4 5 ... > >>