るりまサーチ

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

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. file umask
  4. digest file
  5. base file

ライブラリ

クラス

キーワード

検索結果

Rake::FileList#to_s -> String (21221.0)

全ての要素をスペースで連結した文字列を返します。

...全ての要素をスペースで連結した文字列を返します。

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

task default: :test_rake_app
task :test_rake_app do
file
_list = FileList['a.c', 'b.c']
file
_list.to_s # => "a.c b.c"
end
//}...

Pathname#to_s -> String (18209.0)

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

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


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

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

IO#syswrite(string) -> Integer (168.0)

write(2) を用いて string を出力します。 string が文字列でなければ to_s による文字列化を試みます。 実際に出力できたバイト数を返します。

...write(2) を用いて string を出力します。
string
が文字列でなければ to_s による文字列化を試みます。
実際に出力できたバイト数を返します。

stdio を経由しないので他の出力メソッドと混用すると思わぬ動作
をすることがあり...
...込み用にオープンされていなければ発生します。

@raise Errno::EXXX 出力に失敗した場合に発生します。

//emlist[例][ruby]{
File
.open("testfile", "w+") do |f|
f.syswrite("ABCDE") # => 5
f.syswrite(:ABC) # => 3
end
File
.read("testfile") # => "ABCDEABC"
//}...

Pathname#extname -> String (140.0)

File.extname(self.to_s) と同じです。

...File.extname(self.to_s) と同じです。


@see File.extname...

Pathname#ftype -> String (140.0)

File.ftype(self.to_s) と同じです。

...File.ftype(self.to_s) と同じです。


@see File.ftype...

絞り込み条件を変える

Pathname#to_path -> String (140.0)

File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。

...File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。


@see Pathname#to_s...

WEBrick::HTTPResponse#content_length -> Integer | nil (19.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...ません。

require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT
Serve...

WEBrick::HTTPResponse#content_length=(len) (19.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...ません。

require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT
Serve...