るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

Fiddle::Importer#bind(signature, *opts) { ... } -> Fiddle::Function (21248.0)

Ruby のブロックを C の関数で wrap し、その関数をモジュールに インポートします。

...Ruby のブロックを C の関数で wrap し、その関数をモジュールに
インポートします。

これでインポートされた関数はモジュール関数として定義されます。
また、Fiddle::Importer#[] で Fiddle::Function オブジェクトとして
取り出す...
...きます。

signature で関数の名前とシネグチャを指定します。例えば
"int compare(void*, void*)" のように指定します。

opts には :stdcall もしくは :cdecl を渡すことができ、
呼出規約を明示することができます。

@return インポートし...
...Function オブジェクトを返します。

@param signature 関数の名前とシネグチャ
@param opts オプション


require
'fiddle/import'

module M
extend Fiddle::Importer
dlload "libc.so.6"
t
ypealias "size_t", "unsigned long"
extern "int qsort(void*, size_t, s...

ERB#result(b=TOPLEVEL_BINDING) -> String (6213.0)

ERB を b の binding で実行し、結果の文字列を返します。

...B を b の binding で実行し、結果の文字列を返します。

@param b eRubyスクリプトが実行されるときのbinding

//emlist[例][ruby]{
require
'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
t
est1 = "foo"
t
est2 = "bar"
puts erb.result
# test foo
# test bar
//}...
...@see ERB#result_with_hash...

ERB#run(b=TOPLEVEL_BINDING) -> nil (213.0)

ERB を b の binding で実行し、結果を標準出力へ印字します。

...ERB を b の binding で実行し、結果を標準出力へ印字します。

@param b eRubyスクリプトが実行されるときのbinding

//emlist[例][ruby]{
require
'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
t
est1 = "foo"
t
est2 = "bar"
erb.run
# test foo
# test bar
//}...