別のキーワード
種類
- 特異メソッド (269)
- インスタンスメソッド (111)
- 文書 (60)
- モジュール関数 (44)
- ライブラリ (11)
ライブラリ
クラス
- CSV (165)
-
Encoding
:: Converter (33) - Exception (7)
-
Gem
:: RemoteFetcher (11) - Regexp (22)
- Thread (32)
モジュール
-
CGI
:: QueryExtension :: Value (22) - Enumerable (22)
- Open3 (44)
- OpenURI (22)
- Rake (22)
-
Rake
:: TaskManager (22)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - application (11)
- application= (11)
- compile (11)
- filter (33)
- first (11)
- generate (11)
- instance (22)
-
last
_ description (11) -
last
_ description= (11) -
last
_ error (11) - new (44)
- open (44)
-
open
_ uri (22) -
open
_ uri _ or _ path (11) - parse (22)
-
pipeline
_ r (22) -
pipeline
_ rw (22) - read (11)
- readlines (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (16) - rss (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
slice
_ before (22)
検索結果
先頭5件
- OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) {|sio| . . . } -> nil - Open3
. # pipeline _ rw(*cmds) -> [IO , IO , [Thread]] - ruby 1
. 8 . 3 feature - Gem
:: RemoteFetcher # open _ uri _ or _ path(uri , last _ modified = nil , head = false , depth = 0) -> StringIO | File - CSV
. new(data , options = Hash . new) -> CSV
-
OpenURI
. open _ uri(name , mode = & # 39;r& # 39; , perm = nil , options = {}) {|sio| . . . } -> nil (406.0) -
URI である文字列 name のリソースを取得して StringIO オブジェクト として返します。
...して StringIO オブジェクト
として返します。
ブロックを与えた場合は StringIO オブジェクトを引数としてブロックを
評価します。ブロックの終了時に StringIO は close されます。nil を返します。
require 'open-uri'
sio = OpenURI.ope.......com')
p sio.last_modified
puts sio.read
OpenURI.open_uri('http://www.example.com'){|sio| sio.read }
options には Hash を与えます。理解するハッシュの
キーは以下のシンボル、
* :proxy
* :progress_proc
* :content_length_proc
* :http_basic_authentication
* :proxy......_http_basic_authentication
* :read_timeout
* :ssl_ca_cert
* :ssl_verify_mode
* :ftp_active_mode
* :redirect
です。
「:content_length_proc」と「:progress_proc」はプログレスバーに
利用されることを想定しています。
require 'open-uri'
sio = OpenURI.open_uri('htt... -
Open3
. # pipeline _ rw(*cmds) -> [IO , IO , [Thread]] (405.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。
...options には Hash で指定します。
env には環境変数を Hash で指定します。
cmdname にはコマンド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。
(1) commandline
(2) [commandline, options]......(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]
@return ブロックを指定した場合はブロックの最後に評価された値を返します。
ブロックを指定しなかった場合は最初に実... -
ruby 1
. 8 . 3 feature (354.0) -
ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))
...]
: FileUtils.chown_R [lib] [new]
: FileUtils.commands [lib] [new]
: FileUtils.options [lib] [new]
: FileUtils.have_option? [lib] [new]
: FileUtils.options_of [lib] [new]
: FileUtils.collect_method [lib] [new]
追加。
: FileUtils.rm_r [l......供されます。
: net/http [lib] [new]
WebDAV のメソッドをサポートするようになりました。
PROPPATCH, LOCK, UNLOCK, OPTIONS, PROPFIND, DELETE, MOVE, COPY, MKCOL。
: Net::HTTPRequest#body_exist? [lib] [obsolete]
: Net::HTTPResponse#response [lib] [obsolete]
: Net::......p /[\c\\]/ =~ "\c\\"
p /\c\\/ =~ "\c\\"
$ ruby-1.8.2 r.rb
r.rb:1: premature end of regular expression: /[\c\\]/
r.rb:2: invalid regular expression; '\' can't be last character: /\c\\/
$ ruby-1.8.3 r.rb
0
0
=== 2005-06-30
: Delegator [lib] [compat]
Delegator... -
Gem
:: RemoteFetcher # open _ uri _ or _ path(uri , last _ modified = nil , head = false , depth = 0) -> StringIO | File (307.0) -
@param uri URI を指定します。
...@param uri URI を指定します。
@param last_modified 最終更新時刻を指定します。
@param head 真を指定するとヘッダ情報のみ取得します。
@param depth 現在のリダイレクト回数を指定します。
@raise Gem::RemoteFetcher::FetchError デフォルトで... -
CSV
. new(data , options = Hash . new) -> CSV (280.0) -
このメソッドは CSV ファイルを読み込んだり、書き出したりするために String か IO のインスタンスをラップします。
...このメソッドは CSV ファイルを読み込んだり、書き出したりするために
String か IO のインスタンスをラップします。
ラップされた文字列の先頭から読み込むことになります。
文字列に追記したい場合は CSV.generate を使用し......した StringIO を渡してください。
@param data String か IO のインスタンスを指定します。
String のインスタンスを指定した場合、CSV#string を使用して
後からデータを取り出すことが出来ます。
@param options CSV を......is used. Obviously,
discovery takes a little time. Set manually if speed is important. Also
note that IO objects should be opened in binary mode on Windows if this
feature will be used as the line-ending translation can cause
problems with resetting the document position to where it... -
CSV
. filter(input , options = Hash . new) {|row| . . . } (242.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...ます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。
@param options ":in_", ":input_" で始まるキ......期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; 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,hea......t = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
File.write('test.csv',content)
options = { headers: true, return_headers: true, write_headers: true }
CSV.filter(File.open("test.csv"), File.open("out.csv", "w"), options) do |row|
if row.h... -
CSV
. filter(input , output , options = Hash . new) {|row| . . . } (242.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...ます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。
@param options ":in_", ":input_" で始まるキ......期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; 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,hea......t = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
File.write('test.csv',content)
options = { headers: true, return_headers: true, write_headers: true }
CSV.filter(File.open("test.csv"), File.open("out.csv", "w"), options) do |row|
if row.h... -
CSV
. filter(options = Hash . new) {|row| . . . } (242.0) -
このメソッドは CSV データに対して Unix のツール群のようなフィルタを構築 するのに便利です。
...ます。
@param input String か IO のインスタンスを指定します。
デフォルトは ARGF です。
@param output String か IO のインスタンスを指定します。
デフォルトは $stdout です。
@param options ":in_", ":input_" で始まるキ......期値][ruby]{
# $ echo "header1,header2\nrow1_1,row1_2" > in.csv; 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,hea......t = <<EOS
id,first name,last name,age
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
File.write('test.csv',content)
options = { headers: true, return_headers: true, write_headers: true }
CSV.filter(File.open("test.csv"), File.open("out.csv", "w"), options) do |row|
if row.h... -
CSV
. instance(data = $ stdout , options = Hash . new) -> CSV (224.0) -
このメソッドは CSV.new のように CSV のインスタンスを返します。 しかし、返される値は Object#object_id と与えられたオプションを キーとしてキャッシュされます。
...ます。
@param data String か IO のインスタンスを指定します。
@param options CSV.new のオプションと同じオプションを指定できます。
//emlist[例][ruby]{
require "csv"
options = { headers: true }
text =<<-EOS
id,first name,last name,age
1,taro,tanaka,20
2,jir......o,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
csv = CSV.instance(text, options)
csv2 = CSV.instance(text, options)
csv.object_id == csv2.object_id # => true
print csv.read
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
//}
@see CSV.new... -
CSV
. instance(data = $ stdout , options = Hash . new) {|csv| . . . } -> object (224.0) -
このメソッドは CSV.new のように CSV のインスタンスを返します。 しかし、返される値は Object#object_id と与えられたオプションを キーとしてキャッシュされます。
...ます。
@param data String か IO のインスタンスを指定します。
@param options CSV.new のオプションと同じオプションを指定できます。
//emlist[例][ruby]{
require "csv"
options = { headers: true }
text =<<-EOS
id,first name,last name,age
1,taro,tanaka,20
2,jir......o,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS
csv = CSV.instance(text, options)
csv2 = CSV.instance(text, options)
csv.object_id == csv2.object_id # => true
print csv.read
# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adachi,21
//}
@see CSV.new...