るりまサーチ

最速Rubyリファレンスマニュアル検索!
189件ヒット [1-100件を表示] (0.062秒)

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file size
  4. file open
  5. file path

ライブラリ

キーワード

検索結果

<< 1 2 > >>

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"
}
}
}...
<< 1 2 > >>