るりまサーチ

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

別のキーワード

  1. array sample
  2. _builtin sample
  3. sample
  4. sample array
  5. sample random

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Rake::PackageTask#name -> String (18120.0)

バージョン情報を含まないパッケージの名前を返します。

...バージョン情報を含まないパッケージの名前を返します。

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

Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.name # => "sample"
end
//}...

Rake::TaskManager#in_namespace(name) {|name_space| ... } -> Array (6321.0)

与えられた名前の名前空間でブロックを評価します。

...を評価します。

@param name 名前を指定します。

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

task default: :test_rake_app

name
space :sample do
def hoge
puts "hoge"
end
end

task :test_rake_app do
task.application.in_namespace("sample") do
hoge # => "hoge"
e...

Rake::PackageTask#name=(name) (6239.0)

バージョン情報を含まないパッケージの名前をセットします。

...

@param name パッケージの名前を指定します。

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

Rake::PackageTask.new("sample", "1.0.0") do |package_task|
package_task.name # => "sample"
package_task.name = "update"
package_task.name # => "upda...

NameError#receiver -> object (3019.0)

self が発生した時のレシーバオブジェクトを返します。

...lf が発生した時のレシーバオブジェクトを返します。

例:

class Sample
def foo
return "foo"
end
end

bar = Sample.new
begin
bar.bar
rescue NameError => err
p err.receiver # => #<Sample:0x007fd4d89b3110>
p err.receiver.foo # => "foo"
end...

Pathname#split -> Array (3013.0)

File.split(self.to_s) と同じです。

...File.split(self.to_s) と同じです。

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

pathname = Pathname("/path/to/sample")
pathname.split # => [#<Pathname:/path/to>, #<Pathname:sample>]
//}

@see File.split...

絞り込み条件を変える

Pathname#delete -> Integer (3007.0)

self が指すディレクトリあるいはファイルを削除します。

...self が指すディレクトリあるいはファイルを削除します。

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

pathname = Pathname("/path/to/sample")
pathname.exist? # => true
pathname.unlink # => 1
pathname.exist? # => false
//}...

Pathname#unlink -> Integer (3007.0)

self が指すディレクトリあるいはファイルを削除します。

...self が指すディレクトリあるいはファイルを削除します。

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

pathname = Pathname("/path/to/sample")
pathname.exist? # => true
pathname.unlink # => 1
pathname.exist? # => false
//}...

Rake::FileList#egrep(pattern) {|filename, count, line| ... } (161.0)

与えられたパターンをファイルリストから grep のように検索します。

...ite("sample1", "line1\nline2\nline3\n")
IO.write("sample2", "line1\nline2\nline3\nline4\n")

task default: :test_rake_app
task :test_rake_app do

file_list = FileList.new('sample*')
file_list.egrep(/line/) # => 7

file_list.egrep(/.*/) do |filename, count, line|
"filename = #{filename}, co...
...# => "filename = sample1, count = 1, line = line1\n"
# => "filename = sample1, count = 2, line = line2\n"
# => "filename = sample1, count = 3, line = line3\n"
# => "filename = sample2, count = 1, line = line1\n"
# => "filename = sample2, count = 2, line = line2\n"
# => "filename = sample2, count =...
...3, line = line3\n"
# => "filename = sample2, count = 4, line = line4\n"
//}...

Rake::TaskManager#synthesize_file_task(task_name) -> Rake::FileTask | nil (132.0)

与えられたタスク名をもとにファイルタスクを合成します。

...与えられたタスク名をもとにファイルタスクを合成します。

@param task_name タスク名を指定します。

@return 与えられたタスク名と同名のファイルが存在する場合は、ファイルタスクを作成して返します。
そうでない場...
...by]{
# Rakefile での記載例とする

task default: :test_rake_app

task :test_rake_app do |task|
task.application.synthesize_file_task("sample_file") # => nil
IO.write("sample_file", "")
task.application.synthesize_file_task("sample_file") # => <Rake::FileTask sample_file => []>
end
//}...
<< 1 2 > >>