ライブラリ
- ビルトイン (277)
- csv (132)
- delegate (12)
- erb (24)
- json (12)
-
json
/ add / exception (12) -
minitest
/ unit (1) -
net
/ http (24) - optparse (84)
- rake (696)
-
rake
/ loaders / makefile (12) -
rake
/ packagetask (24) -
rake
/ testtask (12) - shell (12)
-
shell
/ command-processor (12) -
shell
/ filter (12) - strscan (96)
- tracer (24)
クラス
- CSV (132)
- Dir (12)
- ERB (24)
- Exception (44)
- File (24)
- IO (56)
- Method (12)
- Module (12)
-
Net
:: HTTPGenericRequest (24) - OptionParser (84)
-
Rake
:: Application (84) -
Rake
:: FileList (216) -
Rake
:: FileTask (24) -
Rake
:: InvocationChain (60) -
Rake
:: MakefileLoader (12) -
Rake
:: NameSpace (12) -
Rake
:: PackageTask (24) -
Rake
:: TaskArguments (72) - Shell (12)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (12) - StringScanner (84)
- TracePoint (24)
- Tracer (24)
モジュール
- JSON (12)
- Kernel (105)
-
MiniTest
:: Assertions (1) - Rake (36)
-
Rake
:: Cloneable (24) -
Rake
:: TaskManager (156)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (12)
- == (12)
-
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - Proc (12)
- Rubyの起動 (4)
- Ruby用語集 (12)
- SimpleDelegator (12)
- StringScanner (12)
- TestTask (12)
- [] (42)
-
add
_ row (12) - append (24)
- application (12)
- application= (12)
-
assert
_ send (1) -
backtrace
_ locations (12) -
body
_ stream (12) -
body
_ stream= (12) -
caller
_ locations (24) - clear (12)
-
clear
_ exclude (12) - clone (24)
-
const
_ source _ location (12) -
create
_ rule (12) -
current
_ scope (12) -
def
_ class (12) -
def
_ module (12) -
define
_ task (12) - delete (12)
- desc (12)
- dump (12)
- dup (24)
- egrep (12)
-
excluded
_ from _ list? (12) - existing (12)
- existing! (12)
- ext (12)
- fdatasync (12)
- filter (36)
- flush (12)
- gsub! (12)
- import (12)
-
in
_ namespace (12) - inspect (18)
- intern (12)
-
is
_ a? (12) -
kind
_ of? (12) - lambda (18)
-
last
_ comment (12) -
last
_ description (12) -
last
_ description= (12) - load (12)
- lookup (12)
- match? (12)
-
matched
_ size (12) - member? (12)
-
minitest
/ unit (1) - name (12)
- names (12)
- needed? (12)
-
net
/ smtp (12) - new (60)
-
new
_ scope (12) - on (24)
-
on
_ head (12) -
on
_ tail (12) - open (48)
-
original
_ dir (24) -
package
_ files (12) -
package
_ files= (12) - parse (24)
- parse! (12)
- path (12)
- pathmap (12)
- peek (12)
- peep (12)
- pointer= (12)
- pos= (12)
- proc (19)
-
program
_ name= (12) - puts (12)
- rake (12)
- rakefile (12)
- read (12)
- resolve (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
set
_ backtrace (12) - shell (6)
- sub! (12)
-
synthesize
_ file _ task (12) - tasks (12)
-
test
/ unit (1) -
to
_ a (24) -
to
_ ary (12) -
to
_ hash (12) -
to
_ json (12) -
to
_ s (30) -
top
_ level (12) -
top
_ level _ tasks (12) -
tty
_ output= (12) - unlink (12)
- unscan (12)
- warn (8)
-
with
_ defaults (12) - write (8)
- yaml (12)
-
yaml
/ store (12) - クラス/メソッドの定義 (12)
- プログラム・文・式 (12)
- リテラル (12)
- 手続きオブジェクトの挙動の詳細 (12)
- 演算子式 (12)
検索結果
先頭5件
- Kernel
. # test(cmd , file) -> bool | Time | Integer | nil - Kernel
. # test(cmd , file1 , file2) -> bool - Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil - Shell
:: CommandProcessor # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil - Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil
-
Kernel
. # test(cmd , file) -> bool | Time | Integer | nil (18130.0) -
単体のファイルでファイルテストを行います。
...me
: ?A
ファイルの最終アクセス時刻を返す -> Time
: ?C
ファイルの inode 変更時刻を返す -> Time
//emlist[例][ruby]{
IO.write("testfile", "test")
test("r", "testfile") # => true
test("s", "testfile") # => 4
test("M", "testfile") # => 2018-03-31 07:38:40 +0900
//}... -
Kernel
. # test(cmd , file1 , file2) -> bool (18130.0) -
2ファイル間のファイルテストを行います。
...イル1とファイル2が同一のファイルである
//emlist[例][ruby]{
IO.write("testfile1", "test1")
IO.write("testfile2", "test2")
%w(= < > -).each do |e|
result = test(e, "testfile1", "testfile2")
puts "#{e}: #{result}"
end
//}
# => =: true
# => <: false
# => >: false
# => -: false... -
Shell
# test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15135.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: CommandProcessor # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15135.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
Shell
:: Filter # test(command , file1 , file2 = nil) -> bool | Time | Integer | nil (15135.0) -
Kernel.#test や FileTest のメソッドに処理を委譲します。
...Kernel.#test や FileTest のメソッドに処理を委譲します。
@param command 数値、またはサイズが 1 の文字列の場合は Kernel.#test に処理委譲します。
2 文字以上の文字列の場合は FileTest のメソッドとして実行します。
@para......ell'
Shell.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e", "foo"] # => true
p sh[:exists?, "foo"] # => true
p sh["exists?", "foo"] # => true
@see Kernel.#test, FileTest... -
MiniTest
:: Assertions # assert _ send(array , message = nil) -> true (9100.0) -
引数から、式を取り出して評価した結果が真の場合、検査にパスしたことになります。
...します。
文字列か Proc を指定します。Proc である場合は Proc#call した
結果を使用します。
@raise MiniTest::Assertion 取り出した式が偽を返す場合に発生します。
例:
assert_send([%w[foo bar baz], :include?, 'baz'])... -
test
/ unit (6246.0) -
ユニットテストを行うためのライブラリです。
...参照してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある......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_ で始まる必要があります。テストメソッドが実行される前には setup メソッドが必ず
呼ばれます。実行されたあ... -
minitest
/ unit (6156.0) -
ユニットテストを行うためのライブラリです。
...ラリです。
=== 使い方
minitest/unit は以下のように使います。
テスト対象のソース (foo.rb) を用意します。
class Foo
def foo
"foo"
end
def bar
"foo"
end
end
次にユニットテスト (test_foo.rb) を書きます。
テストを......) の名前はすべて "test" で始まる必要があります。
テストメソッドが実行される前には setup メソッドが必ず実行されます。
テストメソッドが実行された後には teardown メソッドが必ず実行されます。
minitest/unit を Kernel.#requir......'minitest/unit'
require 'foo'
MiniTest::Unit.autorun
class TestFoo < MiniTest::Unit::TestCase
def setup
@foo = Foo.new
end
# teardown はあまり使わない
def teardown
@foo = nil
end
def test_foo
assert_equal "foo", @foo.foo
end... -
Rake
:: InvocationChain # append(task _ name) -> Rake :: InvocationChain (6118.0) -
与えられたタスク名を追加して新しい Rake::InvocationChain を返します。
...た場合に発生します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
invocation_chain= Rake::InvocationChain.new("task_a", Rake::InvocationChain::EMPTY)
invocation_chain.append("task_b") # => LL("task_b", "task_a")
end
//}... -
Rake
:: InvocationChain . append(task _ name , chain) -> Rake :: InvocationChain (6118.0) -
与えられたタスク名を第二引数の Rake::InvocationChain に追加します。
...e::InvocationChain のインスタンスを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
chain = Rake::InvocationChain::EMPTY
b = Rake::InvocationChain.append("task_a", chain)
b.to_s # => "TOP => task_a"
end
//}... -
Rake
:: TestTask (6078.0) -
ユニットテストを実行するためのタスクを作成するクラスです。
...:TestTask.new do |t|
t.libs << "test"
t.test_files = FileList['test/test*.rb']
t.verbose = true
end
以下に test ターゲットの使用例を示します。
例:
rake test # run tests normally
rake test TEST=just_one_file.rb # run just one test......file.
rake test TESTOPTS="-v" # run in verbose mode
rake test TESTOPTS="--runner=fox" # use the fox test runner... -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (882.0) -
1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))
...よくわかりません(^^;
class << Object
p [self.id, self]
class << self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[537742484, Class]
=> ruby 1.7.3 (2002-09......class << Object.new
class << self.superclass
p [self.id, self]
end
class << self
p [self.superclass.id, self.superclass]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]
[537771634, Class]
[5......# # derived from sample/test.rb
# a = *[]; p a # special case
# def f; yield; end; f {|a| p a} # add (warning)
# def r; return; end; a = r(); p a
# a = nil; p a
# def f; yield nil; end; f {|a| p a}
# def r; return nil; end; a = r(); p a
#... -
クラス/メソッドの定義 (576.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
...* defined
===[a:class] クラス定義
//emlist[例][ruby]{
class Foo < Super
def test
# ...
end
# ...
end
//}
文法:
class 識別子 [`<' superclass ]
式..
end
文法:
class 識別子 [`<' superclass ]
式..
[resc......ue [error_type,..] [=> evar] [then]
式..]..
[else
式..]
[ensure
式..]
end
クラスを定義します。クラス名はアルファベットの大文字で始まる識別子です。
rescue/ensure 節を指定し、例外処理....../emlist[][ruby]{
class Foo < Array
def foo
end
end
# 定義を追加(スーパークラス Array を明示的に指定しても同じ)
class Foo
def bar
end
end
# 間違ったスーパークラスを指定するとエラー
class Foo < String
end
# => superclass mismatch for class Foo (Typ...