別のキーワード
ライブラリ
クラス
- CGI (12)
- CSV (12)
- File (60)
- OptionParser (12)
- Pathname (12)
- Shell (24)
-
Shell
:: Filter (6)
モジュール
- Enumerable (12)
- Kernel (96)
キーワード
-
$ FIELD _ SEPARATOR (12) -
$ FS (12) -
$ INPUT _ RECORD _ SEPARATOR (12) -
$ OFS (12) -
$ ORS (12) -
$ OUTPUT _ FIELD _ SEPARATOR (12) -
$ OUTPUT _ RECORD _ SEPARATOR (12) -
$ RS (12) -
ALT
_ SEPARATOR (12) -
PATH
_ SEPARATOR (24) - SEPARATOR (12)
-
SEPARATOR
_ PAT (12) - Separator (12)
- chunk (12)
-
default
_ record _ separator (6) -
default
_ record _ separator= (6) - each (6)
- find (12)
- join (12)
- new (12)
-
record
_ separator (6) -
record
_ separator= (6) -
ruby 1
. 6 feature (12) - 正規表現 (12)
検索結果
先頭5件
-
正規表現 (30.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...al_Number)
* [:alpha:] 英字 (Letter | Mark)
* [:ascii:] ASCIIに含まれる文字 (0000 - 007F)
* [:blank:] スペースとタブ (Space_Separator | 0009)
* [:cntrl:] 制御文字 (Control | Format | Unassigned | Private_Use | Surrogate)
* [:digit:] 数字 (Decimal_Number)
* [:graph:]......ph:]] | Space_Separator)
* [:punct:] 句読点 (Connector_Punctuation | Dash_Punctuation | Close_Punctuation | Final_Punctuation | Initial_Punctuation | Other_Punctuation | Open_Punctuation)
* [:space:] 空白、改行、復帰 (Space_Separator | Line_Separator | Paragraph_Separator | 0009 | 000... -
File
. join(*item) -> String (28.0) -
File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。
...File::SEPARATORを間に入れて文字列を連結します。platform/DOSISH-supportで環境依存になる予定です。
@param item 連結したいディレクトリ名やファイル名を文字列(もしくは文字列を要素に持つ配列)で与えます。
文字列A......とBを連結する際に、Aの末尾の文字とBの先頭の文字がFile::SEPARATORであった場合には、
まずこれらを削除した上で改めてFile::SEPARATORを間に入れて連結します。
引数の中に配列がある場合は配列要素を再帰的... -
Enumerable
# chunk {|elt| . . . } -> Enumerator (12.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
...", 10896]
# ...
//}
さらにこのメソッドは以下の値を特別扱いします。
* ブロックの評価値が nil もしくは :_separator であった場合、
その要素を捨てます。チャンクはこの前後で区切られます。
* ブロックの評価値 :_alone......symbols beginning with an underscore are reserved
# 「.to_a」無しだと Enumerator を返すのみで例外は発生しない
//}
nil、 :_separator はある要素を無視したい場合に用います。
例として svn log の出力のハイフンの所で区切りたい場合を考え... -
Kernel
$ $ OFS -> String | nil (7.0) -
$, の別名
...$, の別名
require "English"
array = %w|hoge fuga ugo bar foo|
p array.join #=> "hogefugaugobarfoo"
$OUTPUT_FIELD_SEPARATOR = ","
p array.join #=> "hoge,fuga,ugo,bar,foo"... -
Kernel
$ $ ORS -> String | nil (7.0) -
$\ の別名
...$\ の別名
require "English"
print "hoge\nhuga\n"
$OUTPUT_RECORD_SEPARATOR = "\n"
print "fuge"
print "ugo"
# end of sample.rb
ruby sample.rb
hoge
huga
fuge
ugo... -
CSV
. new(data , options = Hash . new) -> CSV (6.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...und, +data+ is ARGF, Object::STDIN, Object::STDOUT, or
Object::STDERR, or the stream is only available for output, the default
$INPUT_RECORD_SEPARATOR ($/) is used. Obviously,
discovery takes a little time. Set manually if speed is important. Also
note that IO objects should be opened... -
Shell
:: Filter # each(rs = nil) -> () (6.0) -
フィルタの一行ずつをblockに渡します。
...行ずつをblockに渡します。
@param rs レコードセパレーターを表す文字列を指定します。
nil ならば、Shell.record_separatorの値が使用されます。
使用例
require 'shell'
sh = Shell.new
sh.cat("/etc/passwd").each { |line|
puts line
}... -
find (6.0)
-
ディレクトリ配下のファイルを探索するためのモジュールです。
.../usr/bin/env ruby
require "find"
# 他人が書き込み可能な危険なコマンドを探す
for dir in ENV['PATH'].split(File::PATH_SEPARATOR)
Find.find(dir) do |fpath|
if File.file?(fpath) and (File.stat(fpath).mode & 022) != 0
printf("file %s is writable from other...