種類
ライブラリ
クラス
-
ARGF
. class (84) -
Benchmark
:: Tms (12) -
DRb
:: ExtServManager (12) - IO (168)
- LoadError (12)
- Module (72)
- Object (84)
- String (84)
- StringIO (108)
-
Thread
:: Backtrace :: Location (12)
モジュール
- Kernel (1256)
- OpenURI (12)
-
OpenURI
:: OpenRead (12) -
Test
:: Unit (1) - URI (8)
キーワード
-
$ " (12) -
$ & (12) -
$ & # 39; (12) -
$ * (12) -
$ + (12) -
$ , (12) -
$ -0 (12) -
$ -F (12) -
$ -I (12) -
$ -i (12) -
$ / (12) -
$ 0 (12) -
$ 1 (12) -
$ 10 (12) -
$ 11 (12) -
$ 2 (12) -
$ 3 (12) -
$ 4 (12) -
$ 5 (12) -
$ 6 (12) -
$ 7 (12) -
$ 8 (12) -
$ 9 (12) -
$ : (12) -
$ ; (12) -
$ @ (12) -
$ ARGV (12) -
$ CFLAGS (12) -
$ ERROR _ POSITION (12) -
$ FIELD _ SEPARATOR (12) -
$ FILENAME (12) -
$ FS (12) -
$ INPUT _ RECORD _ SEPARATOR (12) -
$ LAST _ PAREN _ MATCH (12) -
$ LAST _ READ _ LINE (12) -
$ LDFLAGS (12) -
$ LOADED _ FEATURES (12) -
$ LOAD _ PATH (12) -
$ MATCH (12) -
$ OFS (12) -
$ ORS (12) -
$ OUTPUT _ FIELD _ SEPARATOR (12) -
$ OUTPUT _ RECORD _ SEPARATOR (12) -
$ POSTMATCH (12) -
$ PREMATCH (12) -
$ PROGRAM _ NAME (12) -
$ RS (12) -
$ \ (12) -
$ _ (12) -
$ ` (12) -
$ archdir (12) -
$ defs (12) -
$ hdrdir (12) -
$ libdir (12) -
$ libs (12) -
$ sitearchdir (12) -
$ sitelibdir (12) -
$ srcdir (12) -
$ topdir (12) - % (12)
- Complex (12)
- Float (12)
- Integer (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Rubyの起動 (12)
- Ruby用語集 (12)
- Scanf (6)
-
_ _ dir _ _ (12) - ` (12)
-
alias
_ method (12) -
arg
_ config (12) - autoload (24)
- autoload? (24)
- bigdecimal (12)
- binread (12)
- binwrite (12)
- caller (36)
-
cc
_ command (12) - chomp (12)
- chop (12)
- class (12)
- command (12)
-
const
_ defined? (12) -
cpp
_ command (12) -
create
_ header (12) -
create
_ tmpsrc (12) - desc (12)
-
dir
_ config (12) -
dummy
_ makefile (12) -
enable
_ config (24) -
find
_ executable (12) -
for
_ fd (12) - format (24)
- freeze (12)
- gets (48)
- gsub (36)
- hex (12)
- inspect (12)
- irb (12)
- libpathflag (12)
-
link
_ command (12) -
merge
_ libs (12) - method (12)
- new (24)
- oct (12)
- open (76)
-
open
_ uri (12) - path (12)
- pp (12)
- print (24)
- printf (12)
-
public
_ instance _ method (12) - putc (12)
- puts (12)
-
rb
_ String (12) -
rb
_ f _ string (12) - read (36)
- readline (48)
- readlines (48)
-
remove
_ const (12) - reopen (24)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) - scanf (24)
-
setup
_ argv (1) -
singleton
_ method (12) - sprintf (12)
- sprintf フォーマット (12)
- sub (24)
-
to
_ f (12) -
to
_ i (12) -
to
_ r (12) -
to
_ s (24) -
to
_ str (12) -
trace
_ var (36) - trap (24)
-
untrace
_ var (12) -
with
_ config (24) - write (24)
- このマニュアルのヘルプ (12)
- クラス/メソッドの定義 (12)
検索結果
先頭5件
-
Kernel
. # String(arg) -> String (39230.0) -
引数を文字列(String)に変換した結果を返します。
...引数を文字列(String)に変換した結果を返します。
arg.to_s を呼び出して文字列に変換します。
arg が文字列の場合、何もせず arg を返します。
@param arg 変換対象のオブジェクトです。
@raise TypeError to_s の返り値が文字列でなけ......れば発生します。
//emlist[例][ruby]{
class Foo
def to_s
"hogehoge"
end
end
arg = Foo.new
p String(arg) #=> "hogehoge"
//}
@see Object#to_s,String... -
Kernel
# dir _ config(target , idefault = nil , ldefault = nil) -> [String , String] (21202.0) -
configure オプション --with-TARGET-dir, --with-TARGET-include, --with-TARGET-lib をユーザが extconf.rb に指定できるようにします。
configure オプション
--with-TARGET-dir,
--with-TARGET-include,
--with-TARGET-lib
をユーザが extconf.rb に指定できるようにします。
--with-TARGET-dir オプションは
システム標準ではない、
ヘッダファイルやライブラリがあるディレクトリをまとめて指定するために使います。
ユーザが extconf.rb に --with-TARGET-dir=PATH を指定したときは
$CFLAGS に "-IPATH/include" を、
$LDFLAGS に "-LPATH/lib" を、
それぞれ追加し... -
Kernel
$ $ _ -> String | nil (21157.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
# create _ header(header = "extconf . h") -> String (21133.0) -
Kernel#have_func, Kernel#have_header などの検査結果を元に、 ヘッダファイルを生成します。
...
Kernel#have_func, Kernel#have_header などの検査結果を元に、
ヘッダファイルを生成します。
このメソッドは extconf.rb の最後で呼び出すようにしてください。
@param header ヘッダファイルの名前を指定します。
@return ヘッダファイ... -
Kernel
$ $ -F -> Regexp | String | nil (21130.0) -
String#split で引数を省略した場合の区切り文字です。
...
String#split で引数を省略した場合の区切り文字です。
Ruby 2.7からは nil 以外に変更することは非推奨になったため、
nil 以外を代入すると警告がでるようになりました。
nilを設定すると特殊な分割を行います。
詳細は String#......定した値です。
それ以外の時には初期値は nil です。
$; には任意のオブジェクトを代入できます。
ただし、String#split の仕様変更を考慮すると
常に正規表現を指定すべきです。
Ruby のバージョンによらず動作するプログラ... -
Kernel
$ $ ; -> Regexp | String | nil (21130.0) -
String#split で引数を省略した場合の区切り文字です。
...
String#split で引数を省略した場合の区切り文字です。
Ruby 2.7からは nil 以外に変更することは非推奨になったため、
nil 以外を代入すると警告がでるようになりました。
nilを設定すると特殊な分割を行います。
詳細は String#......定した値です。
それ以外の時には初期値は nil です。
$; には任意のオブジェクトを代入できます。
ただし、String#split の仕様変更を考慮すると
常に正規表現を指定すべきです。
Ruby のバージョンによらず動作するプログラ... -
Kernel
. # open(name , mode = & # 39;r& # 39; , perm = nil , options = {}) -> StringIO | Tempfile | IO (21130.0) -
name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
...name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。
name......イル名として扱われ、従来の
Kernel.#open(name, *rest) が呼ばれます。
ブロックを与えた場合は上の場合と同様、name が http:// や ftp:// で
始まっている文字列なら URI のリソースを取得した上で StringIO オブジェクト
または Tempfile......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... -
Kernel
. # autoload?(const _ name) -> String | nil (21129.0) -
const_name が Kernel.#autoload 設定されているか調べます。
...const_name が Kernel.#autoload 設定されているか調べます。
autoload 設定されていて、autoload 定数がまだ定義されてない(ロードされていない)
ときにそのパス名を返します。
autoload 設定されていないか、ロード済みなら nil を返し......ます。
@param const_name 定数をString または Symbol で指定します。
//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
class Bar
end
end
# ----- end of /tmp/foo.rb ----
class Foo
end
p Foo.autoload?(:Bar) #=> nil
Foo.autoload :Bar, '/tmp/foo'
p Foo.autoload?......(:Bar) #=> "/tmp/foo"
p Foo::Bar #=> Foo::Bar
p Foo.autoload?(:Bar) #=> nil
//}
@see Kernel.#autoload... -
Kernel
. # readlines(rs = $ / ) -> [String] (21129.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
. # `(command) -> String (21125.0) -
command を外部コマンドとして実行し、その標準出力を文字列として 返します。このメソッドは `command` の形式で呼ばれます。
...タスを得るには、$? を参照します。
コマンドの出力を得る必要がなく、単にコマンドを実行したいだけなら
Kernel.#system を使います。特に端末を制御するコマンドでは
`command` は失敗するかもしれません。
d:spec/literal#command......Errno::EXXX コマンドを実行できないときや失敗した場合に発生します。
//emlist[例][ruby]{
puts `ruby -v` #=> ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]
puts $?.inspect #=> #<Process::Status: pid=3580,exited(0)>
//}
@see Kernel.#system,Kernel.#exec,Kernel.#spawn...