392件ヒット
[1-100件を表示]
(0.046秒)
種類
- インスタンスメソッド (210)
- モジュール関数 (66)
- 特異メソッド (61)
- 文書 (44)
- 定数 (11)
ライブラリ
- ビルトイン (88)
- csv (44)
- openssl (11)
- rake (22)
- shell (48)
-
shell
/ builtin-command (6) -
shell
/ command-processor (48) -
shell
/ filter (48) -
webrick
/ config (11) - zlib (22)
クラス
- CSV (44)
- File (11)
-
OpenSSL
:: SSL :: SSLContext (11) - Shell (48)
-
Shell
:: Cat (6) -
Shell
:: CommandProcessor (48) -
Shell
:: Filter (48) -
Zlib
:: GzipWriter (22)
モジュール
- FileUtils (22)
-
GC
:: Profiler (11) - Kernel (44)
- Marshal (22)
-
WEBrick
:: Config (11)
検索結果
先頭5件
-
FileUtils
# sh(*cmd) {|result , status| . . . } (21231.0) -
与えられたコマンドを実行します。
...am cmd 引数の解釈に関しては Kernel.#exec を参照してください。
例:
sh %{ls -ltr}
sh 'ls', 'file with spaces'
# check exit status after command runs
sh %{grep pattern file} do |ok, res|
if ! ok
puts "pattern not found (status = #{res.exitstatus})"... -
File
# flock(operation) -> 0 | false (21162.0) -
ファイルをロックします。
...をロックします。
ロックを取得するまでブロックされます。
ロックの取得に成功した場合は 0 を返します。
File::LOCK_NB (ノンブロッキング) を指定すると、本来ならブロックされる場合に
ブロックされずに false を返すよう......以下の通りです。定数は File::Constants で定義されていますが、
File クラスの親クラスの IO が File::Constants をインクルードしているので、
これらの定数は File::LOCK_SH などとして参照可能です。
: LOCK_SH
共有ロック。複数のプ......ます。
File::LOCK_NB の指定がある場合、ブロックされる条件での
flock は false を返します。
「ブロックされる条件」とは以下のいずれかです。
* 他のプロセスが排他ロックをすでに行っている場合にロックを行う
* 他のプ... -
Zlib
:: GzipWriter # flush(flush = Zlib :: SYNC _ FLUSH) -> self (6336.0) -
まだ書き出されていないデータをフラッシュします。
...フラッシュします。
flush は Zlib::Deflate#deflate と同じです。
省略時は Zlib::SYNC_FLUSH が使用されます。
flush に Zlib::NO_FLUSH を指定することは無意味です。
@param flush Zlib::NO_FLUSH Zlib::SYNC_FLUSH Zlib::FULL_FLUSH などを指定します。
req......ase1
filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap(fw, Zlib::BEST_COMPRESSION){|gz|
gz.puts "fuga"
gz.puts "ugo"
}
p File.read(filename)
end
def case2
filename='hoge1.gz'
fw = File.open(filename, "w")
Zlib::GzipWriter.wrap......ts "fuga"
gz.flush
gz.puts "ugo\n"
gz.flush
}
p File.read(filename)
end
case1
#=> "\037\213\b\000p\257pH\002\003K+MO\344*M\317\347\002\000<\326\000\371\t\000\000\000"
case2
#=> "\037\213\b\000p\257pH\002\003J+MO\344\002\000\000\000\377\377*M\317\347\002\000\000\... -
WEBrick
:: Config :: FileHandler -> Hash (6212.0) -
WEBrick::HTTPServlet::FileHandler の設定のデフォルト値を保持したハッシュです。
...WEBrick::HTTPServlet::FileHandler の設定のデフォルト値を保持したハッシュです。
require 'webrick'
WEBrick::Config::FileHandler = {
:NondisclosureName => [".ht*", "*~"],
:FancyIndexing => false,
:HandlerTable => {},
:HandlerCallback =>......nil,
:DirectoryCallback => nil,
:FileCallback => nil,
:UserDir => nil, # e.g. "public_html"
:AcceptableLanguages => [] # ["en", "ja", ... ]
}
: :AcceptableLanguages
コンテンツの言語を選択するオプション。設定値は文字列の配列......含まれるAccept-Languageの内容がfrで、
かつ:AcceptableLanguagesには['ja', 'en']が設定されている場合、
WEBrick::HTTPServlet::FileHandlerは以下の順番でファイルを探す。
(1) index.html
(2) index.html.fr
(3) index.html.ja
(4) index.html.en
: :FancyIndexing... -
DOSISH 対応 (6150.0)
-
DOSISH 対応 ruby version 1.7 では、DOSISH対応(DOS/Windows のパス名の扱いに対する変 更)が含まれています。(現在の)変更点を以下に示します。
...DOSISH 対応
ruby version 1.7 では、DOSISH対応(DOS/Windows のパス名の扱いに対する変
更)が含まれています。(現在の)変更点を以下に示します。
なお、これらの変更は platform/mswin32 版、platform/mingw32
版の Ruby にのみあてはまります。......りあえずの目標として、
* \ も / と同様パスセパレータとして扱う
* マルチバイトパス名への対応("表" など 2 byte 目が 0x5c(`\') である文字を正しく扱う)
* UNC 対応(これ自体は1.6にも入っている)
* ドライブレター対応
への......議論が継続されています。
現時点では、Fileの各メソッドに対する\対応, マルチバイトパス名対応, UNC 対応が実装されています。13817, 14097
以下、各メソッドの挙動について...
: File.dirname
パスセパレータとして従来の/に... -
Marshal フォーマット (6042.0)
-
Marshal フォーマット フォーマットバージョン 4.8 を元に記述しています。
...Marshal フォーマット
フォーマットバージョン 4.8 を元に記述しています。
=== nil, true, false
それぞれ、'0', 'T', 'F' になります。
//emlist[][ruby]{
p Marshal.dump(nil).unpack1("x2 a*") # => "0"
p Marshal.dump(true).unpack1("x2 a*") # => "T"
p Marshal.dump......(false).unpack1("x2 a*") # => "F"
//}
Ruby 2.1 以前では、インスタンス変数を設定しても dump されません。
Ruby 2.2 以降は freeze されているので、インスタンス変数は設定できません。
=== Fixnum
'i' に続けて Fixnum を表すデータ構造が続......class Foo
end
p Marshal.dump(Foo).unpack("x2 a c a*") # => ["c", 8, "Foo"]
//}
//emlist[例 2: クラス/モジュールのインスタンス変数は dump されない][ruby]{
module Bar
@bar = 1
end
p Bar.instance_eval { @bar } # => 1
File.open('testfile', 'wb') do |f|
Marshal.dump(Bar, f)
en... -
Shell
# cat(*files) -> Shell :: Filter (3336.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...m files シェルコマンド cat に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (3336.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...m files シェルコマンド cat に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file... -
Shell
:: Filter # cat(*files) -> Shell :: Filter (3336.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...m files シェルコマンド cat に与えるファイル名を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file... -
Shell
:: Cat . new(sh , *filenames) (3302.0) -
@todo
@todo -
Shell
# echo(*strings) -> Shell :: Filter (3236.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}... -
Shell
:: CommandProcessor # echo(*strings) -> Shell :: Filter (3236.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...与える引数を文字列で指定します。
動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...