別のキーワード
ライブラリ
- ビルトイン (12)
- abbrev (12)
- base64 (36)
- digest (12)
- erb (48)
- etc (60)
- json (84)
- kconv (12)
- objspace (12)
- open-uri (8)
- open3 (144)
- readline (12)
- shellwords (48)
- syslog (36)
-
webrick
/ htmlutils (12) -
webrick
/ httpstatus (12) -
webrick
/ httputils (12) -
webrick
/ utils (24) -
win32
/ resolv (24)
クラス
-
Win32
:: Resolv (24)
モジュール
- Abbrev (12)
- Base64 (36)
- Digest (12)
-
ERB
:: Util (48) - Etc (60)
- JSON (84)
- Kconv (12)
- Kernel (20)
- ObjectSpace (12)
- Open3 (144)
- Readline (12)
- Shellwords (48)
- Syslog (36)
-
WEBrick
:: HTMLUtils (12) -
WEBrick
:: HTTPStatus (12) -
WEBrick
:: HTTPUtils (12) -
WEBrick
:: Utils (24)
キーワード
- abbrev (12)
-
allocation
_ sourcefile (12) - autoload (12)
- capture2 (12)
- capture2e (12)
- capture3 (12)
- confstr (12)
- decode64 (12)
- dump (12)
- encode64 (12)
- escape (12)
- facility (12)
-
fast
_ generate (12) -
fast
_ unparse (12) - generate (12)
-
get
_ hosts _ path (12) -
get
_ resolv _ info (12) - getlogin (12)
- getservername (12)
- h (12)
- hexencode (12)
-
html
_ escape (12) - ident (12)
- isjis (12)
-
mime
_ type (12) - open (8)
- pipeline (12)
-
pipeline
_ r (24) -
pipeline
_ rw (24) -
pipeline
_ start (24) -
pipeline
_ w (24) -
pretty
_ generate (12) -
pretty
_ unparse (12) -
random
_ string (12) - readline (12)
-
reason
_ phrase (12) - shellescape (12)
- shelljoin (12)
- shellsplit (12)
- shellwords (12)
- sysconfdir (12)
- systmpdir (12)
- u (12)
- uname (12)
- unparse (12)
-
url
_ encode (12) -
urlsafe
_ encode64 (12)
検索結果
先頭5件
-
WEBrick
:: Utils . # random _ string(len) -> String (6215.0) -
A-Z, a-z, 0-9 からなる長さ len のランダムな文字列を返します。
...A-Z, a-z, 0-9 からなる長さ len のランダムな文字列を返します。
@param len 得たい文字列の長さを整数で指定します。単位はバイトです。
require 'webrick'
p WEBrick::Utils.random_string(10) #=> "xF0jwU4RJd"... -
Digest
. # hexencode(string) -> String (231.0) -
引数である文字列 string を、16進数に変換した文字列を生成して返します。
...引数である文字列 string を、16進数に変換した文字列を生成して返します。
@param string 文字列を指定します。
//emlist[][ruby]{
require 'digest'
p Digest.hexencode("") # => ""
p Digest.hexencode("d") # => "64"
p Digest.hexencode("\1\2") # => "0102"
p Di... -
WEBrick
:: HTMLUtils . # escape(string) -> String (215.0) -
指定された文字列に含まれる ", &, <, > を文字実体参照に変換した文字列を 生成して返します。
...定された文字列に含まれる ", &, <, > を文字実体参照に変換した文字列を
生成して返します。
@param string エスケープしたい文字列を指定します。
require 'webrick'
p WEBrick::HTMLUtils.escape('/?q=foo&hl=<ja>') #=> "/?q=foo&hl=<ja>"... -
Win32
:: Resolv . # get _ resolv _ info -> [[String] , [String]] (215.0) -
ドメイン名とネームサーバを配列の配列で返します。
...列の配列で返します。
例:
require "win32/resolv"
p Win32::Resolv.get_resolv_info #=> [["my.example.com"], ["192.168.1.1"]]
設定されていない情報は nil になります。
# ドメイン名が設定されていない場合。
require "win32/resolv"
p Win32::Resolv.get... -
Open3
. # capture3(*cmd) -> [String , String , Process :: Status] (209.0) -
cmdで指定されたコマンドを実行し、そのプロセスの標準出力と標準エラー、プ ロセスの終了ステータスを表すオブジェクトを返します。
...渡されます。opts[:binmode]を真に指定されると内部で使用される
パイプをバイナリモードに指定します。
例:
require "open3"
o, e, s = Open3.capture3("echo a; sort >&2", :stdin_data=>"foo\nbar\nbaz\n")
p o #=> "a\n"
p e #=> "bar\nbaz\nfoo\n"
p s #=>... -
JSON
. # generate(object , state = nil) -> String (133.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a J......。
@raise JSON::CircularDatastructure 与えられたオブジェクトが循環参照を持つ場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")... -
JSON
. # unparse(object , state = nil) -> String (133.0) -
与えられたオブジェクトを一行の JSON 形式の文字列に変換して返します。
...文字列です。
: :space
a string that is put after, a : or , delimiter (default: '')
: :space_before
a string that is put before a : pair delimiter (default: '')
: :object_nl
a string that is put at the end of a JSON object (default: '')
: :array_nl
a string that is put at the end of a J......。
@raise JSON::CircularDatastructure 与えられたオブジェクトが循環参照を持つ場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.generate([1, 2, { name: "tanaka", age: 19 }])
# => "[1,2,{\"name\":\"tanaka\",\"age\":19}]"
json_state = JSON::State.new(space: " ")... -
Readline
. # readline(prompt = "" , add _ hist = false) -> String | nil (132.0) -
prompt を出力し、ユーザからのキー入力を待ちます。 エンターキーの押下などでユーザが文字列を入力し終えると、 入力した文字列を返します。 このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。 何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、 ユーザからの入力がない場合は nil を返します。
...、かつ、標準入力をクローズしている
(isatty(2) の errno が EBADF である。) 場合に発生します。
例:
require "readline"
input = Readline.readline
(プロンプトなどは表示せずに、入力待ちの状態になります。
ここでは「......を復帰する。
require 'readline'
stty_save = `stty -g`.chomp
begin
while buf = Readline.readline
p buf
end
rescue Interrupt
system("stty", stty_save)
exit
end
例: INTシグナルを捕捉して、端末状態を復帰する。
require 'readline'
stty_......ります。
require 'readline'
trap("INT", "SIG_IGN")
while buf = Readline.readline
p buf
end
入力履歴 Readline::HISTORY を使用して、次のようなこともできます。
例: 空行や直前の入力と同じ内容は入力履歴に残さない。
require 'readline'... -
Etc
. # uname -> {Symbol => String} (114.0) -
uname(2) で取得したシステム情報を Hash で返します。
...とも :sysname, :nodename, :release, :version, :machine の
5 つのキーを持つ Hash を返します。
//emlist[例][ruby]{
require 'etc'
require 'pp'
pp Etc.uname
# => {:sysname=>"Linux",
# :nodename=>"boron",
# :release=>"2.6.18-6-xen-686",
# :version=>"#1 SMP Thu Nov 5...