110件ヒット
[1-100件を表示]
(0.079秒)
種類
- モジュール関数 (44)
- インスタンスメソッド (33)
- クラス (22)
- 文書 (11)
ライブラリ
- ビルトイン (22)
- fiddle (22)
-
fiddle
/ import (11) - fileutils (44)
クラス
- Hash (22)
モジュール
-
Fiddle
:: Importer (11) - FileUtils (44)
キーワード
- BlockCaller (11)
- Closure (11)
- bind (11)
- cmp (11)
-
compare
_ by _ identity (11) -
compare
_ by _ identity? (11) -
compare
_ file (11) -
compare
_ stream (11) - identical? (11)
-
ruby 1
. 9 feature (11)
検索結果
先頭5件
-
FileUtils
. # compare _ file(file _ a , file _ b) -> bool (12401.0) -
ファイル file_a と file_b の内容が同じなら真を返します。
...ファイル file_a と file_b の内容が同じなら真を返します。
@param file_a ファイル名。
@param file_b ファイル名。
//emlist[][ruby]{
require 'fileutils'
FileUtils.cmp('somefile', 'somefile') #=> true
FileUtils.cmp('/dev/null', '/dev/urandom') #=> false
//}... -
FileUtils
. # compare _ stream(io _ a , io _ b) -> bool (12301.0) -
IO オブジェクト io_a と io_b の内容が同じなら真を返します。
...
IO オブジェクト io_a と io_b の内容が同じなら真を返します。
@param io_a IO オブジェクト。
@param io_b IO オブジェクト。... -
Hash
# compare _ by _ identity -> self (12225.0) -
ハッシュのキーの一致判定をオブジェクトの同一性で判定するように変更します。
...密に
Object#object_idが一致しているかどうかを条件とするようにselfを変更します。
selfが変化する破壊的メソッドです。
@return selfを返します。
//emlist[例][ruby]{
h1 = { "a" => 100, "b" => 200, :c => "c" }
p h1.compare_by_identity? #=> false
p h1["a......"] #=> 100
h1.compare_by_identity
p h1.compare_by_identity? #=> true
p h1["a"] #=> nil # この"a"と最初の"a"とは違うオブジェクト
p h1[:c] #=> "c" # 同じ内容のシンボルはすべて同一
//}
@see Hash#compare_by_identity?... -
Hash
# compare _ by _ identity? -> bool (12225.0) -
ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。
...ハッシュがキーの一致判定をオブジェクトの同一性を用いて行っているならば真を返します。
//emlist[例][ruby]{
h1 = {}
p h1.compare_by_identity? #=> false
h1.compare_by_identity
p h1.compare_by_identity? #=> true
//}
@see Hash#compare_by_identity... -
FileUtils
. # identical?(file _ a , file _ b) -> bool (9101.0) -
ファイル file_a と file_b の内容が同じなら真を返します。
...ファイル file_a と file_b の内容が同じなら真を返します。
@param file_a ファイル名。
@param file_b ファイル名。
//emlist[][ruby]{
require 'fileutils'
FileUtils.cmp('somefile', 'somefile') #=> true
FileUtils.cmp('/dev/null', '/dev/urandom') #=> false
//}... -
FileUtils
. # cmp(file _ a , file _ b) -> bool (6201.0) -
ファイル file_a と file_b の内容が同じなら真を返します。
...ファイル file_a と file_b の内容が同じなら真を返します。
@param file_a ファイル名。
@param file_b ファイル名。
//emlist[][ruby]{
require 'fileutils'
FileUtils.cmp('somefile', 'somefile') #=> true
FileUtils.cmp('/dev/null', '/dev/urandom') #=> false
//}... -
Fiddle
:: Importer # bind(signature , *opts) { . . . } -> Fiddle :: Function (6142.0) -
Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。
...関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出すことができます。
signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。
opts に......iddle::Function オブジェクトを返します。
@param signature 関数の名前とシネグチャ
@param opts オプション
例
require 'fiddle/import'
module M
extend Fiddle::Importer
dlload "libc.so.6"
typealias "size_t", "unsigned long"
extern "int qsort(void*, si......, size_t, void*)"
bind("int compare(void*, void*)"){|px, py|
x = px.to_s(Fiddle::SIZEOF_INT).unpack("i!")
y = py.to_s(Fiddle::SIZEOF_INT).unpack("i!")
x <=> y
}
end
data = [32, 180001, -13, -1, 0, 49].pack("i!*")
M.qsort(Fiddle::Pointer[data], 6, Fiddle::SIZE... -
Fiddle
:: Closure (3018.0) -
コールバック関数を表すクラスです。
...スです。
FFI の closure の wrapper です。
利用法としては、このクラスのサブクラスを作って
そのサブクラスに call メソッドを定義し、
new でオブジェクトを生成することで利用します。
require 'fiddle'
include Fiddle # TYPE_* を......使うために include する
class Compare < Fiddle::Closure
# qsort の比較関数は 型が int(*)(void*, void*) であるため、
# このメソッドには DL::CPtr オブジェクトが渡される。
# そのポインタが指す先は比較している文字なので、......end
libc = DL.dlopen("/lib/libc.so.6")
qs = Fiddle::Function.new(libc["qsort"],
[TYPE_VOIDP, TYPE_INT, TYPE_INT, TYPE_VOIDP],
TYPE_VOID)
s = "7x0cba(Uq)"
qs.call(s, s.size, 1, Compare.new(TYPE_INT, [TYPE_VOIDP, TYPE_VOIDP]))
p s... -
Fiddle
:: Closure :: BlockCaller (3012.0) -
Ruby のブロックをラップしたコールバック関数を表すクラスです。
...require 'fiddle'
include Fiddle
libc = Fiddle.dlopen("/lib/libc.so.6")
qs = Fiddle::Function.new(libc["qsort"],
[TYPE_VOIDP, TYPE_INT, TYPE_INT, TYPE_VOIDP],
TYPE_VOID)
compare = Fiddle::Closure::BlockCaller.new(TYPE_INT, [TYPE_VOIDP,......TYPE_VOIDP]){|x, y|
# qsort の比較関数は 型が int(*)(void*, void*) であるため、
# このブロックには DL::CPtr オブジェクトが渡される。
# そのポインタが指す先は比較している文字なので、
# DL::CPtr#to_s で1文字の文字列に変......換している
x.to_s(1) <=> y.to_s(1)
}
s = "7x0cba(Uq)"
qs.call(s, s.size, 1, compare)
p s # => "()07Uabcqx"... -
ruby 1
. 9 feature (162.0) -
ruby 1.9 feature ruby version 1.9.0 は開発版です。 以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。 1.9.1 以降は安定版です。 バグ修正がメインになります。
...ruby 1.9 feature
ruby version 1.9.0 は開発版です。
以下にあげる機能は将来削除されたり互換性のない仕様変更がなされるかもしれません。
1.9.1 以降は安定版です。
バグ修正がメインになります。
記号について(特に重要なもの......は大文字(主観))
* カテゴリ
* [ruby]: ruby インタプリタの変更
* [api]: 拡張ライブラリ API
* [lib]: ライブラリ
* [parser]: 文法の変更
* [regexp]: 正規表現の機能拡張
* [marshal]: Marshal ファイルのフォーマット変更
* レベル
* [b......: Struct#inspect
=== 2006-09-14
: digest.rb
: Digest::Base.file
=== 2006-09-13
: Hash#compare_by_identity
: Hash#compare_by_identity?
: Hash#identical
: Hash#identical?
=== 2006-09-12
: Hash#compare_by_identity
: Hash#compare_by_identity?
=== 2006-09-11
: Hash#identical
: Hash#identical?
==...