るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. range end

ライブラリ

クラス

モジュール

キーワード

検索結果

Kernel#namespace(name = nil) { ... } -> Rake::NameSpace (18227.0)

新しい名前空間を作成します。

...新しい名前空間を作成します。

与えられたブロックを評価する間は、その名前空間を使用します。

例:
ns = namespace "nested" do
task :run
end

task_run = ns[:run] # find :run in the given namespace.

@see Rake::TaskManager#in_namespace...

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

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

...ます。

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

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

task default: :test_rake_app

namespace
:sample do
def hoge
puts "hoge"
end

end


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

end

//}...

Rake::NameSpace#[](name) -> Rake::Task (3025.0)

与えられた名前のタスクを返します。

...のタスクを返します。

@param name タスクの名前を指定します。

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

namespace
:ns do |ns|
task :ts1 do
end

task :ts2 do
end


ns[:ts1] # => <Rake::Task ns:ts1 => []>
ns[:ts2] # => <Rake::Task ns:ts2 => []>
end

//}...

Rake::NameSpace#tasks -> Array (3025.0)

タスクのリストを返します。

...タスクのリストを返します。

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

namespace
:ns do |ns|
task :ts1 do
end

task :ts2 do
end


ns.tasks # => [<Rake::Task ns:ts1 => []>, <Rake::Task ns:ts2 => []>]
end

//}...

REXML::Attributes#each {|name, value| ... } -> () (13.0)

各属性の名前と値に対しブロックを呼び出します。

...各属性の名前と値に対しブロックを呼び出します。

名前には expanded_name(REXML::Namespace#exapnded_name)が
渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://examp...
...le.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.each do |name, value|
p [name, value]
end


# => ["foo:att", "1"]
# => ["bar:att", "2"]
# => ["att", "<"]
//}...

絞り込み条件を変える

REXML::Attributes#each_attribute {|attribute| ... } -> () (13.0)

各属性に対しブロックを呼び出します。

...bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end

# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...