るりまサーチ

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

別のキーワード

  1. _builtin |
  2. set |
  3. ipaddr |
  4. array |
  5. integer |

クラス

キーワード

検索結果

<< 1 2 3 > >>

Shell#echo(*strings) -> Shell::Filter (18144.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...s シェルコマンド echo に与える引数を文字列で指定します。

動作例
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") >>...

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (18144.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...s シェルコマンド echo に与える引数を文字列で指定します。

動作例
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") >>...

Shell::Filter#echo(*strings) -> Shell::Filter (18144.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...s シェルコマンド echo に与える引数を文字列で指定します。

動作例
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") >>...

IO#noecho {|io| ... } -> object (6202.0)

文字入力時のエコーバックを無効に設定してブロックを評価します。

...す。ブロックを評価した結果を返します。

以下の例では、標準入力からエコーバックなしで文字列を一行読み込みます。

require "io/console"
STDIN.noecho(&:gets)

@raise LocalJumpError ブロックを指定しなかった場合に発生します。...

Shell::Echo#each(rs = nil) {|str| ... } (3102.0)

@todo

@todo

絞り込み条件を変える

ARGF.class#gets(limit) -> String | nil (128.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "...
...line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@s...

ARGF.class#gets(limit, chomp: false) -> String | nil (128.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "...
...line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@s...

ARGF.class#gets(rs = $/) -> String | nil (128.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "...
...line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@s...

ARGF.class#gets(rs = $/, chomp: false) -> String | nil (128.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "...
...line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@s...

ARGF.class#gets(rs, limit) -> String | nil (128.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "...
...line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@s...

絞り込み条件を変える

ARGF.class#gets(rs, limit, chomp: false) -> String | nil (128.0)

ARGFの現在位置から一行ずつ文字列として読み込みます。EOF に到達した時に は nil を返します。

...# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets # => "line1\n"

例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets(2) # => "li"

例:
# $ echo "...
...line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("e") # => "line"


例:
# $ echo "line1\nline2\nline3\n\nline4\n" > test.txt
# $ ruby test.rb test.txt

# test.rb
ARGF.gets("") # => "line1\nline2\nline3\n\n"

@s...

ARGF.class#inplace_mode -> String | nil (126.0)

c:ARGF#inplace で書き換えるファイルのバックアップに付加される拡 張子を返します。拡張子が設定されていない場合は空文字列を返します。イン プレースモードでない場合は nil を返します。

...ます。

例:
# $ echo "test" > test.txt
# $ ruby -i.bak test.rb test.txt
# $ cat test.txt # => "TEST"
# $ cat test.txt.bak # => "test"

# test.rb
ARGF.inplace_mode # => ".bak"
ARGF.each_line {|e|print e.upcase} # => "TEST"

例:
# $ echo "test" > test.txt
# $...
...ruby test.rb test.txt
# $ cat test.txt # => "test"

# test.rb
ARGF.inplace_mode # => nil
ARGF.each_line {|e|print e.upcase} # => "TEST"

@see d:spec/rubycmd#cmd_option, ARGF.class#inplace_mode=...

ARGF.class#each_char { |c| ... } -> self (121.0)

レシーバに含まれる文字を一文字ずつブロックに渡して評価します。

...ェクトを生成し
て返します。

例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_char # => #<Enumerator: ARGF:each_char>
ARGF.each_char{|e|p e}

# => "l"
# "i"
# "n"
# "e"
#...

ARGF.class#each_codepoint { |c| ... } -> self (121.0)

self の各コードポイントに対して繰り返しブロックを呼びだします。

...Enumerator を返します。

例:
# $ echo "line1\n" > test1.txt
# $ echo "line2\n" > test2.txt
# $ ruby test.rb test1.txt test2.txt

# test.rb
ARGF.each_codepoint # => #<Enumerator: ARGF:each_codepoint>
ARGF.each_codepoint{|e|print e, ","} # => 108,105,110,101,49,10,1...
<< 1 2 3 > >>