種類
ライブラリ
- English (22)
- ビルトイン (849)
- benchmark (11)
-
cgi
/ core (11) -
cgi
/ html (22) - continuation (11)
- coverage (7)
- csv (176)
- e2mmap (18)
-
fiddle
/ import (33) -
irb
/ cmd / nop (33) -
irb
/ extend-command (55) - json (121)
-
json
/ add / exception (11) - logger (1)
-
minitest
/ unit (1) - mkmf (66)
- monitor (22)
-
net
/ http (176) -
net
/ imap (33) - objspace (11)
- openssl (22)
- optparse (308)
- pstore (11)
- rake (209)
-
rake
/ packagetask (11) - rbconfig (11)
- readline (33)
- rexml (11)
-
rexml
/ streamlistener (11) -
ripper
/ filter (11) -
ripper
/ lexer (11) -
rubygems
/ dependency (22) -
rubygems
/ dependency _ installer (44) -
rubygems
/ dependency _ list (33) -
rubygems
/ exceptions (22) -
rubygems
/ installer (11) -
rubygems
/ specification (88) - singleton (11)
- socket (88)
- syslog (44)
- tempfile (20)
- thread (14)
- thwait (6)
- timeout (19)
- tracer (33)
- tsort (32)
-
webrick
/ httpproxy (11) -
webrick
/ httpservlet / abstract (66) -
win32
/ registry (33) - win32ole (77)
- zlib (55)
クラス
- Array (22)
- BasicObject (33)
- BasicSocket (33)
- CSV (176)
- Coverage (7)
- Data (2)
-
Encoding
:: Converter (44) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (11) - Exception (128)
- Fiber (5)
-
Gem
:: Dependency (22) -
Gem
:: DependencyInstaller (44) -
Gem
:: DependencyList (33) -
Gem
:: Installer (11) -
Gem
:: Specification (88) - IO (33)
-
IRB
:: ExtendCommand :: Nop (33) -
JSON
:: Parser (22) -
JSON
:: State (11) - Method (11)
- Module (128)
- Mutex (2)
-
Net
:: HTTP (143) -
Net
:: HTTPResponse (22) -
Net
:: IMAP (33) - Object (77)
-
OpenSSL
:: SSL :: SSLContext (22) - OptionParser (308)
- PStore (11)
-
Rake
:: Application (77) -
Rake
:: InvocationChain (55) -
Rake
:: InvocationChain :: EmptyInvocationChain (11) -
Rake
:: PackageTask (11) - Ripper (11)
-
RubyVM
:: InstructionSequence (88) - SignalException (22)
- StopIteration (11)
- Tempfile (20)
- Thread (22)
-
Thread
:: Backtrace :: Location (44) -
Thread
:: ConditionVariable (22) -
Thread
:: Mutex (9) -
Thread
:: Queue (11) -
Thread
:: SizedQueue (33) - ThreadsWait (6)
- TracePoint (17)
- Tracer (33)
- UDPSocket (11)
- UNIXServer (11)
-
WEBrick
:: HTTPProxyServer (11) -
WEBrick
:: HTTPServlet :: AbstractServlet (66) - WIN32OLE (11)
-
WIN32OLE
_ EVENT (44) -
WIN32OLE
_ TYPE (11) -
Zlib
:: Deflate (22) -
Zlib
:: GzipWriter (22) -
Zlib
:: Inflate (11)
モジュール
- Benchmark (11)
-
CGI
:: HtmlExtension (22) -
CGI
:: QueryExtension (11) - Exception2MessageMapper (18)
-
Fiddle
:: Importer (33) -
File
:: Constants (11) -
IRB
:: ContextExtender (22) -
IRB
:: ExtendCommandBundle (22) - JSON (44)
-
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) - Kernel (143)
-
MiniTest
:: Assertions (1) -
Net
:: HTTPExceptions (11) - ObjectSpace (11)
-
REXML
:: StreamListener (11) - Rake (22)
-
Rake
:: TaskManager (22) - RbConfig (11)
- Readline (33)
-
Socket
:: Constants (33) - Syslog (44)
- TSort (32)
- Timeout (19)
-
Win32
:: Registry :: Constants (33)
キーワード
-
$ ERROR _ INFO (11) -
$ ERROR _ POSITION (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - == (11)
- === (11)
- APPEND (11)
- Application (1)
- ConditionVariable (11)
- ContextExtender (11)
- Continuation (11)
-
DEFAULT
_ OPTIONS (11) - DependencyRemovalException (11)
- EndOfYAMLException (11)
- Extend (22)
- Fail (6)
- Filter (11)
-
IP
_ SENDSRCADDR (11) - Location (11)
-
MAKEFILE
_ CONFIG (11) -
MSG
_ COMPAT (11) -
MSG
_ SEND (11) - Monitor (11)
- MonitorMixin (11)
-
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
OVERRIDE
_ PRIVATE _ ONLY (11) - Options (11)
- ParseException (11)
-
REG
_ DWORD _ BIG _ ENDIAN (11) -
REG
_ DWORD _ LITTLE _ ENDIAN (11) -
REG
_ QWORD _ LITTLE _ ENDIAN (11) - Raise (6)
- Rubyの起動 (11)
- Singleton (11)
- UndefinedConversionError (11)
-
WIN32OLE
_ EVENT (11) -
absolute
_ path (22) - accept (22)
-
accept
_ nonblock (11) -
add
_ dependency (11) -
add
_ development _ dependency (11) -
add
_ response _ handler (22) -
add
_ runtime _ dependency (11) - append (44)
- application (11)
- application= (11)
-
assert
_ send (1) - autoload (22)
- autoload? (11)
- backtrace (11)
-
backtrace
_ locations (11) -
base
_ label (22) - benchmark (11)
- bind (11)
- broadcast (11)
-
ca
_ file= (11) -
caller
_ locations (22) - cause (11)
- cgi (11)
-
cgi
/ session (11) -
check
_ circular? (11) - clone (11)
-
completion
_ append _ character (11) -
completion
_ append _ character= (11) -
completion
_ proc= (11) -
const
_ defined? (11) -
const
_ get (11) -
const
_ load (11) -
const
_ missing (11) -
const
_ source _ location (5) - constants (11)
- convert (22)
- create (20)
-
create
_ id (11) -
deconstruct
_ keys (2) -
def
_ extend _ command (11) -
default
_ event _ sources (11) -
define
_ singleton _ method (22) - deflate (11)
- dependencies (11)
-
dependency
_ order (11) -
dependent
_ gems (11) - deq (11)
- desc (11)
-
development
_ dependencies (11) - disasm (11)
- disassemble (11)
-
do
_ DELETE (11) -
do
_ GET (11) -
do
_ HEAD (11) -
do
_ OPTIONS (11) -
do
_ POST (11) -
do
_ PUT (11) - dump (11)
- dup (11)
-
each
_ strongly _ connected _ component (11) -
each
_ strongly _ connected _ component _ from (21) -
enable
_ config (22) - entitydecl (11)
-
error
_ bytes (11) -
error
_ char (11) - exception (22)
- execute (11)
-
extend
_ object (6) - extern (11)
- fetch (11)
-
field
_ size _ limit (11) - filter (33)
-
find
_ name (11) -
find
_ spec _ by _ name _ and _ version (11) -
first
_ lineno (11) - generate (22)
- get (22)
- get2 (22)
-
handle
_ interrupt (11) - handler= (11)
-
header
_ convert (22) - help (11)
- html (22)
-
incomplete
_ input? (11) - inspect (22)
- install (11)
-
install
_ extend _ commands (11) -
installation
_ satisfies _ dependency? (11) -
instruction
_ sequence (6) - irb (11)
-
irb
_ context (22) -
json
_ create (11) - label (11)
-
last
_ description (11) -
last
_ description= (11) - lex (11)
- load (11)
- member? (11)
-
module
_ function (19) - multipart? (11)
- name (11)
- new (99)
-
next
_ wait (6) - of (11)
-
on
_ event (11) -
on
_ event _ with _ outargs (11) -
on
_ head (11) -
on
_ tail (11) - open (66)
- open! (11)
-
original
_ dir (11) - parse (44)
- parse! (11)
- path (11)
-
pending
_ interrupt? (11) - pop (11)
- post (22)
- post2 (22)
-
primitive
_ convert (44) -
private
_ constant (11) -
program
_ name (11) -
program
_ name= (11) -
public
_ constant (11) - raise (5)
-
raised
_ exception (11) -
rake
_ extension (11) - rakefile (11)
-
rb
_ gc _ mark _ locations (11) - rdoc (11)
-
rdoc
/ generator / json _ index (11) -
read
_ body (11) -
recvfrom
_ nonblock (11) - recvmsg (11)
- reject (22)
- release (11)
-
remove
_ by _ name (11) -
renegotiation
_ cb= (11) - reopen (11)
-
request
_ get (22) -
request
_ post (22) -
respond
_ to? (11) -
respond
_ to _ missing? (11) - response (11)
- result (11)
-
rinda
/ rinda (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby2
_ keywords (5) -
rubygems
/ specification (11) -
runtime
_ dependencies (11) -
satisfies
_ requirement? (11) - seek (11)
-
send
_ request (11) - sendmsg (11)
-
sendmsg
_ nonblock (11) - separator (11)
-
set
_ backtrace (11) -
set
_ dictionary (22) -
set
_ get _ line _ procs (22) - shift (22)
- signal (11)
- signm (11)
- signo (11)
-
singleton
_ class? (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - source (11)
-
source
_ location (11) - start (7)
- summarize (22)
-
summary
_ indent (11) -
summary
_ indent= (11) -
summary
_ width (11) -
summary
_ width= (11) - synchronize (11)
-
test
/ unit (1) - timeout (19)
-
to
_ a (11) -
to
_ json (22) -
to
_ s (44) -
top
_ level (11) -
top
_ level _ tasks (11) -
trace
_ object _ allocations (11) - tracer (11)
- transaction (11)
-
try
_ convert (11) -
try
_ link (22) - tsort (11)
-
tty
_ output= (11) - union (11)
- unparse (11)
- value (11)
- ver (11)
-
version
_ requirements (11) -
version
_ requirements= (11) -
with
_ config (22) - wrap (22)
- 制御構造 (11)
検索結果
先頭5件
-
irb (26186.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......$ irb
irb(main):001:0>
あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。
irb(main):001:0> 1+2
3
irb(main):002:0> class Foo
irb(main):003:1> def foo
irb(main):004:2> print 1
irb(main):005:2> end
irb(main):006:1> end......は readline ライブラリにも対応しています。
readline ライブラリがインストールされている時には
自動的にコマンドライン編集や履歴の機能が使えるようになります。
=== irb のコマンドラインオプション
irb [options] file_name o... -
Rake
:: InvocationChain :: EmptyInvocationChain # append(task _ name) -> Rake :: InvocationChain (24400.0) -
与えられた値を追加した Rake::InvocationChain を返します。
...与えられた値を追加した Rake::InvocationChain を返します。
@param task_name 追加する値を指定します。... -
Gem
:: Installer # installation _ satisfies _ dependency?(dependency) -> bool (21400.0) -
登録されているソースインデックスが与えられた依存関係を 満たすことができる場合は、真を返します。そうでない場合は偽を返します。
...登録されているソースインデックスが与えられた依存関係を
満たすことができる場合は、真を返します。そうでない場合は偽を返します。
@param dependency Gem::Dependency のインスタンスを指定します。... -
Encoding
:: UndefinedConversionError (21006.0) -
エンコーディング変換後の文字が存在しない場合に発生する例外。
...UTF-8 にしかない文字を EUC-JP に変換しようとした場合などに発生します。
//emlist[例][ruby]{
"\u2603".encode(Encoding::EUC_JP)
#=> Encoding::UndefinedConversionError: U+2603 from UTF-8 to EUC-JP
//}
変換が多段階でなされ、その途中で例外が生じた場......//emlist[例][ruby]{
ec = Encoding::Converter.new("ISO-8859-1", "EUC-JP")
# ISO-8859-1 -> UTF-8 -> EUC-JP
begin
ec.convert("\xa0")
# NO-BREAK SPACE, which is available in UTF-8 but not in EUC-JP.
rescue Encoding::UndefinedConversionError
p $!.source_encoding #=> #<Encoding:UTF-8......>
p $!.destination_encoding #=> #<Encoding:EUC-JP>
p $!.source_encoding_name #=> "UTF-8"
p $!.destination_encoding_name #=> "EUC-JP"
puts $!.error_char.dump #=> "\u{a0}"
p $!.error_char.encoding #=> #<Encoding:UTF-8>
end
//}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (18418.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if D......00, month, -1).day == 31
raise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `ge......t_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
TSort
# each _ strongly _ connected _ component {|nodes| . . . } -> nil (18412.0) -
TSort#strongly_connected_components メソッドのイテレータ版です。 obj.each_strongly_connected_component は obj.strongly_connected_components.each に似ていますが、 ブロックの評価中に obj が変更された場合は予期しない結果になる ことがあります。
...TSort#strongly_connected_components メソッドのイテレータ版です。
obj.each_strongly_connected_component は
obj.strongly_connected_components.each に似ていますが、
ブロックの評価中に obj が変更された場合は予期しない結果になる
ことがあります。......each_strongly_connected_component は nil を返します。
//emlist[使用例][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &block)
fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.e......ach_strongly_connected_component{|nodes|
p nodes
}
#出力
#=> [4]
#=> [2, 3]
#=> [1]
//}
@see TSort.each_strongly_connected_component... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) -> Enumerator (18412.0) -
node から到達可能な強連結成分についてのイテレータです。
...each_strongly_connected_component_from は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &bloc......fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}
#出力......#=> [4]
#=> 4 -> 4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=> 1 -> 2,3
#=> 1 -> 1
//}
@see TSort.each_strongly_connected_component_from... -
TSort
# each _ strongly _ connected _ component _ from(node , id _ map={} , stack=[]) {|nodes| . . . } -> () (18412.0) -
node から到達可能な強連結成分についてのイテレータです。
...each_strongly_connected_component_from は
tsort_each_node を呼びません。
@param node ノードを指定します。
//emlist[例 到達可能なノードを表示する][ruby]{
require 'tsort'
class Hash
include TSort
alias tsort_each_node each_key
def tsort_each_child(node, &bloc......fetch(node).each(&block)
end
end
non_sort = {1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}
non_sort.each_strongly_connected_component{|nodes|
p nodes
nodes.each {|node|
non_sort.each_strongly_connected_component_from(node){|ns|
printf("%s -> %s\n", node, ns.join(","))
}
}
}
#出力......#=> [4]
#=> 4 -> 4
#=> [2, 3]
#=> 2 -> 4
#=> 2 -> 2,3
#=> 3 -> 4
#=> 3 -> 3,2
#=> [1]
#=> 1 -> 4
#=> 1 -> 2,3
#=> 1 -> 1
//}
@see TSort.each_strongly_connected_component_from... -
Exception
# exception(error _ message) -> Exception (18406.0) -
引数を指定しない場合は self を返します。引数を指定した場合 自身のコピー を生成し Exception#message 属性を error_message にして返します。
...Exception#message 属性を error_message にして返します。
Kernel.#raise は、実質的に、例外オブジェクトの exception
メソッドの呼び出しです。
@param error_message エラーメッセージを表す文字列を指定します。
//emlist[例][ruby]{
begin
# .........# 何か処理
rescue => e
raise e.exception("an error occurs during hogehoge process") # 詳しいエラーメッセージ
end
//}... -
IRB
:: ExtendCommand :: Nop # irb _ context -> IRB :: Context (18400.0) -
irb の現在の設定(IRB::Context)を返します。
...
irb の現在の設定(IRB::Context)を返します。...