るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Rake::TaskManager#synthesize_file_task(task_name) -> Rake::FileTask | nil (9137.0)

与えられたタスク名をもとにファイルタスクを合成します。

...合成します。

@
param task_name タスク名を指定します。

@
return 与えられたタスク名と同名のファイルが存在する場合は、ファイルタスクを作成して返します。
そうでない場合は nil を返します。

@
raise RuntimeError タスクを...
...

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

t
ask default: :test_rake_app

t
ask :test_rake_app do |task|
t
ask.application.synthesize_file_task("sample_file") # => nil
IO.write("sample_file", "")
t
ask.application.synthesize_file_task("sample_file") # => <Rake::FileTask sample_fil...

File#atime -> Time (6237.0)

最終アクセス時刻を Time オブジェクトとして返します。

...刻を Time オブジェクトとして返します。

@
raise IOError 自身が close されている場合に発生します。

@
raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |...
...f| f.atime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#ctime, File#mtime...
...f| f.atime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#ctime, File#mtime, File#birthtime...

File#ctime -> Time (6237.0)

状態が最後に変更された時刻を Time オブジェクトとして返します。状態の変更とは chmod などによるものです。

... Time オブジェクトとして返します。状態の変更とは chmod などによるものです。

@
raise IOError 自身が close されている場合に発生します。

@
raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{...
...IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#mtime...
...IO.write("testfile", "test")
File.open("testfile") { |f| f.ctime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#mtime, File#birthtime...

File#mtime -> Time (6237.0)

最終更新時刻を Time オブジェクトとして返します。

...刻を Time オブジェクトとして返します。

@
raise IOError 自身が close されている場合に発生します。

@
raise Errno::EXXX ファイルの時刻の取得に失敗した場合に発生します。

//emlist[例:][ruby]{
IO.write("testfile", "test")
File.open("testfile") { |...
...f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#ctime...
...f| f.mtime } # => 2017-12-21 22:58:17 +0900
//}

@
see File#lstat, File#atime, File#ctime, File#birthtime...

IO#stat -> File::Stat (6237.0)

ファイルのステータスを含む File::Stat オブジェクトを生成して 返します。

...:Stat オブジェクトを生成して
返します。

@
raise Errno::EXXX ステータスの読み込みに失敗した場合に発生します。

@
raise IOError 既に close されていた場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "This is line one\nThis is line two...
...\n")
File.open("testfile") do |f|
s = f.stat
"%o" % s.mode # => "100644"
s.blksize # => 4096
s.atime # => 2018-03-01 23:19:59 +0900
end
//}

@
see File#lstat, File.stat, File.lstat...

絞り込み条件を変える

IO#readbyte -> Integer (6225.0)

IO から1バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。

...Error が発生します。

@
raise EOFError 既に EOF に達している場合に発生します。

//emlist[例][ruby]{
IO.write("testfile", "123")
File.open("testfile") do |f|
begin
f.readbyte # => 49
f.readbyte # => 50
f.readbyte # => 51
f.readbyte # => 例外発生
res...

Pathname#ctime -> Time (6225.0)

File.ctime(self.to_s) を渡したものと同じです。

...e.ctime(self.to_s) を渡したものと同じです。

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

IO.write("testfile", "test")
pathname = Pathname("testfile")
pathname.ctime # => 2019-01-14 00:39:51 +0900
sleep 1
pathname.chmod(0755)
pathname.ctime # => 2019-01-14 00:39:52 +0900
//}

@
see File.ctime...

Array#to_csv(**options) -> String (6209.0)

CSV.generate_line(self, options) と同様です。

...generate_line(self, options) と同様です。

Array オブジェクトを 1 行の CSV 文字列に変換するためのショートカットです。

@
param options CSV.generate_line と同様のオプションを指定します。

//emlist[][ruby]{
require 'csv'

p [1, 'Matz', :Ruby, Date.new...
...to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv(col_sep: ' ', row_sep: "\r\n") # => "1 Matz Ruby 1965-04-14\r\n"
//}

Ruby
3.0 (CSV 3.1.9) から、次のオプションが使えるようになりました。

//emlist[][ruby...
...]{
require 'csv'

puts [1, nil].to_csv # => 1,
puts [1, nil].to_csv(write_nil_value: "N/A") # => 1,N/A
puts [2, ""].to_csv # => 2,""
puts [2, ""].to_csv(write_empty_value: "BLANK") # => 2,BLANK
//}

@
see CSV.generate_line...

Net::HTTP#post(path, data, header = nil, dest = nil) -> Net::HTTPResponse (6179.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。

返り値は Net::HTTPResponse のインスタンスです。

ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え...
...HTTPResponse オブジェクトは有効な body を
持ちません。

POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

dest...
...
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@
param path POST先のパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。
@
param dest 利用...

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

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。

...サーバ上の path にあるエンティティに対し文字列 data を
POST で送ります。

返り値は Net::HTTPResponse のインスタンスです。

ブロックと一緒に呼びだされたときはエンティティボディを少しずつ文字列として
ブロックに与え...
...HTTPResponse オブジェクトは有効な body を
持ちません。

POST する場合にはヘッダに Content-Type: を指定する必要があります。
もし header に指定しなかったならば、 Content-Type として
"application/x-www-form-urlencoded" を用います。

dest...
...
dest を指定した場合には
ボディを少しずつ取得して順次
「dest << ボディの断片」を実行します。

@
param path POST先のパスを文字列で指定します。
@
param header リクエストの HTTP ヘッダをハッシュで指定します。
@
param dest 利用...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>