るりまサーチ

最速Rubyリファレンスマニュアル検索!
233件ヒット [1-100件を表示] (0.030秒)

別のキーワード

  1. object false
  2. _builtin false
  3. rb_false
  4. false
  5. false object

検索結果

<< 1 2 3 > >>

Regexp#~ -> Integer | nil (18220.0)

変数 $_ の値との間でのマッチをとります。

...意味です。

//emlist[][ruby]{
self =~ $_
//}

//emlist[例][ruby]{
$_ = "hogehoge"

if /foo/
puts "match"
else
puts "no match"
end
# => no match
# ただし、警告がでる。warning: regex literal in condition

reg = Regexp.compile("foo")

if ~ reg
puts "match"
else
puts "no match"...
...end
# => no match

if reg
puts "match"
else
puts "no match"
end
# => match
# reg は nil でも false でも無いので常にtrue
//}...

Object#!~(other) -> bool (6112.0)

自身が other とマッチしない事を判定します。

...身が other とマッチしない事を判定します。

self#=~(obj) を反転した結果と同じ結果を返します。

@param other 判定するオブジェクトを指定します。

//emlist[例][ruby]{
obj = 'regexp'
p (obj !~ /re/) # => false

obj = nil
p (obj !~ /re/) # => true
//}...

ruby 1.6 feature (372.0)

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

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

=> ruby 1.6.7 (2002-03-01) [i586-linux]
true
=> ruby 1.6.7 (2002-08-21) [i586-linux]
false


# : 2002-08-01 IO#read, gets ..., etc.
#
# File::NONBLOCK を指定した IO の読み込みで EWOULDBLOCK が発生すると、
#...
... nil
を返すようになりました。(String#[]やString#slice と同じ結果を返すと
いうことです)

p "foo".slice!("bar") # <- 以前からこちらは nil を返していた
p "foo".slice!(5,10)

=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
...
...)}b/x =~ "ab"

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-07-30) [i586-linux]
"\\#"
nil


: 200...

Dir.mktmpdir(prefix_suffix = nil, tmpdir = nil) -> String (288.0)

一時ディレクトリを作成します。

...のパスを
返します。この場合、このメソッドは作成した一時ディレクトリを削除しません。

@param prefix_suffix nil の場合は、'd' をデフォルトのプレフィクスとして使用します。サフィックスは付きません。
...
...pdir nil の場合は Dir.tmpdir を使用します。
そうでない場合は、そのディレクトリを使用します。


使用例
require 'tmpdir'

puts Dir.tmpdir
# 出力例: 動作環境により出力は異なります。
#=> /cygdrive/c/DOCUME~1/kouya/LOCALS~1/Te...
...3j
}

memory_dir = nil
Dir.mktmpdir {|dir|
memory_dir = dir
File.open("#{dir}/foo", "w") { |fp|
fp.puts "hogehoge"
}
}
# ブロックを抜けたら、テンポラリディレクトリは消される。
p FileTest.directory?(memory_dir) #=> false

dir = Dir.mktmpdi...

Dir.mktmpdir(prefix_suffix = nil, tmpdir = nil) {|dir| ... } -> object (288.0)

一時ディレクトリを作成します。

...のパスを
返します。この場合、このメソッドは作成した一時ディレクトリを削除しません。

@param prefix_suffix nil の場合は、'd' をデフォルトのプレフィクスとして使用します。サフィックスは付きません。
...
...pdir nil の場合は Dir.tmpdir を使用します。
そうでない場合は、そのディレクトリを使用します。


使用例
require 'tmpdir'

puts Dir.tmpdir
# 出力例: 動作環境により出力は異なります。
#=> /cygdrive/c/DOCUME~1/kouya/LOCALS~1/Te...
...3j
}

memory_dir = nil
Dir.mktmpdir {|dir|
memory_dir = dir
File.open("#{dir}/foo", "w") { |fp|
fp.puts "hogehoge"
}
}
# ブロックを抜けたら、テンポラリディレクトリは消される。
p FileTest.directory?(memory_dir) #=> false

dir = Dir.mktmpdi...

絞り込み条件を変える

