30件ヒット
[1-30件を表示]
(0.030秒)
種類
- インスタンスメソッド (18)
- 文書 (12)
ライブラリ
- optparse (12)
-
shell
/ filter (6)
クラス
- OptionParser (12)
-
Shell
:: Filter (6)
キーワード
- each (6)
-
ruby 1
. 6 feature (12)
検索結果
-
OptionParser
# separator(sep) -> () (18131.0) -
サマリにオプションを区切るための文字列 sep を挿入します。 オプションにいくつかの種類がある場合に、サマリがわかりやすくなります。
...= "Usage: example.rb [options]"
opts.separator ""
opts.separator "Specific options:"
opts.on("-r", "--require LIBRARY") do |lib|
options.library << lib
end
opts.separator ""
opts.separator "Common options:"
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
//}... -
ruby 1
. 6 feature (114.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...以前までは $; が有効にな
るのは引数省略時だけでした。
$; = ":"
p "a:b:c".split(nil)
=> -:2:in `split': bad separator (ArgumentError)
from -:2
ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby 1.6.7 (2002-07-30) [i586-linux]
["a", "b",......シグナルを送らないと終了しない不具合が修正さ
れました。((<ruby-bugs-ja:PR#223>))
trap(:TERM, "EXIT")
END{
puts "exit"
}
Thread.start { Thread.stop }
sleep
: 2002-04-17: Regexp#inspect
((<ruby-bugs-ja:PR#222>))
p %r{\/}
=> ruby 1......-:3
: File::SEPARATOR
: File::ALT_SEPARATOR
: File::PATH_SEPARATOR
: RUBY_PLATFORM
: RUBY_RELEASE_DATE
: RUBY_VERSION
これらは、freeze された文字列になりました。
p File::SEPARATOR.frozen?
p File::ALT_SEPARATOR.frozen?
p File::PATH_SEPARATOR.frozen?... -
Shell
:: Filter # each(rs = nil) -> () (12.0) -
フィルタの一行ずつをblockに渡します。
...行ずつをblockに渡します。
@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。
使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}...