ライブラリ
- ビルトイン (96)
- abbrev (12)
- base64 (36)
- benchmark (48)
- bigdecimal (48)
-
bigdecimal
/ ludcmp (12) -
bigdecimal
/ math (72) - cmath (36)
- digest (12)
- erb (60)
- etc (84)
- fiddle (36)
- fileutils (391)
- find (24)
- json (132)
- kconv (12)
- objspace (48)
- open-uri (16)
- open3 (168)
- readline (12)
- shellwords (48)
- syslog (204)
- timeout (21)
-
webrick
/ htmlutils (12) -
webrick
/ httpauth (12) -
webrick
/ httpstatus (12) -
webrick
/ httputils (24) -
webrick
/ utils (24) -
win32
/ resolv (24)
クラス
-
Win32
:: Resolv (24)
モジュール
- Abbrev (12)
- Base64 (36)
- Benchmark (48)
- BigMath (96)
- CMath (36)
- Digest (12)
-
ERB
:: DefMethod (12) -
ERB
:: Util (48) - Etc (84)
- Fiddle (36)
- FileTest (48)
- FileUtils (391)
- Find (24)
- JSON (132)
- Kconv (12)
- Kernel (88)
- LUSolve (12)
- ObjectSpace (48)
- Open3 (168)
- Readline (12)
- Shellwords (48)
- Syslog (180)
-
Syslog
:: Macros (24) - Timeout (21)
-
WEBrick
:: HTMLUtils (12) -
WEBrick
:: HTTPAuth (12) -
WEBrick
:: HTTPStatus (12) -
WEBrick
:: HTTPUtils (24) -
WEBrick
:: Utils (24)
キーワード
- BigDecimal (24)
- E (12)
-
LOG
_ MASK (12) -
LOG
_ UPTO (12) - PI (12)
- abbrev (12)
-
allocation
_ sourcefile (12) -
allocation
_ sourceline (12) - atan (12)
- autoload (12)
-
basic
_ auth (12) - benchmark (12)
- bm (12)
- bmbm (12)
- capture2 (12)
- capture2e (12)
- capture3 (12)
- cbrt (6)
- cd (24)
- chdir (24)
- chmod (12)
-
chmod
_ R (12) - chown (12)
-
chown
_ R (12) - close (12)
- cmp (12)
-
compare
_ file (12) - confstr (12)
- copy (12)
- cos (12)
- cp (12)
-
cp
_ lr (7) -
cp
_ r (12) - crit (12)
- decode64 (12)
-
def
_ erb _ method (12) - dlunwrap (12)
- dlwrap (12)
- dump (12)
- encode64 (12)
- escape (12)
- exp (18)
- facility (12)
-
fast
_ generate (12) -
fast
_ unparse (12) - find (24)
- free (12)
- generate (12)
-
get
_ hosts _ path (12) -
get
_ resolv _ info (12) - getlogin (12)
- getservername (12)
- h (12)
- hexencode (12)
-
html
_ escape (12) - ident (12)
- identical? (12)
- info (12)
- install (12)
- isjis (12)
- link (12)
- ln (12)
-
ln
_ s (12) - load (24)
-
load
_ mime _ types (12) - log (36)
- lusolve (12)
- makedirs (12)
- mask (12)
- mask= (12)
-
memsize
_ of (12) -
mime
_ type (12) - mkdir (12)
-
mkdir
_ p (12) - mkpath (12)
- move (12)
- mv (12)
- notice (12)
- nprocessors (12)
- open (40)
- open! (12)
- parse (12)
- parse! (12)
- pipeline (12)
-
pipeline
_ r (24) -
pipeline
_ rw (24) -
pipeline
_ start (24) -
pipeline
_ w (24) - popen3 (24)
-
pretty
_ generate (12) -
pretty
_ unparse (12) -
random
_ string (12) - readline (12)
- realtime (12)
-
reason
_ phrase (12) - remove (12)
-
remove
_ entry (12) - reopen (12)
-
require
_ relative (12) - restore (12)
- rm (12)
-
rm
_ r (12) - rmdir (12)
- setgid? (12)
- setuid? (12)
- shellescape (12)
- shelljoin (12)
- shellsplit (12)
- shellwords (12)
- sin (12)
- sin! (6)
- socket? (12)
- sqrt (18)
- sticky? (12)
- symlink (12)
- sysconf (12)
- sysconfdir (12)
- systmpdir (12)
- timeout (21)
- touch (12)
-
trace
_ object _ allocations (12) - u (12)
- uname (12)
- unparse (12)
- uptodate? (12)
-
url
_ encode (12) -
urlsafe
_ encode64 (12) - warning (12)
検索結果
先頭5件
-
Kernel
. # require(feature) -> bool (24226.0) -
Ruby ライブラリ feature をロードします。拡張子補完を行い、 同じファイルの複数回ロードはしません。
...字列です。
@raise LoadError ロードに失敗した場合に発生します。
//emlist[例][ruby]{
$LOADED_FEATURES.grep(/prime/).size # => 0
require "prime" # => true
$LOADED_FEATURES.grep(/prime/).size # => 1
require "prime" # => false
begin
require "invalid"
rescue LoadError......=> e
e.message # => "cannot load such file -- invalid"
end
//}
@see Kernel.#load,Kernel.#autoload,Kernel.#require_relative... -
Kernel
. # require _ relative(relative _ feature) -> bool (12248.0) -
現在のファイルからの相対パスで require します。
...の相対パスで require します。
require File.expand_path(relative_feature, File.dirname(__FILE__))
とほぼ同じです。
Kernel.#eval などで文字列を評価した場合に、そこから
require_relative を呼出すと必ず失敗します。
@param relative_feature ファイ......ル名の文字列です。
@raise LoadError ロードに失敗した場合に発生します。
@see Kernel.#require
=== require と load のスコープ
ローカル変数はファイル間では共有されません。ですので、
ロードしたライブラリのローカル変数を
ロー......プの扱い方はKernel.#loadでも同様です。
//emlist[例][ruby]{
# ---------- some.rb -----------
$a = 1
@a = 1
A = 1
a = 1
# ---------- end some.rb -------
require 'some'
p $a #=> 1
p @a #=> 1
p A #=> 1
p a # undefined local variable or method `a' for #<Object:0x294f9ec @a=1> (NameError)... -
Kconv
. # isjis(str) -> bool (12207.0) -
文字列 str が ISO-2022-JP なバイト列として正当であるかどうかを判定します。
...文字列 str が ISO-2022-JP なバイト列として正当であるかどうかを判定します。
@param str 判定対象の文字列
@see String#isjis
//emlist[例][ruby]{
require 'kconv'
euc_str = "\
\xa5\xaa\xa5\xd6\xa5\xb8\xa5\xa7\xa5\xaf\xa5\xc8\xbb\xd8\xb8\xfe\
\xa5\xd7\xa5\xed\xa5\xb0......force_encoding('EUC-JP')
jis_str = "\
\x1b\x24\x42\x25\x2a\x25\x56\x25\x38\x25\x27\x25\x2f\x25\x48\x3b\x58\x38\x7e\
\x25\x57\x25\x6d\x25\x30\x25\x69\x25\x5f\x25\x73\x25\x30\x38\x40\x38\x6c\x1b\x28\x42\
\x52\x75\x62\x79".force_encoding('ISO-2022-JP')
euc_str.isjis # => false
jis_str.isjis # => tr... -
Win32
:: Resolv . # get _ resolv _ info -> [[String] , [String]] (9313.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_resolv_info #=> [nil, ["192.1... -
FileUtils
. # chdir(dir , options = {}) {|dir| . . . . } -> nil (9307.0) -
プロセスのカレントディレクトリを dir に変更します。
...を dir に変更します。
ブロックとともに呼び出された時はブロック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby......]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) {|dir| . . . . } -> object (9307.0) -
プロセスのカレントディレクトリを dir に変更します。
...を dir に変更します。
ブロックとともに呼び出された時はブロック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby......]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # compare _ file(file _ a , file _ b) -> bool (9307.0) -
ファイル file_a と file_b の内容が同じなら真を返します。
...ファイル file_a と file_b の内容が同じなら真を返します。
@param file_a ファイル名。
@param file_b ファイル名。
//emlist[][ruby]{
require 'fileutils'
FileUtils.cmp('somefile', 'somefile') #=> true
FileUtils.cmp('/dev/null', '/dev/urandom') #=> false
//}... -
Readline
. # readline(prompt = "" , add _ hist = false) -> String | nil (9231.0) -
prompt を出力し、ユーザからのキー入力を待ちます。 エンターキーの押下などでユーザが文字列を入力し終えると、 入力した文字列を返します。 このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。 何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、 ユーザからの入力がない場合は nil を返します。
...列を返します。
このとき、add_hist が true であれば、入力した文字列を入力履歴に追加します。
何も入力していない状態で EOF(UNIX では ^D) を入力するなどで、
ユーザからの入力がない場合は nil を返します。
本メソッドは......時には行内編集が可能で、vi モードと Emacs モードが用意されています。
デフォルトは Emacs モードです。
@param prompt カーソルの前に表示する文字列を指定します。デフォルトは""です。
@param add_hist 真ならば、入力した文字......フォルトは偽です。
@raise IOError 標準入力が tty でない、かつ、標準入力をクローズしている
(isatty(2) の errno が EBADF である。) 場合に発生します。
例:
require "readline"
input = Readline.readline
(プロンプトなどは表... -
FileUtils
. # chdir(dir , options = {}) -> 0 (9207.0) -
プロセスのカレントディレクトリを dir に変更します。
...を dir に変更します。
ブロックとともに呼び出された時はブロック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby......]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # chdir(dir , options = {}) -> nil (9207.0) -
プロセスのカレントディレクトリを dir に変更します。
...を dir に変更します。
ブロックとともに呼び出された時はブロック終了後に
元のディレクトリに戻ります。
@param dir ディレクトリを指定します。
@param options :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby......]{
require 'fileutils'
FileUtils.cd('/', verbose: true) # chdir and report it
//}... -
FileUtils
. # mkdir(dir , options = {}) -> () (9207.0) -
ディレクトリ dir を作成します。
...リ dir を作成します。
@param dir 作成するディレクトリ。
@param options :mode, :noop, :verbose が指定できます。
c:FileUtils#options
//emlist[][ruby]{
require 'fileutils'
FileUtils.mkdir('test')
FileUtils.mkdir(%w( tmp data ))
FileUtils.mkdir('notexist', n...