るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

<< 1 2 > >>

CSV.filter(input, options = Hash.new) {|row| ... } (24245.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...全て output に書き込
みます。

@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param options ":i...
...":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $ echo "heade...
...; ruby test.rb in.csv

require "csv"

options = { headers: true, return_headers: true, write_headers: true }

CSV.filter(options) do |row|
if row.header_row?
row << "header3"
next
end
row << "row1_3"
end

# => header1,header2,header3
# row1_1,row1_2,row1_3
//}

//emlist[例: input, out...

CSV.filter(input, output, options = Hash.new) {|row| ... } (24245.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...全て output に書き込
みます。

@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param options ":i...
...":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $ echo "heade...
...; ruby test.rb in.csv

require "csv"

options = { headers: true, return_headers: true, write_headers: true }

CSV.filter(options) do |row|
if row.header_row?
row << "header3"
next
end
row << "row1_3"
end

# => header1,header2,header3
# row1_1,row1_2,row1_3
//}

//emlist[例: input, out...

CSV.filter(options = Hash.new) {|row| ... } (24245.0)

このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。

...全て output に書き込
みます。

@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。

@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。

@param options ":i...
...":out_", ":output_" で始まるキーは output にだけ適用されます。
それ以外のキーは両方に適用されます。
":output_row_sep" のデフォルト値は $/ です。

//emlist[例: input, output は初期値][ruby]{
# $ echo "heade...
...; ruby test.rb in.csv

require "csv"

options = { headers: true, return_headers: true, write_headers: true }

CSV.filter(options) do |row|
if row.header_row?
row << "header3"
next
end
row << "row1_3"
end

# => header1,header2,header3
# row1_1,row1_2,row1_3
//}

//emlist[例: input, out...

Ripper::Filter (12058.0)

イベントドリブンスタイルで Ruby プログラムを加工するためのクラスです。

... Ruby プログラムを加工するためのクラスです。

このクラスを継承して、必要なイベントに対応するメソッドを定義して使用し
ます。

=== 使用例

//emlist[][ruby]{
require 'ripper'
require 'cgi'

class Ruby2HTML < Ripper::Filter
def on_default(eve...
...nt, tok, f)
f << CGI.escapeHTML(tok)
end

def on_comment(tok, f)
f << %Q[<span class="comment">#{CGI.escapeHTML(tok)}</span>]
end

def on_tstring_beg(tok, f)
f << %Q[<span class="string">#{CGI.escapeHTML(tok)}]
end

def on_tstring_end(tok, f)
f << %Q[#{CGI.escapeHTML(tok)...
...}</span>]
end
end

Ruby
2HTML.new(ARGF).parse('')
//}

Ruby
プログラムを解析して、Ripper::SCANNER_EVENTS にあるスキャナ
イベントを実行します。イベントはプログラムに書いた順番で実行されます。

上記の例では、parse メソッドに渡した空...

ruby 1.6 feature (8665.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby 1.6 feature
ruby
version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...に戻りました。

p "#{ "" }"

=> ruby 1.6.7 (2002-03-01) [i586-linux]
""

=> -:1: warning: bad substitution in string
ruby
1.6.7 (2002-09-12) [i586-linux]
"#{ }"

=> ruby 1.6.7 (2002-09-25) [i586-linux]
""

これ...
...OWAT
SO_SNDLOWAT
SO_RCVTIMEO
SO_SNDTIMEO
SO_SECURITY_AUTHENTICATION
SO_SECURITY_ENCRYPTION_TRANSPORT
SO_SECURITY_ENCRYPTION_NETWORK
SO_BINDTODEVICE
SO_ATTACH_FILTER
SO_DETACH_FILTER
SO_PEERNAME
SO_TIMESTAMP

: ((<require|組み込み関数>)) / $LOAD_PATH...

絞り込み条件を変える

REXML::Text#to_s -> String (6231.0)

テキストの内容を正規化(すべての実体をエスケープ)された状態で返します。

...トとして妥当です。

結果は REXML::Text.new で指定した entity_filter を反映しています。

@see REXML::Text#value

//emlist[][ruby]{
require 'rexml/document'
t
= REXML::Text.new("< & foobar", false, nil, false)
t
.to_s # => "&lt; &amp; foobar"
t
.value # => "< & foobar"
//}...

Ripper::Filter#filename -> String (6217.0)

Ruby プログラムのファイル名を文字列で返します。

...
Ruby
プログラムのファイル名を文字列で返します。...

REXML::Text.unnormalize(string, doctype = nil, filter = nil, illegal = nil) -> String (3543.0)

string を非正規化(すべての entity をアンエスケープ)したものを 返します。

...string を非正規化(すべての entity をアンエスケープ)したものを
返します。

filter
でアンエスケープしない実体の実体名を文字列配列で指定します。

@param string 非正規化する文字列
@param doctype DTD(REXML::DocType オブジェクト)
@par...
...m filter アンエスケープしない実体の実体名(文字列配列)
@param illegal 内部用。使わないでください。

//emlist[][ruby]{
require 'rexml/text'
REXML::Text.unnormalize("&amp; &foobar; &lt;") # => "& &foobar; <"
REXML::Text.unnormalize("&lt; &gt;", nil, ["lt"]) # => "&lt;...

REXML::Text#value -> String (3231.0)

テキストの内容を非正規化(すべての実体をアンエスケープ)された状態で返します。

...

このメソッドの返り値では raw モードや entity_filter は無視されます。

@see REXML::Text#raw, REXML::Text#to_s

//emlist[][ruby]{
require 'rexml/document'
t
= REXML::Text.new("< & foobar", false, nil, false)
t
.to_s # => "&lt; &amp; foobar"
t
.value # => "< & foobar"
//}...
<< 1 2 > >>