5258件ヒット
[1-100件を表示]
(0.133秒)
種類
ライブラリ
- ビルトイン (2900)
-
bigdecimal
/ util (7) - csv (84)
- erb (36)
-
fiddle
/ import (24) - json (144)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - monitor (12)
-
mutex
_ m (12) -
net
/ http (36) - objspace (48)
- openssl (996)
- optparse (192)
- pp (24)
- psych (31)
- rake (24)
-
rdoc
/ known _ classes (12) -
rexml
/ document (24) -
rexml
/ streamlistener (12) -
ripper
/ filter (12) -
rubygems
/ version (12) - set (27)
- thread (2)
- timeout (37)
- tsort (93)
- win32ole (36)
クラス
-
ARGF
. class (192) - Array (36)
- BasicObject (144)
- BigDecimal (12)
- CSV (84)
- Class (84)
- Complex (12)
- Data (6)
- Date (12)
- DateTime (12)
- Dir (72)
- ERB (36)
-
Enumerator
:: Lazy (18) - Exception (24)
- FalseClass (60)
- File (60)
-
Gem
:: Version (12) - Hash (55)
- IO (60)
- Integer (12)
-
JSON
:: Parser (24) -
JSON
:: State (24) - Method (213)
- Module (636)
-
Net
:: HTTP (12) -
Net
:: HTTPResponse (24) - NilClass (158)
- Object (480)
-
OpenSSL
:: ASN1 :: BMPString (24) -
OpenSSL
:: ASN1 :: BitString (24) -
OpenSSL
:: ASN1 :: Boolean (12) -
OpenSSL
:: ASN1 :: Enumerated (24) -
OpenSSL
:: ASN1 :: GeneralString (24) -
OpenSSL
:: ASN1 :: GeneralizedTime (24) -
OpenSSL
:: ASN1 :: GraphicString (24) -
OpenSSL
:: ASN1 :: IA5String (24) -
OpenSSL
:: ASN1 :: ISO64String (24) -
OpenSSL
:: ASN1 :: Integer (24) -
OpenSSL
:: ASN1 :: Null (12) -
OpenSSL
:: ASN1 :: NumericString (24) -
OpenSSL
:: ASN1 :: OctetString (24) -
OpenSSL
:: ASN1 :: PrintableString (24) -
OpenSSL
:: ASN1 :: Sequence (12) -
OpenSSL
:: ASN1 :: Set (24) -
OpenSSL
:: ASN1 :: T61String (24) -
OpenSSL
:: ASN1 :: UTCTime (24) -
OpenSSL
:: ASN1 :: UTF8String (24) -
OpenSSL
:: ASN1 :: UniversalString (24) -
OpenSSL
:: ASN1 :: VideotexString (24) - OptionParser (192)
-
REXML
:: CData (24) - Random (2)
- Range (24)
- Rational (12)
- Regexp (12)
-
RubyVM
:: InstructionSequence (12) - Set (12)
- Struct (60)
- Thread (36)
-
Thread
:: Backtrace :: Location (48) - Time (12)
- TracePoint (48)
- TrueClass (60)
- UnboundMethod (48)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (24)
モジュール
- Enumerable (120)
-
Fiddle
:: Importer (24) - JSON (36)
-
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (88)
- Marshal (24)
- ObjectSpace (144)
-
OpenSSL
:: ASN1 (504) - Psych (19)
- RDoc (12)
-
REXML
:: StreamListener (12) -
Rake
:: TaskManager (24) - TSort (93)
- Timeout (21)
キーワード
- ! (12)
- != (12)
- & (36)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- << (7)
- <=> (12)
- == (24)
- === (20)
- =~ (7)
- >> (7)
- ASN1 (12)
- BMPString (24)
- BasicObject (12)
- BitString (24)
- Boolean (12)
-
CODE
_ CLASS _ TO _ OBJ (12) - ConditionVariable (12)
- DEFAULT (2)
- Enumerated (24)
- FALSE (8)
- Filter (12)
- GeneralString (24)
- GeneralizedTime (24)
- GraphicString (24)
- IA5String (24)
- ISO64String (24)
- Integer (24)
-
KNOWN
_ CLASSES (12) - Location (12)
- Marshal フォーマット (12)
- Method (12)
- MonitorMixin (12)
-
Mutex
_ m (12) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 1 . 0 (4) - NIL (8)
- Null (12)
- NumericString (24)
- ObjectId (24)
- OctetString (24)
- PrintableString (24)
- Proxy (12)
- Requirement (12)
- Sequence (12)
- Set (24)
- String (12)
- T61String (24)
- TRUE (8)
- UTCTime (24)
- UTF8String (24)
- UnboundMethod (12)
- UniversalString (24)
- VideotexString (24)
- [] (48)
- ^ (36)
-
_ _ send _ _ (24) -
_ dump (12) -
_ load (12) -
absolute
_ path (12) - accept (24)
-
add
_ trace _ func (12) - allocate (12)
- ancestors (12)
-
append
_ features (12) - arity (24)
- attr (12)
-
attr
_ accessor (4) -
attr
_ reader (4) -
attr
_ writer (4) - autoload (24)
- autoload? (12)
- backtrace (12)
-
base
_ label (12) - bind (12)
- call (24)
-
callee
_ id (12) -
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - classify (12)
- clone (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ missing (12) -
const
_ source _ location (12) - constants (24)
-
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) -
create
_ id (12) -
create
_ id= (12) - decode (12)
-
def
_ class (12) -
def
_ module (12) -
default
_ event _ sources (12) - define (6)
-
define
_ finalizer (24) -
define
_ method (24) -
define
_ singleton _ method (24) -
define
_ task (12) -
defined
_ class (12) - display (12)
-
drb
/ extservm (12) - dump (24)
-
each
_ char (12) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ object (48) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) - eager (6)
- entitydecl (12)
- extend (12)
- fail (12)
- filename (12)
-
find
_ class _ path (12) -
for
_ fd (12) -
from
_ state (12) - getbyte (12)
- getc (12)
- gets (36)
- handler= (12)
- inherited (12)
- initialize (12)
-
initialize
_ copy (12) -
inplace
_ mode (12) -
inplace
_ mode= (12) - inspect (72)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variables (12) - intern (12)
-
internal
_ encoding (12) -
is
_ a? (12) -
json
_ creatable? (12) -
kind
_ of? (12) -
marshal
_ dump (12) -
marshal
_ load (12) - max (24)
- merge (24)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) -
method
_ removed (12) -
method
_ undefined (12) - methods (12)
- min (24)
-
minitest
/ unit (1) -
module
_ eval (24) -
module
_ exec (12) - name (24)
- nesting (12)
- new (672)
-
ole
_ classes (12) - on (144)
- open (144)
-
original
_ name (24) - owner (24)
- parameters (12)
- parse (12)
- path (24)
-
prepend
_ features (12) -
pretty
_ print (12) -
pretty
_ print _ cycle (12) - private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ class _ method (24) -
public
_ constant (12) -
public
_ method (12) -
public
_ method _ defined? (12) - raise (12)
- rationalize (24)
-
rb
_ class _ real (12) -
rb
_ define _ class _ under (12) - rdoc (12)
-
rdoc
/ parser / c (12) -
reachable
_ objects _ from (12) - read (24)
- readbyte (24)
- readchar (12)
- readlines (12)
- receiver (12)
- reject (24)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) - replace (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) -
rexml
/ parsers / streamparser (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
safe
_ load (19) - send (24)
-
set
_ trace _ func (24) -
singleton
_ class (12) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
sort
_ by (24) -
source
_ location (12) - stat (12)
-
strongly
_ connected _ components (12) - struct (12)
-
super
_ method (11) -
test
/ unit (1) - timeout (37)
-
to
_ a (36) -
to
_ ary (24) -
to
_ bn (12) -
to
_ c (12) -
to
_ d (7) -
to
_ f (12) -
to
_ h (31) -
to
_ hash (12) -
to
_ i (12) -
to
_ int (12) -
to
_ json (168) -
to
_ proc (24) -
to
_ r (12) -
to
_ regexp (12) -
to
_ s (96) -
to
_ set (24) -
to
_ str (12) -
trace
_ object _ allocations (12) - tracer (12)
- tsort (24)
-
tsort
_ each (23) - unbind (12)
-
undef
_ method (12) -
undefine
_ finalizer (12) - union (12)
- value (24)
- yaml (12)
-
yaml
_ tag (12) - | (36)
- パターンマッチ (12)
- リテラル (12)
- 制御構造 (12)
- 正規表現 (12)
- 演算子式 (12)
検索結果
-
tsort (26138.0)
-
tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
...tsort はトポロジカルソートと強連結成分に関するモジュールを提供します。
=== Example
//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
{1=>[2, 3],......=>[]}.tsort
#=> [3, 2, 1, 4]
{1=>[2], 2=>[3, 4], 3=>[2], 4=>[]}.strongly_connected_components
#=> [[4], [2, 3], [1]]
//}
=== より現実的な例
非常に単純な `make' に似たツールは以下のように実装できます。
//emlist[][ruby]{
require 'tsort'
class Make
def initialize......default = []
end
def rule(outputs, inputs=[], &block)
triple = [outputs, inputs, block]
outputs.each {|f| @dep[f] = [triple]}
@dep[triple] = inputs
end
def build(target)
each_strongly_connected_component_from(target) {|ns|
if ns.length != 1
fs = ns.delete_if {... -
test
/ unit (26078.0) -
ユニットテストを行うためのライブラリです。
... Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある訳ではありません。
Ruby......ています。
* Rubyのテスティングフレームワークの歴史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html
=== 使い方
Test::Unit は以下のように......(foo.rb)が必要です。
class Foo
def foo
"foo"
end
def bar
"foo"
end
end
次にユニットテスト(test_foo.rb)を書きます。テストを実行するメソッド(テストメソッド)の名前は
全て test_ で始まる必要があ... -
tracer (26018.0)
-
実行トレース出力をとる機能を提供します。
...す。
ruby -rtracer hoge.rb
もうひとつはソースからrequireする方法です。
require 'tracer'
とした後
Tracer.on
によりトレース出力を有効にします。
Tracer.off
によりトレース出力を無効にします。
また、ブロック付きで Tracer......# ruby 1.8 では警告がでますが、動作します。
require 'tracer'
class Hoge
def Hoge.fuga(i)
"fuga #{i}"
end
end
Tracer.add_filter {|event, file, line, id, binding, klass|
event =~ /line/ and klass.to_s =~ /hoge/i
}
Tracer.on
for i in 0..3
puts Ho......ge.fuga(i) if i % 3 == 0
end
Tracer.off
=== SEE ALSO
Kernel.#set_trace_func... -
Object
# class -> Class (21268.0) -
レシーバのクラスを返します。
...レシーバのクラスを返します。
//emlist[][ruby]{
p "ruby".class #=> String
p 100.class #=> Integer
p ARGV.class #=> Array
p self.class #=> Object
p Class.class #=> Class
p Kernel.class #=> Module
//}
@see Class#superclass,Object#kind_of?,Object#instance_of?... -
Class
# inherited(subclass) -> () (15242.0) -
クラスのサブクラスが定義された時、新しく生成されたサブクラスを引数 にインタプリタから呼び出されます。このメソッドが呼ばれるタイミングは クラス定義文の実行直前です。
...bclass プログラム内で新たに定義された自身のサブクラスです。
//emlist[例][ruby]{
class Foo
def Foo.inherited(subclass)
puts "class \"#{self}\" was inherited by \"#{subclass}\""
end
end
class Bar < Foo
puts "executing class body"
end
# => class "Foo" was inherite......d by "Bar"
# executing class body
//}... -
Class
# allocate -> object (15112.0) -
自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。
...ェクトは
自身のインスタンスであること以外には何も特性を持ちません。
//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end
def initialized?
@initialized || false
end
end
klass.allocate.initialized? #=> false
//}... -
Class
# json _ creatable? -> bool (15106.0) -
シリアライズされた JSON 形式の文字列から、インスタンスを作成するのにこのクラスを使用できる場合は 真を返します。そうでない場合は、偽を返します。
...ラスは json_create というメソッドを実装していなければなりません。
また json_create の第一引数は必要なデータを含むハッシュを期待しています。
//emlist[例][ruby]{
require "json"
String.json_creatable? # => true
Dir.json_creatable? # => fal... -
JSON
:: Generator :: GeneratorMethods :: FalseClass # to _ json(state _ or _ hash = nil) -> String (15106.0) -
自身から生成した JSON 形式の文字列を返します。
...state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
false.to... -
JSON
:: Generator :: GeneratorMethods :: NilClass # to _ json(state _ or _ hash = nil) -> String (15106.0) -
自身から生成した JSON 形式の文字列を返します。
...state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
nil.to_... -
JSON
:: Generator :: GeneratorMethods :: TrueClass # to _ json(state _ or _ hash = nil) -> String (15106.0) -
自身から生成した JSON 形式の文字列を返します。
...の文字列を返します。
"true" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を......指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//}...