るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. rdoc/require require

ライブラリ

キーワード

検索結果

<< 1 2 > >>

Net::HTTPGenericRequest#path -> String (18237.0)

リクエストする path を文字列で返します。

...リクエストする path を文字列で返します。

//emlist[例][ruby]{
require
'net/http'

uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.path # => "/index.html"
//}...

Rake::PackageTask#package_dir_path -> String (6221.0)

パッケージに含むファイルを配置するディレクトリを返します。

...パッケージに含むファイルを配置するディレクトリを返します。

//emlist[][ruby]{
# Rakefile での記載例とする
require
'rake/packagetask'

Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.package_dir_path # => "pkg/sample-1.0.0"
end
//}...

REXML::Element#xpath -> String (6214.0)

文書上の対象の要素にのみマッチする xpath 文字列を返します。

...上の対象の要素にのみマッチする xpath 文字列を返します。

//emlist[][ruby]{
require
'rexml/document'
doc = REXML::Document.new('<a><b/><c/></a>')
c = doc.root.elements[2] # <a> .. </a> の中の <c/> 要素
c # => <c/>
c.xpath # => "/a/c"
doc = REXML::Document.new('<a><b/><b/>...
...</a>')
b = doc.root.elements[2] # <a> .. </a> の中の2番目の <b/> 要素
b # => <b/>
b.xpath # => "/a/b[2]"
//}...

Pathname#sub(pattern) {|matched| ... } -> Pathname (3143.0)

self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。

...しい Pathname オブジェクトを生成し、返します。

@param pattern 置き換える文字列のパターンを指定します。

@param replace pattern で指定した文字列と置き換える文字列を指定します。

//emlist[例][ruby]{
require
'pathname'

path
1 = Pathname('/...
...usr/bin/perl')
path
1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}

@see String#sub...

Pathname#sub(pattern, replace) -> Pathname (3143.0)

self を表現するパス文字列に対して sub メソッドを呼び出し、その結果を内 容とする新しい Pathname オブジェクトを生成し、返します。

...しい Pathname オブジェクトを生成し、返します。

@param pattern 置き換える文字列のパターンを指定します。

@param replace pattern で指定した文字列と置き換える文字列を指定します。

//emlist[例][ruby]{
require
'pathname'

path
1 = Pathname('/...
...usr/bin/perl')
path
1.sub('perl', 'ruby') #=> #<Pathname:/usr/bin/ruby>
//}

@see String#sub...

絞り込み条件を変える

Pathname#to_s -> String (3126.0)

パス名を文字列で返します。

...パス名を文字列で返します。


//emlist[例][ruby]{
require
'pathname'

path
= Pathname.new("/tmp/hogehoge")
File.open(path)
//}...

Pathname#binread(*args) -> String | nil (3114.0)

IO.binread(self.to_s, *args)と同じです。

...rgs)と同じです。

//emlist[例][ruby]{
require
"pathname"

path
name = Pathname("testfile")
path
name.binread # => "This is line one\nThis is line two\nThis is line three\nAnd so on...\n"
path
name.binread(20) # => "This is line one\nThi"
path
name.binread(20, 10) # => "ne one\nT...

REXML::Element#text(path = nil) -> String | nil (227.0)

先頭のテキスト子ノードの文字列を返します。

...ださい。

path
を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。

テキストノードがない場合には nil を返します。

@param path XPath文字列
@see REXML::Element#get_text

//emlist[][ruby]{
require
'rexml/docume...

Net::HTTPResponse#read_body(dest=nil) -> String|nil (144.0)

ブロックを与えなかった場合にはエンティティボディを 文字列で返します。 ブロックを与えた場合には エンティティボディを少しずつ取得して順次ブロックに 文字列で与えます。

...一度に結果取得][ruby]{
require
'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
response.read_body[0..10] # => "<!doctype h"
//}

//emlist[例2 ブロックを与えて大きいファイルを取得][ruby]{
require
'net/http'

uri = URI.p...
...p://www.example.com/path/to/big.file')
Net::HTTP.start(uri.host, uri.port) do |http|
File.open("/path/to/big.file", "w") do |f|
# Net::HTTP#request_get と Net::HTTPResponse#read_body で少しずつ読み書き。メモリ消費が少ない。
http.request_get(uri.path) do |response|...
<< 1 2 > >>