るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

Rake::FileList#existing -> Rake::FileList (18114.0)

自身に含まれるファイルのうちファイルシステムに存在するファイルのみを 含む Rake::FileList を返します。

...を返します。

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

IO.write("test1.rb", "test")
IO.write("test2.rb", "test")

task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.existing # => ["test1.rb", "test2.rb"]...

Rake::FileList#existing! -> self (6114.0)

自身に含まれるファイルのうちファイルシステムに存在するファイルのみを 含むように自身を変更して返します。

...て返します。

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

IO.write("test1.rb", "test")
IO.write("test2.rb", "test")

task default: :test_rake_app
task :test_rake_app do
file_list = FileList.new("test1.rb", "test2.rb", "test3.rb")
file_list.existing! # => ["test1.rb", "test2.rb"]...

Binding#local_variable_set(symbol, obj) (25.0)

引数 symbol で指定した名前のローカル変数に引数 obj を設定します。

...bol で指定したローカル変数に設定するオブジェクトを指定します。

//emlist[例][ruby]{
def foo
a = 1
bind = binding
bind.local_variable_set(:a, 2) # set existing local variable `a'
bind.local_variable_set(:b, 3) # create new local variable `b'...
...# => NameError
end
//}

このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。

//emlist[][ruby]{
binding.eval("#{symbol} = #{obj}")
//}

@see Binding#local_variable_get, Binding#local_variable_defi...