るりまサーチ

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

別のキーワード

  1. kernel system
  2. kernel exec
  3. kernel spawn
  4. kernel open
  5. kernel raise

検索結果

<< < 1 2 3 4 5 > >>

FileTest.#identical?(file1, file2) -> bool (3012.0)

file1 と file2 が同じファイルを指している時に真を返します。 そうでない場合、ファイルが存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

...が存在しない場合、あるいはシステムコールに失敗した場合などには false を返します。

ruby 1.8.3 以前ではKernel.#test(?-, file1, file2)を使ってください。

open("a", "w") {}
p File.identical?("a", "a") #=> true
p File.identical?("a", "./a")...

MiniTest::Assertions#skip(message = nil, backtrace = caller) (3012.0)

このメソッドを呼び出したテストメソッドをスキップします。

...ます。

@param message メッセージを指定します。

@param backtrace 例外発生時のスタックトレースで、Kernel.#caller の戻り値と同じ
形式で指定しなければいけません。

@raise MiniTest::Skip 必ず発生します。

@see Kernel.#raise...

ruby 1.8.4 feature (258.0)

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

...ruby 1.8.4 feature/printf [bug]>))
* ((<ruby 1.8.4 feature/Hash [bug]>))
* ((<ruby 1.8.4 feature/test [bug]>))
* ((<ruby 1.8.4 feature/File.identical? [new]>))
* ((<ruby 1.8.4 feature/FileTest.identical? [new]>))
* ((<ruby 1.8.4 feature/File.split [change]>))
* ((<ruby 1.8.4 feature/File...
..._inspect), parse.y (parser_yylex, rb_symname_p): check
# if valid as a symbol name more strictly. [ruby-dev:27478]
#
# * test/ruby/test_symbol.rb: tests for [ruby-core:03573].

Symbolに適合する文字列を厳密にした。((<ruby-core:03573>)),((<ruby-dev:27478>))

1...
...from Kernel method.
#
# * eval.c (exec_under): frame during eval should preserve external
# information.

: super [bug]

Kernel
のメソッド内でsuperを呼んだ時に、存在しないsuperclass
にアクセスしようとするバグの修正。

module Kernel...

ARGF.class#gets(limit) -> String | nil (102.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

..." > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#get...

ARGF.class#gets(limit, chomp: false) -> String | nil (102.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

..." > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#get...

絞り込み条件を変える

ARGF.class#gets(rs = $/) -> String | nil (102.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

..." > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#get...

ARGF.class#gets(rs = $/, chomp: false) -> String | nil (102.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

..." > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#get...

ARGF.class#gets(rs, limit) -> String | nil (102.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

..." > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#get...

ARGF.class#gets(rs, limit, chomp: false) -> String | nil (102.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

..." > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.t...
...xt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@see Kernel.#gets, IO#gets, ARGF.class#get...

NEWS for Ruby 3.0.0 (84.0)

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

...`true` will cause compaction to occur during major collections. At the moment, compaction adds significant overhead to major collections, so please test first! 17176
* Hash
* Hash#transform_keys and Hash#transform_keys! now accept a hash that maps keys to new keys. 16274
* Hash#except h...
...wait(io, events, timeout)` in a non-blocking execution context. 16786
* Kernel
* Kernel#clone when called with the `freeze: false` keyword will call `#initialize_clone` with the `freeze: false` keyword. 14266
* Kernel#clone when called with the `freeze: true` keyword will call `#initialize...
...s 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 invokes the scheduler hook `#kernel_sleep(...)` in a non-...

絞り込み条件を変える

NEWS for Ruby 3.1.0 (60.0)

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

...ます。 10917

* Integer
* 新規メソッド
* Integer.try_convert が追加されました。 15211

* Kernel
* 変更されたメソッド
* Kernel#load が第2引数にモジュールを渡せるようになり、渡されたモジュールをトップレベルのモジ...
...した。これは fork(2) のコアメソッドです。このメソッドを直接呼び出さないでください。既存のforkメソッド(Kernel.#fork、Process.fork、IO.popen("-"))によって呼び出されます。アプリケーションモニタリングライブラリは、このメ...
...2.0
* uri 0.11.0
* yaml 0.2.0
* zlib 2.1.1
* 以下のbundled gemsが更新されました。
* minitest 5.15.0
* power_assert 2.0.1
* rake 13.0.6
* test-unit 3.5.3
* rexml 3.2.5
* rbs 2.0.0
* typeprof 0.21.1
* 以下のdefault gemsがbundled gemsに変更...

Ruby用語集 (60.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...る時点において、そこに至るメソッド呼び出し元情報を遡るデータ。
バックトレースともいう。

Kernel
.#caller_locations、Kernel.#caller で現時点までの
スタックトレースを得ることができる。

また、例外オブジェクトは例...
...よっては「即値」という用語を「リテラル」の意味で使うので注意されたい。

: ソフトウェアテスト
: software testing
プログラムの正しさや性能を調べること。単に「テスト」ともいう。
狭義にはテスト用プログラム(テ...
...脱出
: non-local exit
Ruby においては、例外の発生もしくは Kernel.#throw によって
処理の実行が中断されること。
例外の場合は begin/rescue によって、throw の場合は
Kernel
.#catch によって捕捉されるまで、制御構造やメソッド...

Shell#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (57.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...
Kernel
.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell::CommandProcessor#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (57.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...
Kernel
.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

Shell::Filter#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (57.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...
Kernel
.#test や FileTest のメソッドに処理を委譲します。

@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。

@para...
...ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true

@see Kernel.#test, FileTest...

絞り込み条件を変える

NEWS for Ruby 2.7.0 (54.0)

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

...ッドの中で、ブロックなしでProc.newやKernel#procを
呼び出すと警告が表示されるようになりました。

//emlist[][ruby]{
def foo
proc
end
foo { puts "Hello" } #=> warning: Capturing the given block using Kernel#proc is deprecated; use `&block` instead
//}

* 非...
...の中で
「Warning[:deprecated] = false」
としてください。

* ブロック付きで呼び出されたメソッドの中で、Kernel#lambdaをブロックなしで呼び出すと
例外が発生するようになりました。

//emlist[][ruby]{
def bar
lambda
end
bar { pu...
...16256

//emlist[test.rb][ruby]{
require "optparse"
OptionParser.new do |opts|
opts.on("-f", "--foo", "foo") {|v| }
opts.on("-b", "--bar", "bar") {|v| }
opts.on("-c", "--baz", "baz") {|v| }
end.parse!
//}

//emlist{
$ ruby test.rb --baa
Traceback (most recent call last):
test
.rb:7:in `<main>':...

Proc (48.0)

ブロックをコンテキスト(ローカル変数のスコープやスタックフ レーム)とともにオブジェクト化した手続きオブジェクトです。

...生します。][ruby]{
pr = Proc.new { break }
(1..5).each(&pr)
//}

===[a:lambda_proc] lambda と proc と Proc.new とイテレータの違い

Kernel
.#lambda と Proc.new はどちらも Proc クラスのインスタンス(手続きオブジェクト)を生成しますが、
生成された手...
...。 lambda の生成する手続きオブジェクトのほうが
よりメソッドに近い働きをするように設計されています。

Kernel
.#proc は Proc.new と同じになります。
引数に & を付けることで手続きオブジェクト化したブロックは、Proc.new で...
...ruby]{
def test_proc
f = Proc.new { return :from_proc }
f.call
return :from_method
end

def test_lambda
f = lambda { return :from_lambda }
f.call
return :from_method
end

def test_block
tap { return :from_block }
return :from_method
end

p test_proc() #=> :from_proc
p test_lambda()...
<< < 1 2 3 4 5 > >>