ライブラリ
- ビルトイン (357)
- csv (36)
-
io
/ console (12) -
irb
/ context (36) -
net
/ http (24) -
net
/ telnet (2) - open3 (48)
- shell (24)
-
shell
/ builtin-command (12) -
shell
/ command-processor (24) -
shell
/ filter (24) - socket (144)
- timeout (21)
-
webrick
/ httpstatus (12)
クラス
-
ARGF
. class (168) - Array (21)
- CSV (36)
- IO (12)
-
IRB
:: Context (36) - Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Echo (12) -
Shell
:: Filter (24) - Socket (120)
- String (24)
モジュール
- Kernel (144)
- Open3 (48)
-
Socket
:: Constants (12) - Timeout (21)
キーワード
- HTTPMultipleChoice (12)
- HTTPMultipleChoices (12)
-
IFF
_ ECHO (24) - MultipleChoices (12)
- Rubyの起動 (7)
- TCPServer (12)
- Telnet (2)
- capture2e (12)
- capture3 (12)
- cat (18)
- chr (12)
- each (6)
-
each
_ char (12) -
each
_ codepoint (24) - echo= (12)
- echo? (12)
- exec (48)
- filename (12)
- filter (36)
- getbyte (12)
- getc (12)
- gets (36)
- glob (18)
-
inplace
_ mode (12) - new (6)
- noecho (12)
- pack (21)
- pack テンプレート文字列 (12)
-
pack
_ sockaddr _ in (12) - path (12)
- popen3 (24)
- read (12)
- readbyte (12)
- readchar (12)
-
ruby 1
. 6 feature (12) -
sockaddr
_ in (12) - socket (12)
- spawn (48)
- system (48)
-
tcp
_ server _ loop (24) - tee (18)
- timeout (21)
-
udp
_ server _ sockets (48) - unpack (12)
-
unpack
_ sockaddr _ in (12)
検索結果
先頭5件
-
Socket
. udp _ server _ sockets(host , port) -> [Sockets] (6206.0) -
UDP で host:port を待ち受けるサーバ側のソケットを作成します。
...UDP で host:port を待ち受けるサーバ側のソケットを作成します。
ブロックなしの場合は、ソケットオブジェクトの配列を返します。
ブロック付きの場合は、ソケットオブジェクトをそのブロックに
渡して呼び出します。ブ......。
port が 0 の場合は、実際のポート番号は動的に選ばれます。
ただし返り値のソケットはすべて同じ番号を持ちます。
# UDP/IP echo server
require 'socket'
Socket.udp_server_sockets(0) {|sockets|
p sockets.first.local_address.ip_port #=> 32......963
Socket.udp_server_loop_on(sockets) {|msg, msg_src|
msg_src.reply msg
}
}
@param host 割り当てるホスト名
@param port 割り当てるポート番号... -
Socket
. udp _ server _ sockets(host , port) {|sockets| . . . } -> object (6206.0) -
UDP で host:port を待ち受けるサーバ側のソケットを作成します。
...UDP で host:port を待ち受けるサーバ側のソケットを作成します。
ブロックなしの場合は、ソケットオブジェクトの配列を返します。
ブロック付きの場合は、ソケットオブジェクトをそのブロックに
渡して呼び出します。ブ......。
port が 0 の場合は、実際のポート番号は動的に選ばれます。
ただし返り値のソケットはすべて同じ番号を持ちます。
# UDP/IP echo server
require 'socket'
Socket.udp_server_sockets(0) {|sockets|
p sockets.first.local_address.ip_port #=> 32......963
Socket.udp_server_loop_on(sockets) {|msg, msg_src|
msg_src.reply msg
}
}
@param host 割り当てるホスト名
@param port 割り当てるポート番号... -
Socket
. udp _ server _ sockets(port) -> [Sockets] (6206.0) -
UDP で host:port を待ち受けるサーバ側のソケットを作成します。
...UDP で host:port を待ち受けるサーバ側のソケットを作成します。
ブロックなしの場合は、ソケットオブジェクトの配列を返します。
ブロック付きの場合は、ソケットオブジェクトをそのブロックに
渡して呼び出します。ブ......。
port が 0 の場合は、実際のポート番号は動的に選ばれます。
ただし返り値のソケットはすべて同じ番号を持ちます。
# UDP/IP echo server
require 'socket'
Socket.udp_server_sockets(0) {|sockets|
p sockets.first.local_address.ip_port #=> 32......963
Socket.udp_server_loop_on(sockets) {|msg, msg_src|
msg_src.reply msg
}
}
@param host 割り当てるホスト名
@param port 割り当てるポート番号... -
Socket
. udp _ server _ sockets(port) {|sockets| . . . } -> object (6206.0) -
UDP で host:port を待ち受けるサーバ側のソケットを作成します。
...UDP で host:port を待ち受けるサーバ側のソケットを作成します。
ブロックなしの場合は、ソケットオブジェクトの配列を返します。
ブロック付きの場合は、ソケットオブジェクトをそのブロックに
渡して呼び出します。ブ......。
port が 0 の場合は、実際のポート番号は動的に選ばれます。
ただし返り値のソケットはすべて同じ番号を持ちます。
# UDP/IP echo server
require 'socket'
Socket.udp_server_sockets(0) {|sockets|
p sockets.first.local_address.ip_port #=> 32......963
Socket.udp_server_loop_on(sockets) {|msg, msg_src|
msg_src.reply msg
}
}
@param host 割り当てるホスト名
@param port 割り当てるポート番号... -
IO
# noecho {|io| . . . } -> object (6200.0) -
文字入力時のエコーバックを無効に設定してブロックを評価します。
...す。ブロックを評価した結果を返します。
以下の例では、標準入力からエコーバックなしで文字列を一行読み込みます。
require "io/console"
STDIN.noecho(&:gets)
@raise LocalJumpError ブロックを指定しなかった場合に発生します。... -
ARGF
. class # gets(limit) -> String | nil (6124.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...imit 最大の読み込みバイト数
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > 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(......# => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ 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#getbyte, ARGF.class#getc... -
ARGF
. class # gets(limit , chomp: false) -> String | nil (6124.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...ド)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets......$ 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.txt
# $ 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#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / ) -> String | nil (6124.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...imit 最大の読み込みバイト数
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > 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(......# => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ 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#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs = $ / , chomp: false) -> String | nil (6124.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...ド)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets......$ 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.txt
# $ 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#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs , limit) -> String | nil (6124.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...imit 最大の読み込みバイト数
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > 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(......# => "li"
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ 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#getbyte, ARGF.class#getc... -
ARGF
. class # gets(rs , limit , chomp: false) -> String | nil (6124.0) -
ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。
...ド)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。
例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt
# test.rb
ARGF.gets......$ 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.txt
# $ 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#getbyte, ARGF.class#getc... -
ARGF
. class # each _ codepoint -> Enumerator (6112.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...場合には、Enumerator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,... -
ARGF
. class # each _ codepoint { |c| . . . } -> self (6112.0) -
self の各コードポイントに対して繰り返しブロックを呼びだします。
...場合には、Enumerator を返します。
例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt
# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,...