種類
ライブラリ
- English (250)
- ビルトイン (3182)
- benchmark (10)
- bigdecimal (32)
- continuation (40)
- csv (10)
- delegate (10)
- digest (10)
-
drb
/ extservm (10) - e2mmap (18)
-
irb
/ cmd / load (20) -
irb
/ xmp (20) - json (30)
-
minitest
/ spec (2) -
minitest
/ unit (2) - mkmf (910)
- open-uri (66)
- open3 (20)
- openssl (20)
- pathname (20)
- pp (14)
- profiler (6)
- psych (20)
- pty (40)
- rake (130)
- rubygems (10)
-
rubygems
/ commands / lock _ command (10) -
rubygems
/ custom _ require (10) -
rubygems
/ timer (10) - scanf (30)
- shell (12)
-
shell
/ command-processor (18) -
shell
/ filter (12) - socket (80)
- stringio (90)
- syslog (90)
- tempfile (45)
-
test
/ unit (1) - timeout (37)
- tracer (30)
- un (130)
- uri (10)
-
webrick
/ utils (10) - win32ole (10)
- zlib (40)
クラス
-
ARGF
. class (160) - Array (60)
- BasicObject (20)
-
Benchmark
:: Tms (10) - BigDecimal (12)
- Binding (10)
- CSV (10)
- Complex (20)
- Continuation (20)
-
DRb
:: ExtServManager (10) - Enumerator (10)
- Exception (20)
- File (30)
- IO (390)
-
IRB
:: ExtendCommand :: Load (10) -
IRB
:: ExtendCommand :: Require (10) - LoadError (10)
- Method (10)
- Module (150)
- Object (171)
-
OpenSSL
:: BN (10) - Proc (17)
- Random (87)
- Rational (10)
- Shell (12)
-
Shell
:: CommandProcessor (18) -
Shell
:: Filter (12) - Socket (40)
- String (72)
- StringIO (90)
- SystemExit (10)
- Tempfile (45)
- Thread (80)
-
Thread
:: Backtrace :: Location (10) - TracePoint (10)
- Tracer (30)
- UnboundMethod (18)
- UncaughtThrowError (18)
-
WIN32OLE
_ EVENT (10) - XMP (10)
-
Zlib
:: GzipWriter (40)
モジュール
- Exception2MessageMapper (18)
- FileTest (10)
- FileUtils (20)
- Kernel (3160)
-
MiniTest
:: Assertions (2) - Open3 (20)
-
OpenSSL
:: Buffering (10) - OpenURI (20)
-
OpenURI
:: OpenRead (20) - PTY (40)
- Process (80)
-
Socket
:: Constants (40) - Syslog (90)
-
Test
:: Unit (1) - Timeout (17)
- URI (12)
-
WEBrick
:: Utils (10) - Warning (14)
キーワード
-
$ ! (10) -
$ " (10) -
$ $ (10) -
$ & (10) -
$ & # 39; (10) -
$ * (10) -
$ + (10) -
$ , (10) -
$ -0 (10) -
$ -F (10) -
$ -I (10) -
$ -K (10) -
$ -W (10) -
$ -a (10) -
$ -d (10) -
$ -i (10) -
$ -l (10) -
$ -p (10) -
$ -v (10) -
$ -w (10) -
$ . (10) -
$ / (10) -
$ 0 (10) -
$ 1 (10) -
$ 10 (10) -
$ 11 (10) -
$ 2 (10) -
$ 3 (10) -
$ 4 (10) -
$ 5 (10) -
$ 6 (10) -
$ 7 (10) -
$ 8 (10) -
$ 9 (10) -
$ : (10) -
$ ; (10) -
$ < (10) -
$ = (10) -
$ > (10) -
$ ? (10) -
$ @ (10) -
$ ARGV (10) -
$ CFLAGS (10) -
$ CHILD _ STATUS (10) -
$ DEBUG (10) -
$ DEFAULT _ INPUT (10) -
$ DEFAULT _ OUTPUT (10) -
$ ERROR _ INFO (10) -
$ ERROR _ POSITION (10) -
$ FIELD _ SEPARATOR (10) -
$ FILENAME (10) -
$ FS (10) -
$ IGNORECASE (10) -
$ INPUT _ LINE _ NUMBER (10) -
$ INPUT _ RECORD _ SEPARATOR (10) -
$ KCODE (10) -
$ LAST _ MATCH _ INFO (10) -
$ LAST _ PAREN _ MATCH (10) -
$ LAST _ READ _ LINE (10) -
$ LDFLAGS (10) -
$ LOADED _ FEATURES (10) -
$ LOAD _ PATH (10) -
$ MATCH (10) -
$ NR (10) -
$ OFS (10) -
$ ORS (10) -
$ OUTPUT _ FIELD _ SEPARATOR (10) -
$ OUTPUT _ RECORD _ SEPARATOR (10) -
$ PID (10) -
$ POSTMATCH (10) -
$ PREMATCH (10) -
$ PROCESS _ ID (10) -
$ PROGRAM _ NAME (10) -
$ RS (10) -
$ SAFE (10) -
$ VERBOSE (10) -
$ \ (10) -
$ _ (10) -
$ ` (10) -
$ archdir (10) -
$ defs (10) -
$ hdrdir (10) -
$ libdir (10) -
$ libs (10) -
$ sitearchdir (10) -
$ sitelibdir (10) -
$ srcdir (10) -
$ stderr (10) -
$ stdin (10) -
$ stdout (10) -
$ topdir (10) -
$ ~ (10) - % (10)
-
AI
_ V4MAPPED _ CFG (20) - ARGF (20)
- Array (10)
- BasicObject (10)
- BigDecimal (20)
- Binding (10)
- CONFIG (10)
- Complex (30)
- Continuation (10)
- Converters (10)
- DATA (10)
- DEFAULT (7)
- DefaultLoader (10)
- DelegateClass (10)
- Digest (10)
- File (10)
- Float (10)
- Hash (10)
- Integer (10)
- JSON (10)
- Kernel (10)
- LoadError (10)
- Location (10)
- LockCommand (10)
-
NEWS for Ruby 2
. 0 . 0 (10) -
NEWS for Ruby 2
. 1 . 0 (10) -
NEWS for Ruby 2
. 2 . 0 (9) -
NEWS for Ruby 2
. 3 . 0 (8) -
NEWS for Ruby 2
. 4 . 0 (7) -
NEWS for Ruby 2
. 5 . 0 (6) -
NEWS for Ruby 2
. 6 . 0 (5) -
NEWS for Ruby 2
. 7 . 0 (4) -
NEWS for Ruby 3
. 0 . 0 (3) -
NEWS for Ruby 3
. 1 . 0 (2) - Pathname (20)
- Proc (10)
-
Profiler
_ _ (6) - Rational (20)
- Rubyの起動 (10)
- Ruby用語集 (10)
- RuntimeError (10)
-
SCRIPT
_ LINES _ _ (10) -
SO
_ ATTACH _ FILTER (20) -
SO
_ DETACH _ FILTER (20) -
SO
_ NKE (20) - Scanf (6)
- String (10)
- Task (10)
- ThreadError (10)
- TracePoint (10)
- URI (10)
- UncaughtThrowError (9)
- Win32ネイティブ版Rubyの互換性問題 (10)
- [] (28)
-
_ _ callee _ _ (10) -
_ _ dir _ _ (10) -
_ _ method _ _ (10) - ` (10)
- abort (40)
-
add
_ filter (20) -
add
_ trace _ func (10) - alert (10)
-
alias
_ method (10) - ancestors (10)
-
arg
_ config (10) -
assert
_ throws (1) -
at
_ exit (10) - autoload (20)
- autoload? (20)
-
backtrace
_ locations (20) - bigdecimal (10)
-
bind
_ call (8) - binding (10)
- binread (10)
- binwrite (10)
-
block
_ given? (10) - call (10)
- callcc (10)
- caller (30)
-
caller
_ locations (20) - catch (20)
-
cc
_ command (10) -
check
_ signedness (20) -
check
_ sizeof (20) - chmod (10)
- chomp (10)
- chop (10)
- class (10)
-
class
_ eval (20) -
class
_ variables (10) - command (10)
-
const
_ defined? (10) - constants (20)
- convert (10)
-
convertible
_ int (20) - cp (10)
-
cpp
_ command (10) - create (18)
-
create
_ header (10) -
create
_ makefile (10) -
create
_ tmpsrc (10) - crit (10)
- debug (10)
-
def
_ exception (6) -
defined
_ class (10) - delegate (10)
-
depend
_ rules (10) - desc (10)
- describe (1)
-
dir
_ config (10) - directory (10)
-
drb
/ extservm (10) -
dummy
_ makefile (10) -
egrep
_ cpp (20) - emerg (10)
-
enable
_ config (20) - err (10)
- eval (30)
- exception (20)
- exec (40)
- execute (20)
- exit (30)
- exit! (20)
- fail (30)
- file (10)
-
file
_ create (10) -
find
_ executable (10) -
find
_ header (10) -
find
_ library (20) -
find
_ type (20) -
for
_ fd (10) - foreach (20)
- fork (40)
- format (20)
- freeze (10)
- gem (10)
- getpty (20)
- gets (40)
-
global
_ variables (10) - gsub (30)
-
have
_ devel? (10) -
have
_ framework (20) -
have
_ func (20) -
have
_ header (20) -
have
_ library (20) -
have
_ macro (20) -
have
_ struct _ member (20) -
have
_ type (20) -
have
_ var (20) - help (10)
- hex (10)
- httpd (10)
- identical? (10)
- import (10)
- include (10)
- info (10)
- inspect (10)
- install (10)
-
install
_ files (10) -
install
_ rb (10) -
instance
_ eval (20) -
instance
_ variables (10) - irb (10)
-
irb
/ xmp (10) - iterator? (10)
- j (10)
- jj (10)
- kill (20)
- lambda (16)
- libpathflag (10)
-
link
_ command (10) - ln (10)
- load (10)
-
local
_ variables (10) - log (10)
-
log
_ src (10) - loop (20)
- mathn (4)
-
merge
_ libs (10) - method (10)
-
minitest
/ autorun (10) -
minitest
/ unit (1) - mkdir (10)
- mkmf (20)
- modified? (10)
-
module
_ eval (20) - multitask (10)
-
must
_ throw (1) - mv (10)
- namespace (10)
- new (78)
- next (10)
- notice (10)
- oct (10)
- open (144)
- open-uri (6)
-
open
_ uri (20) - owner (20)
- p (10)
- path (10)
- popen (140)
- popen3 (20)
- pp (20)
-
pretty
_ print (20) - print (60)
- printf (70)
- proc (17)
-
psych
_ y (10) -
public
_ instance _ method (10) - putc (40)
- puts (50)
- raise (40)
- rand (80)
-
rb
_ String (10) -
rb
_ exec _ end _ proc (10) -
rb
_ f _ array (10) -
rb
_ f _ float (10) -
rb
_ f _ hash (10) -
rb
_ f _ integer (10) -
rb
_ f _ string (10) -
rb
_ load (10) - read (30)
- readline (40)
- readlines (70)
- rect (10)
- rectangular (10)
-
remove
_ const (10) - reopen (50)
- require (20)
-
require
_ relative (10) - rm (10)
-
rm
_ f (10) -
rm
_ rf (10) - rmdir (10)
- ruby (10)
-
ruby 1
. 6 feature (10) -
ruby 1
. 8 . 2 feature (10) -
ruby 1
. 8 . 4 feature (10) -
ruby 1
. 8 . 5 feature (10) -
ruby 1
. 9 feature (10) -
rubygems
/ commands / lock _ command (10) -
rubygems
/ custom _ require (10) - rule (10)
-
run
_ config (6) - sample (40)
- scanf (24)
- select (20)
- send (20)
-
set
_ close _ on _ exec (10) -
set
_ trace _ func (30) -
setup
_ argv (1) - sh (10)
- shuffle! (20)
-
singleton
_ method (10) - skip (1)
- sleep (20)
- spawn (70)
- sprintf (10)
- sprintf フォーマット (10)
- srand (40)
- status (10)
- sub (20)
- syscall (10)
- sysopen (10)
- system (40)
- tag (9)
- task (10)
- terminate (10)
- test (38)
- throw (10)
- time (10)
- timeout (37)
-
to
_ a (40) -
to
_ ary (10) -
to
_ f (10) -
to
_ i (10) -
to
_ int (10) -
to
_ r (10) -
to
_ s (20) -
to
_ str (10) - touch (10)
-
trace
_ var (30) - tracer (10)
- trap (20)
-
try
_ compile (20) -
try
_ constant (20) -
try
_ cpp (20) -
try
_ do (20) -
try
_ func (20) -
try
_ link (20) -
try
_ run (20) -
try
_ static _ assert (20) -
try
_ type (20) -
try
_ var (20) - ubygems (4)
-
untrace
_ var (10) - value (9)
- verbose= (10)
-
wait
_ writable (10) - warn (24)
- warning (10)
-
webrick
/ https (10) -
webrick
/ httpservlet (10) -
with
_ config (20) -
with
_ werror (20) - write (20)
- xmp (10)
- xpopen (20)
- xsystem (10)
- y (10)
- このマニュアルのヘルプ (10)
- クラス/メソッドの定義 (10)
- セキュリティモデル (10)
- 制御構造 (10)
- 変数と定数 (10)
- 手続きオブジェクトの挙動の詳細 (10)
- 環境変数 (10)
- 終了処理 (10)
検索結果
先頭5件
-
Kernel
$ $ _ -> String | nil (9056.0) -
最後に Kernel.#gets または Kernel.#readline で読み込んだ文字列です。 EOF に達した場合には、 nil になります。 (覚え方: Perlと同じ)
...最後に Kernel.#gets または Kernel.#readline で読み込んだ文字列です。
EOF に達した場合には、 nil になります。
(覚え方: Perlと同じ)
Kernel.#print のような Perl 由来の幾つかのメソッドは、引数を省略すると代わりに $_ を利用します......。
この変数はローカルスコープかつスレッドローカルです。
Ruby起動時の初期値は nil です。
@see Kernel.#print, Kernel.#gets, Kernel.#readline, Object::ARGF
=== 例
example.txt:
foo
bar
baz
このとき、コマンド ruby -e 'print while gets' example.txt... -
Kernel
. # exec(env , program , *args , options={}) -> () (9036.0) -
引数で指定されたコマンドを実行します。
...イルデスクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。
詳しくは Kernel.#spawn を参照してください。
=== 引数の解釈
この形式で呼び出した場合、空白や shell のメタキャラクタも
そ......替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep
@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)... -
Kernel
. # exec(program , *args , options={}) -> () (9036.0) -
引数で指定されたコマンドを実行します。
...イルデスクリプタなど)引き継ぎます。
Hash を options として渡すことで、この挙動を変更できます。
詳しくは Kernel.#spawn を参照してください。
=== 引数の解釈
この形式で呼び出した場合、空白や shell のメタキャラクタも
そ......替えて以下を実行
$ ps aux|grep sleep
xxxx 32754 0.0 0.0 2580 468 pts/3 S+ 22:01 0:00 mysleep 600
xxxx 32761 0.0 0.0 2824 792 pts/6 S+ 22:01 0:00 grep sleep
@see Kernel.#system,Kernel.#`,Kernel.#spawn,Kernel.#fork,IO.popen,IO.pipe,Kernel.#open,exec(3)... -
Kernel
# create _ header(header = "extconf . h") -> String (9032.0) -
Kernel#have_func, Kernel#have_header などの検査結果を元に、 ヘッダファイルを生成します。
...
Kernel#have_func, Kernel#have_header などの検査結果を元に、
ヘッダファイルを生成します。
このメソッドは extconf.rb の最後で呼び出すようにしてください。
@param header ヘッダファイルの名前を指定します。
@return ヘッダファイ... -
Kernel
. # exit!(status = false) -> () (9030.0) -
Rubyプログラムの実行を即座に終了します。 status として整数が与えられた場合、その値を Ruby コマンドの終了ステータスとします。 デフォルトの終了ステータスは 1 です。
...XIT_FAILURE の値なので、正確には環境依存です。
exit! は exit とは違って、例外処理などは一切行ないませ
ん。 Kernel.#fork の後、子プロセスを終了させる時などに用
いられます。
@param status 終了ステータスを整数か true また......T.sync = true #表示前に終了しないようにする
puts 'start'
begin
puts 'start1...'
exit!
ensure
puts 'end1...' #実行されない
end
puts 'end' #実行されない
#=> start
# start1...
#終了ステータス:1
//}
@see Kernel.#exit,Kernel.#abort,Kernel.#at_exit,Kernel.#fork... -
Kernel
. # open(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO | Tempfile | IO (9030.0) -
name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
...ock) のように name の open メソッドが呼ばれます。
これ以外の場合は、name はファイル名として扱われ、従来の
Kernel.#open(name, *rest) が呼ばれます。
ブロックを与えた場合は上の場合と同様、name が http:// や ftp:// で
始まって......uby2.7以降、open-uriにより拡張されたKernel.openでURLを開くときにwarningが表示されるようになりました。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or......ram mode モードを文字列で与えます。Kernel.#open と同じです。
@param perm open(2) の第 3 引数のように、ファイルを生成する場合のファイルのパーミッションを
整数で指定します。Kernel.#open と同じです
@param options ハッシ... -
Kernel
. # open(name , mode = & # 39;r& # 39; , perm = nil , options = {}) {|ouri| . . . } -> object (9030.0) -
name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
...ock) のように name の open メソッドが呼ばれます。
これ以外の場合は、name はファイル名として扱われ、従来の
Kernel.#open(name, *rest) が呼ばれます。
ブロックを与えた場合は上の場合と同様、name が http:// や ftp:// で
始まって......uby2.7以降、open-uriにより拡張されたKernel.openでURLを開くときにwarningが表示されるようになりました。
require 'open-uri'
open("http://www.ruby-lang.org/") {|f|
# ...
}
#=> warning: calling URI.open via Kernel#open is deprecated, call URI.open directly or......ram mode モードを文字列で与えます。Kernel.#open と同じです。
@param perm open(2) の第 3 引数のように、ファイルを生成する場合のファイルのパーミッションを
整数で指定します。Kernel.#open と同じです
@param options ハッシ... -
Kernel
. # autoload(const _ name , feature) -> nil (9028.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
...定数 const_name を最初に参照した時に feature を
Kernel.#require するように設定します。
const_name には、 "::" 演算子を含めることはできません。
ネストした定数を指定する方法は Module#autoload を参照してください。
const_name が aut......対象を指定します。
@raise LoadError featureのロードに失敗すると発生します。
//emlist[][ruby]{
# ------- /tmp/foo.rb ---------
class Bar
end
# ----- end of /tmp/foo.rb ----
autoload :Bar, '/tmp/foo'
p Bar #=> Bar
//}
@see Kernel.#autoload?,Module#autoload,Kernel.#require... -
Kernel
. # catch {|tag| . . . . } -> object (9028.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。
//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j in 1..2
for k in 1..2
throw tag, k
end
end
end
end
p result #=> 1
//}
@see Kernel.#throw... -
Kernel
. # catch(tag) {|tag| . . . . } -> object (9028.0) -
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
...
Kernel.#throwとの組み合わせで大域脱出を行います。 catch はブロックを実行します。
ブロックの実行中に tag と同一のオブジェクトを引数とする Kernel.#throw が行われた
場合は、その throw の第二引数を戻り値として、ブロック......@return ブロックの返り値か、対応するthrowの第二引数を返り値として返します。
//emlist[例][ruby]{
result = catch do |tag|
for i in 1..2
for j in 1..2
for k in 1..2
throw tag, k
end
end
end
end
p result #=> 1
//}
@see Kernel.#throw... -
Kernel
. # readlines(rs = $ / ) -> [String] (9028.0) -
ARGFを Kernel.#gets(rs) でEOFまで読み込んで、その各行を要素としてもつ配列を返します。 行の区切りは引数 rs で指定した文字列になります。
...ARGFを Kernel.#gets(rs) でEOFまで読み込んで、その各行を要素としてもつ配列を返します。
行の区切りは引数 rs で指定した文字列になります。
rs に nil を指定すると行区切りなしとみなします。
空文字列 "" を指定すると連続......s("") #=> ["hello\nit\n\n", "common\n", "hello\nit\n\n", "common\n"]
ARGV << 'b.txt' << 'b.txt'
p readlines('it') #=> ["hello\nit", "\n\ncommon\n", "hello\nit", "\n\ncommon\n"]
p readlines #=> []
//}
//emlist[b.txt][ruby]{
hello
it
common
//}
@see $/,ARGF,Kernel.#gets, Kernel.#readline... -
Kernel
. # srand -> Integer (9028.0) -
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
...
Kernel.#rand や Random.rand で使用される擬似乱数生成器の種を設定し、古い種を返します。
seed に整数を指定するとその絶対値を乱数の種に設定します。
それ以外の値を指定した場合は seed.to_int が指定されたものとして扱いま......す。
seed に既知の値を与えると、以前の Kernel.#rand の値を再現できます。
seed が省略された時には
現在の時刻やプロセス ID、srand を呼び出した回数、
また可能なら /dev/urandom から読み出したデータなどを元に種を作ります......) #=> 0.938911141393347
p rand(0) #=> 0.915824970865251
seeds << srand(num)
p rand(6) #=> 3
p rand(6) #=> 0
p rand(0) #=> 0.445804380918972
p rand(0) #=> 0.422248634121701
seeds << srand
p seeds #=> [455675, 2995620310703489221660585195204777696, 455675]
//}
@see Kernel.#rand, Random::DEFAULT...