irb (198.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...の機能が使えるようになります。

=== irb のコマンドラインオプション

irb [options] file_name opts
options:
-f ~/.irbrc を読み込まない
-m bc モード (分数と行列の計算ができる)
-d $DEBUG を true に...
...RB.conf[:AUTO_INDENT] = false
IRB.conf[:BACK_TRACE_LIMIT] = 16
IRB.conf[:DEBUG_LEVEL] = 1
IRB.conf[:ECHO] = nil
IRB.conf[:EVAL_HISTORY] = nil
IRB.conf[:HISTORY_FILE] = nil
IRB.conf[:IGNORE_EOF] = true
IRB.conf[:IGNORE_SIGINT] = true
IRB.conf[:INSPECT_MODE] = nil
IRB.conf[:IRB_NAME]...
...= "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:MATH_MODE] = false
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[...
...の機能が使えるようになります。

=== irb のコマンドラインオプション

irb [options] file_name opts
options:
-f ~/.irbrc を読み込まない
-d $DEBUG を true にする (ruby -d と同じ)
-w ruby -w と同じ
-W[le...
...= "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = nil
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true

それぞれ...
...= "irb"
IRB.conf[:IRB_RC] = nil
IRB.conf[:PROMPT] = {....}
IRB.conf[:PROMPT_MODE] = :DEFAULT
IRB.conf[:SINGLE_IRB] = false
IRB.conf[:SAVE_HISTORY] = 1000
IRB.conf[:USE_LOADER] = true
IRB.conf[:USE_READLINE] = nil
IRB.conf[:USE_TRACER] = true
IRB.conf[:VERBOSE] = true

それぞれ...

演算子式 (180.0)

演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond

...[]
+(単項) ! ~
**
-(単項)
* / %
+ -
<< >>
&
| ^
> >= < <=
<=> == === != =~ !~
&&...
...方が多い場合には、余った要素は無視されます。
配列の要素が足りない場合には対応する要素の無い左辺には
nil
が代入されます。

左辺の最後の式の直前に * がついていると、対応する
左辺のない余った要素が配列として...
...ロップ (flip-flop) とも呼ばれます。


「..」の場合:

(1) 初期状態では式1だけを評価し、式1が真を返すまでは false を返します。
(2) 式1が真を返すと true を返します。式2が真なら初期状態に戻ります。
(3) この後は式2だけを...
...op is deprecated」という警告がでます。

「..」の場合:

(1) 初期状態では式1だけを評価し、式1が真を返すまでは false を返します。
(2) 式1が真を返すと true を返します。式2が真なら初期状態に戻ります。
(3) この後は式2だけ...

Kernel.#system(command, options={}) -> bool | nil (150.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...返します。
それ以外の終了ステータスの場合は false を返します。
コマンドを実行できなかった場合は nil を返します。

options で :exception に true を指定することで、
nil
false を返す代わりに例外を発生するようにできます...
...を参照することで判別可能です。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます...
...ion: true) # => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel...

Kernel.#system(env, command, options={}) -> bool | nil (150.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...返します。
それ以外の終了ステータスの場合は false を返します。
コマンドを実行できなかった場合は nil を返します。

options で :exception に true を指定することで、
nil
false を返す代わりに例外を発生するようにできます...
...を参照することで判別可能です。

=== 引数の解釈

この形式では command が shell のメタ文字
//emlist{
* ? {} [] <> () ~ & | \ $ ; ' ` " \n
//}
を含む場合、shell 経由で実行されます。
そうでなければインタプリタから直接実行されます...
...ion: true) # => Errno::ENOENT (No such file or directory - sad)
system('ruby -e "exit(false)"', exception: true) # => RuntimeError (Command failed with exit 1: ruby -e "exit(false)")
system('ruby -e "exit(true)"', exception: true) # => true
//}

@see Kernel.#`,Kernel.#spawn,Kernel...

Kernel.#system(env, program, *args, options={}) -> bool | nil (135.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...返します。
それ以外の終了ステータスの場合は false を返します。
コマンドを実行できなかった場合は nil を返します。

options で :exception に true を指定することで、
nil
false を返す代わりに例外を発生するようにできます...

絞り込み条件を変える

Kernel.#system(program, *args, options={}) -> bool | nil (135.0)

引数を外部コマンドとして実行して、成功した時に真を返します。

...返します。
それ以外の終了ステータスの場合は false を返します。
コマンドを実行できなかった場合は nil を返します。

options で :exception に true を指定することで、
nil
false を返す代わりに例外を発生するようにできます...
<< 1 2 3 > >>