ライブラリ
- ビルトイン (110)
- benchmark (11)
- fileutils (11)
-
rexml
/ document (55) -
rexml
/ streamlistener (11) - shell (78)
-
shell
/ command-processor (42) -
shell
/ filter (78) - win32ole (11)
クラス
-
Benchmark
:: Tms (11) - Dir (33)
-
File
:: Stat (11) -
REXML
:: DocType (33) -
REXML
:: NotationDecl (11) - Shell (78)
-
Shell
:: CommandProcessor (42) -
Shell
:: Filter (78) - SystemCallError (44)
- SystemExit (22)
-
WIN32OLE
_ TYPELIB (11)
モジュール
- FileUtils (11)
-
REXML
:: StreamListener (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - < (6)
- === (11)
- > (6)
- >> (6)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 6 . 0 (6) - NotationDecl (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
-
alias
_ command (6) - cat (18)
-
def
_ system _ command (6) - echo (18)
- entitydecl (11)
-
external
_ id (11) - glob (18)
-
install
_ system _ commands (6) - open (22)
- out (18)
- pipe? (11)
- public (11)
- rake (11)
- rdoc (11)
-
rexml
/ parsers / pullparser (11) -
rexml
/ parsers / sax2parser (11) -
rexml
/ parsers / streamparser (11) -
rexml
/ parsers / ultralightparser (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) - status (11)
-
system
_ path (6) - tee (18)
-
to
_ a (6) -
to
_ s (6) - transact (18)
- tsort (11)
-
unalias
_ command (6) -
undef
_ system _ command (6) - uptodate? (11)
- | (6)
- セキュリティモデル (11)
検索結果
先頭5件
-
Dir
. open(path , encoding: Encoding . find("filesystem")) -> Dir (3244.0) -
path に対するディレクトリストリームをオープンして返します。
...t[例: Dir.new][ruby]{
require 'tmpdir'
Dir.mktmpdir do |tmpdir|
d = Dir.new(tmpdir)
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
d.close
d = Dir.new(tmpdir, encoding: Encoding::UTF_8)
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
d.clos......r.mktmpdir do |tmpdir|
d = Dir.open(tmpdir, encoding: Encoding::UTF_8)
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
d.close
Dir.open(tmpdir, encoding: Encoding::UTF_8) do |d|
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
end
end
//}... -
Dir
. open(path , encoding: Encoding . find("filesystem")) {|dir| . . . } -> object (3244.0) -
path に対するディレクトリストリームをオープンして返します。
...t[例: Dir.new][ruby]{
require 'tmpdir'
Dir.mktmpdir do |tmpdir|
d = Dir.new(tmpdir)
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
d.close
d = Dir.new(tmpdir, encoding: Encoding::UTF_8)
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
d.clos......r.mktmpdir do |tmpdir|
d = Dir.open(tmpdir, encoding: Encoding::UTF_8)
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
d.close
Dir.open(tmpdir, encoding: Encoding::UTF_8) do |d|
p d.class # => Dir
p d.read.encoding # => #<Encoding:UTF-8>
end
end
//}... -
SystemExit
# status -> Integer (3112.0) -
例外オブジェクトに保存された終了ステータスを返します。
...します。
終了ステータスは Kernel.#exit や SystemExit.new などで設定されます。
例:
begin
exit 1
rescue SystemExit => err
p err.status # => 1
end
begin
raise SystemExit.new(1, "dummy exit")
rescue SystemExit => err
p err.status # => 1
end... -
SystemCallError
. ===(other) -> bool (3106.0) -
other が SystemCallError のサブクラスのインスタンスで、 かつ、other.errno の値が self::Errno と同じ場合に真を返します。そうでない場合は偽を返します。
...other が SystemCallError のサブクラスのインスタンスで、
かつ、other.errno の値が self::Errno と同じ場合に真を返します。そうでない場合は偽を返します。
従って、特に other が self.kind_of?(other) である場合には Module#=== と同様に真......を返します。
その他に、 Errno::EXXX::Errno == Errno::EYYY::Errno である場合にも Errno::EXXX == Errno::EYYY.new は真を返します。
エラー名は異なるがエラーコードは同じであるような Errno::EXXX 例外をまとめて捕捉するために Module#=== を上... -
rdoc (306.0)
-
RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。
...れば、'rdoc' コマンドでドキュメントが生成できます。
(Windows では 'rdoc.bat' です)
$ rdoc [options] [names...]
"rdoc --help" と打てば、最新のオプションに関する情報が得られます。
$ rdoc
このコマンドでカレントディレクトリ以......--charset オプションもありますが --encoding オプションを使用して
ください。
: --exclude pattern
pattern にマッチするディレクトリおよびファイルを処理の対象から取り除きます。
: --extension new=old
ファイル名の末尾が .new......。
: --quiet
処理進行メッセージを表示しません。
: --ri, --ri-site, and --ri-system
ri で読める出力を生成します。デフォルトでは --ri を指定すると
~/.rdoc に出力されますが、--ri-site で $datadir/ri/<ver>/site
に、--ri-system で $data... -
FileUtils
. # uptodate?(newer , older _ list , options = nil) -> bool (206.0) -
newer が、older_list に含まれるすべてのファイルより新しいとき真。 存在しないファイルは無限に古いとみなされます。
...
newer が、older_list に含まれるすべてのファイルより新しいとき真。
存在しないファイルは無限に古いとみなされます。
@param newer ファイルを一つ指定します。
@param older_list ファイル名の配列を指定します。
@param options ど......のようなオプションも指定することはできません。
@raise ArgumentError options にオプションを指定した場合に発生します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.uptodate?('hello.o', ['hello.c', 'hello.h']) or system('make')
//}... -
rake (198.0)
-
Rake というコマンドラインツールを扱うライブラリです。
...い方
$ rake --help
rake [-f rakefile] {options} targets...
Options are ...
-C, --classic-namespace トップレベルに Task, FileTask を定義します。
過去との互換性のためのオプションです。
-D, --describe [PATTE......--rules ルールの解決を追跡します。
-N, --no-search, --nosearch 親ディレクトリの Rakefile を検索しません。
-s, --silent --quiet に似ていますが、ディレクトリも表示しません。
-g, --system......oding: utf-8
task :hello do
puts 'do task hello!'
end
動的にタスクを定義する例:
# coding: utf-8
require 'rake/testtask'
require 'rake/clean' # clean, clobber の二つのタスクを定義
task :default => [:test]
1.upto(8) do |n|
Rake::TestTask.new("test_ste... -
REXML
:: StreamListener # entitydecl(content) -> () (184.0) -
DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。
...aid "He said %YN;">
<!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY open-hatch PUBLIC "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
<!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA......rs::StreamParser.new(xml, Listener.new).parse
# >> ["YN", "\"Yes\"", "%"]
# >> ["YN", "Yes", "%"]
# >> ["WhatHeSaid", "He said %YN;"]
# >> ["open-hatch", "SYSTEM", "http://www.textuality.com/boilerplate/OpenHatch.xml"]
# >> ["open-hatch", "PUBLIC", "-//Textuality//TEXT Standard open-hatch boilerplat......e//EN", "http://www.textuality.com/boilerplate/OpenHatch.xml"]
# >> ["hatch-pic", "SYSTEM", "../grafix/OpenHatch.gif", "gif"]
//}... -
Shell
. alias _ command(alias , command , *opts) { . . . } -> self (146.0) -
コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.
....def_system_command などであらかじめ作成します.
@param alias エイリアスの名前を文字列で指定します.
@param command コマンド名を文字列で指定します.
@param opts command で指定したコマンドのオプションを指定します.
使用例: ls -la |......sort -k 5 のような例。
require 'shell'
Shell.def_system_command("ls")
Shell.alias_command("lsla", "ls", "-a", "-l")
Shell.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}... -
REXML
:: DocType # public -> String | nil (142.0) -
DTD の公開識別子を返します。
...ent'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype.system # => "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype.public # => "-//W3C//DTD XHTML 1.0 Strict//EN......"
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE root SYSTEM "foobar">
EOS
doctype.system # => "foobar"
doctype.public # => nil
//}... -
REXML
:: DocType # external _ id -> String | nil (134.0) -
DTD が外部サブセットを用いている場合は "SYSTEM", "PUBLIC" の いずれかの文字列を返します。
...ットを用いている場合は "SYSTEM", "PUBLIC" の
いずれかの文字列を返します。
それ以外の場合は nil を返します。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"......"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
EOS
doctype.name # => "html"
doctype.external_id # => "PUBLIC"
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT books (book+)>
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDA...