種類
- インスタンスメソッド (145)
- 特異メソッド (22)
- 文書 (11)
- ライブラリ (11)
ライブラリ
- ビルトイン (89)
- shell (24)
-
shell
/ command-processor (24) -
shell
/ filter (30)
クラス
-
ARGF
. class (11) - Method (6)
- Proc (6)
-
RubyVM
:: InstructionSequence (66) - Shell (24)
-
Shell
:: CommandProcessor (24) -
Shell
:: Filter (30)
キーワード
-
absolute
_ path (11) -
base
_ label (11) - cat (18)
- compile (11)
- echo (18)
- glob (18)
- irb (11)
- label (11)
- new (11)
- path (11)
-
ruby 1
. 6 feature (11) - tee (18)
-
to
_ io (11)
検索結果
先頭5件
-
Method
# >>(callable) -> Proc (18130.0) -
self と引数を合成した Proc を返します。
...d(:f) >> method(:g)).call(3) # => 18
//}
//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = File.method(:read) >> WordScanner >> met......hod(:pp)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Proc
# >>(callable) -> Proc (18130.0) -
self と引数を合成した Proc を返します。
...(f >> g).call(3) # => 18
//}
//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = proc { |fname| File.read(fname) } >> WordScanner >>......method(:p)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Method#<<, Method#>>... -
Shell
:: Filter # >>(to) -> self (18118.0) -
toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。
...IOオブジェクトならばそれに出力します。
使用例
require 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> File.open("tail.out", "w") # でも同じ。
}... -
ruby 1
. 6 feature (192.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ったため、enq などを
呼び出したときスーパークラス Queue の enq が実行されていました。
: 2002-09-11: ((<tempfile/Tempfile#size>))
追加 ((<ruby-dev:17221>))
: 2002-09-09
mswin32 版と mingw32 版の ruby で、1.6.6の頃から ruby の子プロセスに......by-dev:18145>))
: 2002-08-20 File.expand_path
Cygwin 1.3.x ((<ruby-bugs-ja:PR#299>))
p File.expand_path('file', 'c:/')
=> ruby 1.6.7 (2002-03-01) [i586-linux]
/tmp/c:/file
=> ruby 1.6.7 (2002-08-21) [i586-linux]
c:/file
: 2002-08-19 Thread (win)......Fixnum#>>, <<
負の数に対して右シフトすると 0 になることがありました。
((<ruby-bugs-ja:PR#247>))
負の数を引数にした左シフト(つまり右シフト)も同様におかしな挙動をして
いました。((<ruby-bugs-ja:PR#248>))
p(-1 >> 31)... -
Shell
# tee(file) -> Shell :: Filter (137.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...am file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
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 # tee(file) -> Shell :: Filter (137.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...am file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
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
:: Filter # tee(file) -> Shell :: Filter (137.0) -
実行すると, それらを内容とする Filter オブジェクトを返します.
...am file シェルコマンドtee に与えるファイル名を文字列で指定します。
動作例
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
# cat(*files) -> Shell :: Filter (130.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......+ ".tee") >> "all.tee"
}
}
}... -
Shell
:: CommandProcessor # cat(*files) -> Shell :: Filter (130.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......+ ".tee") >> "all.tee"
}
}
}... -
Shell
:: Filter # cat(*files) -> Shell :: Filter (130.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......+ ".tee") >> "all.tee"
}
}
}... -
RubyVM
:: InstructionSequence . compile(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (126.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を文字列で指定します。
@param line 引数 source の 1 行目の行......かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (126.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を文字列で指定します。
@param line 引数 source の 1 行目の行......かで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
ARGF
. class # to _ io -> IO (34.0) -
ARGFが現在開いているファイルのFile、またはIOオブジェクトを 返します。
...ARGFが現在開いているファイルのFile、またはIOオブジェクトを
返します。
ARGF.to_io # => #<File:glark.txt>
ARGF.to_io # => #<IO:<STDIN>>
@see ARGF.class#file, ARGF.class#to_write_io... -
Shell
# echo(*strings) -> Shell :: Filter (30.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"
}
}
}...