るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

モジュール

オブジェクト

キーワード

検索結果

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

Encoding::Converter.asciicompat_encoding(encoding) -> Encoding | nil (14101.0)

同じ文字集合を持つ ASCII 互換エンコーディングを返します。

...ングでない場合は nil を返します。

//emlist[][ruby]{
Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP>
Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8>
Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
//}...

Encoding::Converter.asciicompat_encoding(string) -> Encoding | nil (14101.0)

同じ文字集合を持つ ASCII 互換エンコーディングを返します。

...ングでない場合は nil を返します。

//emlist[][ruby]{
Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP>
Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8>
Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
//}...

File.absolute_path(file_name, dir_string=nil) -> String (14101.0)

file_name を絶対パスに変換した文字列を返します。

....expand_path と異なり、 file_name 先頭が "~" である場合
それは展開されません。普通のディレクトリ名として処理されます。

//emlist[例][ruby]{
p Dir.getwd #=> "/home/matz/work/bar"
p ENV["HOME"] #=> "/home/matz"
p File...
....absolute_path("..") #=> "/home/matz/work"
p File.absolute_path("..", "/tmp") #=> "/"
p File.absolute_path("~") #=> "/home/matz/work/bar/~"
p File.absolute_path("~foo") #=> "/home/matz/work/bar/~foo"
//}

@see File.expand_path...

File.absolute_path?(file_name) -> bool (14101.0)

file_name が絶対パスなら true を、そうでなければ false を返します。

...合は、to_path メソッド、to_str メソッドの順で暗黙の型変換が試みられます。

@raise TypeError 引数に文字列以外の(暗黙の型変換が行えない)オブジェクトを指定した場合に発生します。

//emlist[例][ruby]{
File.absolute_path?("//foo/bar...
...\\baz") # => true
File.absolute_path?("C:foo\\bar") # => false
File.absolute_path?("~") # => false

# プラットフォームが cygwin、mswin、mingw の場合
File.absolute_path?("C:\\foo\\bar") # => true
File.absolute_path?("/foo/bar\\baz") # => false

# プラットフォ...
...ームが上記以外の場合
File.absolute_path?("C:\\foo\\bar") # => false
File.absolute_path?("/foo/bar\\baz") # => true
//}...

File.atime(filename) -> Time (14101.0)

最終アクセス時刻を返します。

...セス時刻を返します。

@param filename ファイル名を表す文字列か IO オブジェクトを指定します。

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

//emlist[例][ruby]{
File.atime(__FILE__) # => 2017-11-28 22:38:44 +0900
//}...

絞り込み条件を変える

File.path(filename) -> String (14101.0)

指定されたファイル名を文字列で返します。filename が文字列でない場合は、to_path メソッドを呼びます。

...は、to_path メソッドを呼びます。

@param filename ファイル名を表す文字列か to_path メソッドが定義されたオブジェクトを指定します。

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

class MyPath
def initialize(path)
@path = path
end
def to_path
File...
....absolute_path(@path)
end
end

File.path("/dev/null") # => "/dev/null"
File.path(Pathname("/tmp")) # => "/tmp"
File.path(MyPath.new(".")) # => "/Users/user/projects/txt"
//}...

GC.latest_gc_info(key) -> object (14101.0)

最新のGCの情報を返します。

...ます。

//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}

stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true

GC.latest_gc_info(:gc_by) # => :new...

GC.latest_gc_info(result_hash = {}) -> Hash (14101.0)

最新のGCの情報を返します。

...ます。

//emlist[例][ruby]{
latest = GC.latest_gc_info
latest # => {:major_by=>nil, :gc_by=>:newobj, :have_finalizer=>false, :immediate_sweep=>false, :state=>:sweeping}

stat = GC.stat
merged = GC.latest_gc_info(stat)
merged == latest.merge(stat) # => true

GC.latest_gc_info(:gc_by) # => :new...

GC.stat(key) -> Numeric (14101.0)

GC 内部の統計情報を Hash で返します。

...場合は数値を返します。

GC.stat
# =>
{
:count=>2,
:heap_used=>9,
:heap_length=>11,
:heap_increment=>2,
:heap_live_slot=>6836,
:heap_free_slot=>519,
:heap_final_slot=>0,
:heap_swept_slot=>818,
:total_allocated_object=>7674,
:total_freed_object=...
...で返します。
引数 key を指定した場合は数値を返します。

GC.stat
# =>
{
:count=>0,
:heap_allocated_pages=>24,
:heap_sorted_length=>24,
:heap_allocatable_pages=>0,
:heap_available_slots=>9783,
:heap_live_slots=>7713,
:heap_free_...
...heap_marked_slots=>0,
:heap_swept_slots=>0,
:heap_eden_pages=>24,
:heap_tomb_pages=>0,
:total_allocated_pages=>24,
:total_freed_pages=>0,
:total_allocated_objects=>7796,
:total_freed_objects=>83,
:malloc_increase_bytes=>2389312,
:malloc_increase_bytes_lim...

GC.stat(result_hash = {}) -> {Symbol => Integer} (14101.0)

GC 内部の統計情報を Hash で返します。

...で返します。
引数 key を指定した場合は数値を返します。

GC.stat
# =>
{
:count=>0,
:heap_allocated_pages=>24,
:heap_sorted_length=>24,
:heap_allocatable_pages=>0,
:heap_available_slots=>9783,
:heap_live_slots=>7713,
:heap_free_...
...heap_marked_slots=>0,
:heap_swept_slots=>0,
:heap_eden_pages=>24,
:heap_tomb_pages=>0,
:total_allocated_pages=>24,
:total_freed_pages=>0,
:total_allocated_objects=>7796,
:total_freed_objects=>83,
:malloc_increase_bytes=>2389312,
:malloc_increase_bytes_lim...

絞り込み条件を変える

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