るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

検索結果

<< 1 2 3 ... > >>

Net::HTTP#get(path, header = nil, dest = nil) -> Net::HTTPResponse (18269.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...て順次
「dest << ボディの断片」を実行します。

@
param path 取得するエンティティのパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。
@
param dest 利用しないでください。

1.1 互換モード...
...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'...
..., nil) do |str|
f.write str
end
}
//}

@
see Net::HTTP#request_get...

Net::HTTP#get(path, header = nil, dest = nil) {|body_segment| .... } -> Net::HTTPResponse (18269.0)

サーバ上の path にあるエンティティを取得し、 Net::HTTPResponse のインスタンスとして返します。

...て順次
「dest << ボディの断片」を実行します。

@
param path 取得するエンティティのパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。
@
param dest 利用しないでください。

1.1 互換モード...
...ist[例][ruby]{
# net/http version 1.1
response, body = http.get( '/index.html' )

# net/http version 1.2
response = http.get('/index.html')

# compatible in both version
response , = http.get('/index.html')
response.body

# compatible, using block
File.open('save.txt', 'w') {|f|
http.get('/~foo/'...
..., nil) do |str|
f.write str
end
}
//}

@
see Net::HTTP#request_get...

OptionParser::Arguable#getopts(short_opt, *long_opt) -> Hash (6279.0)

指定された short_opt や long_opt に応じて自身をパースし、結果を Hash として返します。

...返します。

コマンドラインに - もしくは -- を指定した場合、それ以降の解析を行ないません。

@
param short_opt ショートネームのオプション(-f や -fx)を文字列で指定します。オプションが -f と -x の
2つの場合は "...
...を指定します。
オプションが引数をとる場合は直後に ":" を付けます。

@
param long_opt ロングネームのオプション(--version や --bufsize=512)を文字列で指定をします。
オプションが引数をとる場合は後ろに...
...

@
raise OptionParser::ParseError 自身のパースに失敗した場合、発生します。
実際は OptionParser::ParseError のサブク
ラスの例外になります。

//emlist[t.rb][ruby]{
require 'optparse'
params = ARGV.get...

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

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

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

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

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

例:
#...
...$ 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...

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

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

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

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

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

例:
#...
...$ 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...

絞り込み条件を変える

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

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

...返します。

@
param rs 行の区切りを文字列で指定します。rs に nil を指定すると行区切
りなしとみなします。空文字列 "" を指定すると連続する改行を行
の区切りとみなします(パラグラフモード)。

@
param limit 最...
...大の読み込みバイト数

@
param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

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

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

例:
#...
...$ 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...

Net::HTTP#get2(path, header = nil) -> Net::HTTPResponse (6271.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...用します。

@
param path 取得するエンティティのパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts respons...
...# body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@
see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTP#get2(path, header = nil) {|response| .... } -> Net::HTTPResponse (6271.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...用します。

@
param path 取得するエンティティのパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts respons...
...# body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@
see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTP#request_get(path, header = nil) -> Net::HTTPResponse (6271.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...用します。

@
param path 取得するエンティティのパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts respons...
...# body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@
see Net::HTTP#get, Net::HTTPResponse#read_body...

Net::HTTP#request_get(path, header = nil) {|response| .... } -> Net::HTTPResponse (6271.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...用します。

@
param path 取得するエンティティのパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。

//emlist[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts respons...
...# body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end
}
//}

get
2 は時代遅れなので使わないでください。

@
see Net::HTTP#get, Net::HTTPResponse#read_body...

絞り込み条件を変える

<< 1 2 3 ... > >>