るりまサーチ

最速Rubyリファレンスマニュアル検索!
105件ヒット [1-100件を表示] (0.137秒)
トップページ > クエリ:i[x] > クエリ:l[x] > クエリ:chomp![x]

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. $-l kernel

ライブラリ

キーワード

検索結果

<< 1 2 > >>

String#chomp!(rs = $/) -> self | nil (21336.0)

self の末尾から rs で指定する改行コードを取り除きます。 ただし rs が "\n" ($/ のデフォルト値) のときは、 実行環境によらず "\r", "\r\n", "\n" のすべてを改行コードとみなして取り除きます。

...self の末尾から rs で指定する改行コードを取り除きます。
ただし rs が "\n" ($/ のデフォルト値) のときは、
実行環境によらず "\r", "\r\n", "\n" のすべてを改行コードとみなして取り除きます。

rs に nil を指定した場合、この...
...@return chomp! は通常 self を返しますが、取り除く改行がなかった場合は nil を返します。

//emlist[例][ruby]{
buf = "string\n"
buf.chomp! # => nil
p buf # => "string"

$/ = "\n" # デフォルトと同じ
p "foo\r".chomp! # => "foo"
p "foo\r\n".chomp! # =>...
..."foo"
p "foo\n".chomp! # => "foo"
p "foo\n\r".chomp! # => "foo\n"

buf = "string\n"
buf.chomp!(nil) # => nil
p buf # => "string\n"

p "foo\r\n\n".chomp!("") # => "foo"
p "foo\n\r\n".chomp!("") # => "foo"
p "foo\n\r\r".chomp!("") # => nil
//}

@see String#chomp
@see String#chop!...
...".chomp! # => "foo"
p "foo\n\r".chomp! # => "foo\n"

buf = "string\n"
buf.chomp!(nil) # => nil
p buf # => "string\n"

p "foo\r\n\n".chomp!("") # => "foo"
p "foo\n\r\n".chomp!("") # => "foo"
p "foo\n\r\r".chomp!("") # => nil
//}

@see String#chomp
@see String#chop!
@see String#dele...

Zlib::GzipReader#lineno -> Integer (15324.0)

IO クラスの同名メソッドIO#linenoと同じです。

...IO クラスの同名メソッドIO#linenoと同じです。

但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。

gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッターに...
...ェックサムが
記録されています。GzipReader オブジェクトは、次の時に展開した
データとフッターの照合を行い、エラーがあった場合は
Zlib::GzipFile::NoFooter, Zlib::GzipFile::CRCError,
Zlib::GzipFile::LengthError 例外を発生させます。

* EO...
...require 'zlib'

=begin
# hoge.gz がない場合は下記で作成できる。
Zlib::GzipWriter.open('hoge.gz') { |gz|
gz.puts 'h'
gz.puts 'o'
gz.puts 'g'
gz.puts 'e'
}
=end

Zlib::GzipReader.open('hoge.gz') { |gz|
while l = gz.gets
l
.chomp!
printf "%s...

Zlib::GzipReader#lineno=(num) (15230.0)

IO クラスの同名メソッドIO#lineno=と同じです。

...IO クラスの同名メソッドIO#lineno=と同じです。

但し、gzip ファイル中に
エラーがあった場合 Zlib::Error 例外や
Zlib::GzipFile::Error 例外が発生します。

gzip ファイルのフッターの処理に注意して下さい。
gzip ファイルのフッター...
...ェックサムが
記録されています。GzipReader オブジェクトは、次の時に展開した
データとフッターの照合を行い、エラーがあった場合は
Zlib::GzipFile::NoFooter, Zlib::GzipFile::CRCError,
Zlib::GzipFile::LengthError 例外を発生させます。

* EO...
...ire 'zlib'

=begin
# hoge.gz がない場合は下記で作成できる。
Zlib::GzipWriter.open('hoge.gz') { |gz|
gz.puts 'h'
gz.puts 'o'
gz.puts 'g'
gz.puts 'e'
}
=end

Zlib::GzipReader.open('hoge.gz') { |gz|
while l = gz.gets
l
.chomp!
gz.lineno = 1000 i...

Shell::Filter#glob(pattern) -> Shell::Filter (9218.0)

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

...Filter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

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

@see Dir.[]...

Shell::Filter#cat(*files) -> Shell::Filter (6318.0)

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

...Filter オブジェクトを返します.

@param 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#tee(file) -> Shell::Filter (6318.0)

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

...る Filter オブジェクトを返します.

@param 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#glob(pattern) -> Shell::Filter (6218.0)

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

...Filter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

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

@see Dir.[]...

Shell::CommandProcessor#glob(pattern) -> Shell::Filter (6218.0)

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

...Filter オブジェクトを返します.

@param pattern シェルコマンド glob に与えるパターンを指定します。
パターンの書式については、Dir.[] を参照してください。

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

@see Dir.[]...

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

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

...ilter オブジェクトを返します.

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

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(fi...
...le).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

Shell#cat(*files) -> Shell::Filter (3318.0)

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

...Filter オブジェクトを返します.

@param 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#tee(file) -> Shell::Filter (3318.0)

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

...る Filter オブジェクトを返します.

@param 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#cat(*files) -> Shell::Filter (3318.0)

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

...Filter オブジェクトを返します.

@param 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#tee(file) -> Shell::Filter (3318.0)

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

...る Filter オブジェクトを返します.

@param 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#echo(*strings) -> Shell::Filter (3218.0)

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

...ilter オブジェクトを返します.

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

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(fi...
...le).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

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

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

...ilter オブジェクトを返します.

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

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(fi...
...le).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

絞り込み条件を変える

<< 1 2 > >>