ライブラリ
- ビルトイン (60)
- csv (24)
-
minitest
/ spec (1) -
minitest
/ unit (3) - nkf (12)
- rss (216)
- rubygems (12)
- strscan (48)
-
test
/ unit (1)
クラス
- CSV (24)
-
MiniTest
:: Unit (2) - Module (1)
-
RSS
:: Maker :: ChannelBase (24) -
RSS
:: Maker :: ChannelBase :: SkipDaysBase (12) -
RSS
:: Maker :: ChannelBase :: SkipDaysBase :: DayBase (24) -
RSS
:: Maker :: ChannelBase :: SkipHoursBase (12) -
RSS
:: Maker :: ChannelBase :: SkipHoursBase :: HourBase (24) -
RSS
:: Rss :: Channel (48) -
RSS
:: Rss :: SkipDays (36) -
RSS
:: Rss :: SkipHours (36) - StringScanner (48)
-
Thread
:: Backtrace :: Location (48)
モジュール
- Kernel (12)
-
MiniTest
:: Assertions (1) -
Test
:: Unit (1)
キーワード
- Location (12)
-
NEWS for Ruby 3
. 0 . 0 (5) - NKF (12)
-
absolute
_ path (12) -
base
_ label (12) - content (24)
- content= (24)
- day (12)
- day= (12)
- days (12)
- gem (12)
- hour (12)
- hour= (12)
- hours (12)
-
infect
_ with _ assertions (1) - inspect (12)
-
minitest
/ unit (1) - new (12)
-
new
_ day (12) -
new
_ hour (12) - puke (1)
-
ruby 1
. 8 . 4 feature (12) -
scan
_ full (12) -
search
_ full (12) -
setup
_ argv (1) - skipDays (24)
- skipDays= (12)
- skipHours (24)
- skipHours= (12)
-
skip
_ blanks? (12) -
skip
_ until (12) - skips= (1)
-
test
/ unit (1) -
to
_ s (12)
検索結果
先頭5件
-
CSV
. new(data , options = Hash . new) -> CSV (36.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...ingIO を渡してください。
@param data String か IO のインスタンスを指定します。
String のインスタンスを指定した場合、CSV#string を使用して
後からデータを取り出すことが出来ます。
@param options CSV をパースす......した場合はヘッダは変換されま
せん。
: :skip_blanks
真を指定すると、空行を読み飛ばします。
: :force_quotes
真を指定すると、全てのフィールドを作成時にクオートします。
: :skip_lines
指定した正規表現にマッチしたそれ......ぞれの行をコメントとして読み飛ばします。
@raise CSV::MalformedCSVError 不正な CSV をパースしようとしたときに発生します。
//emlist[例: ファイルの読み込み][ruby]{
require "csv"
users =<<-EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzu... -
StringScanner
# scan _ full(regexp , s , f) -> object (36.0) -
スキャンポインタの位置から regexp と文字列のマッチを試します。
...rue, false) は StringScanner#skip と同等。
* scan_full(regexp, false, true) は StringScanner#check と同等。
* scan_full(regexp, false, false) は StringScanner#match? と同等。
@param regexp マッチに用いる正規表現を指定します。
@param s true ならばスキ......ャンポインタを進めます。
false ならばスキャンポインタを進めません。
@param f true ならばマッチした部分文字列を返します。
false ならばマッチした部分文字列の長さを返します。
//emlist[例][ruby]{
require 'strscan......true, true) #=> "test"
p s.scan_full(/\s+/, false, true) #=> " "
p s.scan_full(/\s+/, true, false) #=> 1
p s.scan_full(/\w+/, false, false) #=> 6
p s.scan_full(/\w+/, true, true) #=> "string"
//}
@see StringScanner#scan StringScanner#skip StringScanner#check StringScanner#match?... -
StringScanner
# search _ full(regexp , s , f) -> object (36.0) -
regexp で指定された正規表現とマッチするまで文字列をスキャンします。
...se) は StringScanner#skip_until と同等。
* search_full(regexp, false, true) は StringScanner#check_until と同等。
* search_full(regexp, false, false) は StringScanner#exist? と同等。
@param regexp マッチに用いる正規表現を指定します。
@param s true ならば......スキャンポインタを進めます。
false ならばスキャンポインタを進めません。
@param f true ならばマッチした部分文字列を返します。
false ならばマッチした部分文字列の長さを返します。
//emlist[例][ruby]{
require 's......tringScanner.new('test string')
p s.search_full(/t/, true, true) #=> "t"
p s.search_full(/str/, false, true) #=> "est str"
p s.search_full(/string/, true, true) #=> "est string"
//}
@see StringScanner#scan_until StringScanner#skip_until StringScanner#check_until StringScanner#exist?... -
MiniTest
:: Unit # puke(klass , method _ name , exception) -> String (30.0) -
テストメソッドの実行結果が成功以外の場合に、その種類と理由を記録します。
...と理由を記録します。
@param klass テストクラスを指定します。
@param method_name テストメソッドの名前を指定します。
@param exception 例外クラスを指定します。
@return 与えられた例外クラスによって "Skip", "Failure", "Error" の... -
NEWS for Ruby 3
. 0 . 0 (24.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...rue` is used. 17104
* Magic comment `shareable_constant_value` added to freeze constants.
See {Magic Comments}[rdoc-ref:doc/syntax/comments.rdoc@Magic+Comments] for more details.
17273
* A {static analysis}[rdoc-label:label-Static+analysis] foundation is
introduced.
* {RBS}[rdo......et
* Add :connect_timeout to TCPSocket.new 17187
* Net::HTTP
* Net::HTTP#verify_hostname= and Net::HTTP#verify_hostname have been added to skip hostname verification. 16555
* Net::HTTP.get, Net::HTTP.get_response, and Net::HTTP.get_print can take the request headers as a Hash in the s......on uses only methods ending with `!`.
* Ractor compatible.
* Improved support for YAML. 8382
* Use officially discouraged. Read OpenStruct@Caveats section.
* Pathname
* Ractor compatible.
* Psych
* Update to Psych 3.3.0
* This version is Ractor compatible.
* Reline... -
Thread
:: Backtrace :: Location # absolute _ path -> String (24.0) -
self が表すフレームの絶対パスを返します。
...][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/foo.rb
//}
@see Thread::Backtrace::Location#path... -
Thread
:: Backtrace :: Location # base _ label -> String (24.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...されます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.base_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label... -
test
/ unit (24.0) -
ユニットテストを行うためのライブラリです。
...'
class TC_Foo < Test::Unit::TestCase
def setup
@obj = Foo.new
end
# def teardown
# end
def test_foo
assert_equal("foo", @obj.foo)
end
def test_bar
assert_equal("bar", @obj.bar)
end
end
テストを実行するには......test_bar(TC_Foo) [test_foo.rb:16]:
<"bar"> expected but was
<"foo">.
2 tests, 2 assertions, 1 failures, 0 errors, 0 skips
test_bar だけテストしたい場合は以下のようなオプションを与えます。
$ ruby test_foo.rb --name test_bar......test_bar(TC_Foo) [test_foo.rb:16]:
<"bar"> expected but was
<"foo">.
1 tests, 1 assertions, 1 failures, 0 errors, 0 skips
--name=test_barのような指定は行えません。
以下のようにすると help も表示されます。
$ ruby test_foo.rb --help... -
NKF (18.0)
-
nkf(Network Kanji code conversion Filter, https://osdn.net/projects/nkf/) を Ruby から使うためのモジュールです。
...れる記号は以下の通り
,.:;?!´`^_—/\|‘’“”()[]{}〈〉+−=<>$%#&*@
-Z1 X0208空白(いわゆる全角空白)を ASCII の空白に変換する
-Z2 X0208空白(いわゆる全角空白)を ASCII の空白2......E-BOM
UTF-8-MAC これは入力側にしか指定できません
--fb-{skip, html, xml, perl, java, subchar} 変換できなかった文字をどう取り扱うかを
指定します。デフォルトは --fb-skip です。
--prefix <escape character><target character>..
Shift_JIS......場合に<escape character>を付加します。<target character>は複数指定できます。
例えば、--prefix=\$@ とすると、Shift_JIS の 2 文字目に $ か @ が来たら、
その前に \ が挿入されます
--no-cp932ext CP932で拡張された文字を取り扱わな... -
Test
:: Unit . setup _ argv(original _ argv = ARGV) { |files| . . . } -> [String] (18.0) -
original_argvで指定されたオプションを解析して、テスト対象になるファイル をrequireします。
...を解析して、テスト対象になるファイル
をrequireします。
@param original_argv オプションを指定します。省略された場合は、
Object::ARGVが使用されます。
@raise ArgumentError 指定されたファイルが存在しない場合に......す。
: --ruby
ruby コマンドのパスを指定します。省略した場合は、RbConfig.ruby の値を使用します。
: -q, --hide-skip
スキップしたテストを表示しません。
: -I
ライブラリのロードパスに指定した値を追加します。
: --gc-str... -
Thread
:: Backtrace :: Location # inspect -> String (18.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...したオブジェクトを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/f... -
Thread
:: Backtrace :: Location # to _ s -> String (18.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:...