るりまサーチ

最速Rubyリファレンスマニュアル検索!
176件ヒット [1-100件を表示] (0.032秒)
トップページ > ライブラリ:ビルトイン[x] > クエリ:exec[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin exec
  2. kernel exec
  3. rubygems/defaults default_exec_format
  4. process exec
  5. io close_on_exec=

クラス

キーワード

検索結果

<< 1 2 > >>

IO#close_on_exec? -> bool (6156.0)

自身に close-on-exec フラグが設定されていた場合 true を返します。 そうでない場合に false を返します。

...close-on-exec フラグが設定されていた場合 true を返します。
そうでない場合に false を返します。

f = open("/dev/null")
f.close_on_exec? #=> true
f.close_on_exec = false
f.close_on_exec? #=> false
f.close_on_exec = true...
...f.close_on_exec? #=> true

@see IO#close_on_exec=...

IO#close_on_exec=(bool) (6144.0)

自身に close-on-exec フラグを設定します。

...-on-exec フラグを設定します。

このフラグをセットすると exec(2) 時にそのファイルデスクリプタを
close します。

@see fcntl(2)
@param bool 自身の close-on-exec フラグを true か false で指定します。

f = open("/dev/null")
f.close_on_exec = t...
...rue
system("cat", "/proc/self/fd/#{f.fileno}") # cat: /proc/self/fd/3: No such file or directory
f.closed? #=> false

@see IO#close_on_exec?...

BasicObject#instance_exec(*args) {|*vars| ... } -> object (6122.0)

与えられたブロックをレシーバのコンテキストで実行します。

...タに渡す値です。

//emlist[例][ruby]{
class KlassWithSecret
def initialize
@secret = 99
end
end
k = KlassWithSecret.new
# 以下で x には 5 が渡される
k.instance_exec(5) {|x| @secret + x } #=> 104
//}

@see Module#class_exec, Module#module_exec, BasicObject#instance_eval...

Module#class_exec(*args) {|*vars| ... } -> object (6111.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

...コープになります。

@param args ブロックに渡す引数を指定します。


//emlist[例][ruby]{
class Thing
end
c = 1

Thing.class_exec{
def hello()
"Hello there!"
end

define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end...

Module#module_exec(*args) {|*vars| ... } -> object (6111.0)

与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。

...コープになります。

@param args ブロックに渡す引数を指定します。


//emlist[例][ruby]{
class Thing
end
c = 1

Thing.class_exec{
def hello()
"Hello there!"
end

define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end...

絞り込み条件を変える

File::Stat#executable? -> bool (6103.0)

実効ユーザ/グループIDで実行できる時に真を返します。

...実効ユーザ/グループIDで実行できる時に真を返します。

//emlist[][ruby]{
p File::Stat.new($0).executable?
# 例
#=> true
//}...

File::Stat#executable_real? -> bool (6103.0)

実ユーザ/グループIDで実行できる時に真を返します。

...実ユーザ/グループIDで実行できる時に真を返します。

//emlist[][ruby]{
p File::Stat.new($0).executable_real?
#例
#=> true
//}...

BasicObject#instance_eval {|obj| ... } -> object (9.0)

オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。

...imeError)
//}

//emlist[例][ruby]{
class Bar < BasicObject
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end

bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}

@see Module#module_eval, Kernel.#eval, BasicObject#instance_exec...

BasicObject#instance_eval(expr, filename = "(eval)", lineno = 1) -> object (9.0)

オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。

...imeError)
//}

//emlist[例][ruby]{
class Bar < BasicObject
def call1
instance_eval("::ENV.class")
end
def call2
instance_eval("ENV.class")
end
end

bar = Bar.new
bar.call1 # => Object
bar.call2 # raise NameError
//}

@see Module#module_eval, Kernel.#eval, BasicObject#instance_exec...

String#[]=(regexp, nth, val) (9.0)

正規表現 regexp の nth 番目の括弧にマッチする 最初の部分文字列を文字列 val で置き換えます。

...定範囲の部分文字列と置き換えたい文字列

@return val を返します。

@raise IndexError 正規表現がマッチしなかった場合に発生します。

//emlist[例][ruby]{
buf = "def exec(cmd)"
buf[/def\s+(\w+)/, 1] = "preprocess"
p buf # => "def preprocess(cmd)"
//}...

絞り込み条件を変える

<< 1 2 > >>