るりまサーチ

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

別のキーワード

  1. kernel require
  2. getoptlong require_order
  3. rubygems/custom_require require
  4. irb/ext/use-loader irb_require
  5. require execute

検索結果

<< 1 2 3 ... > >>

String#ext(newext = &#39;&#39;) -> String (18226.0)

自身の拡張子を与えられた拡張子で置き換えます。

...た拡張子が空文字列の場合は、自身の拡張子を削除します。

@param newext 新しい拡張子を指定します。

例:
require
"rake"

"hoge".ext(".rb") # => "hoge.rb"
"hoge.rb".ext(".erb") # => "hoge.erb"
"hoge.tar.gz".ext(".bz2") # => "hoge.tar.bz2"...

RDoc::Context#add_require(a_require) -> () (9231.0)

自身が所属する RDoc::TopLevel オブジェクトに引数で指定した RDoc::Require を追加します。

...自身が所属する RDoc::TopLevel オブジェクトに引数で指定した
RDoc::Require を追加します。

@param a_require RDoc::Require オブジェクトを指定します。...

RDoc::Context#requires -> [RDoc::Require] (9218.0)

追加された RDoc::Require の配列を返します。

...追加された RDoc::Require の配列を返します。...

IRB::ExtendCommandBundle#irb_require(*opts, &b) -> bool (9124.0)

現在の irb に関する IRB::Context に対して irb_require コマンドを 実行します。

...現在の irb に関する IRB::Context に対して irb_require コマンドを
実行します。

@see IRB::ExtendCommand::Require#execute...

REXML::Element#each_element_with_text(text = nil, max = 0, name = nil) {|element| ... } -> () (6207.0)

テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。

...テキストを子ノードとして
持つすべての子要素を引数としてブロックを呼び出します。

text を指定すると、テキストの内容が text であるもののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max 個のみが対...
...

@param text テキストの中身(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列

//emlist[][ruby]{
require
'rexml/document'
doc = REXML::Document.new '<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
#...
...>> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}...

絞り込み条件を変える

REXML::Element#get_text(path = nil) -> REXML::Text | nil (6207.0)

先頭のテキスト子ノードを返します。

...REXML::Text#value も参照してください。

path を渡した場合は、その XPath 文字列で指定される
テキストノードの文字列を返します。

テキストノードがない場合には nil を返します。

@param path XPath文字列
@see REXML::Element#text

//emli...
...st[][ruby]{
require
'rexml/document'
doc = REXML::Document.new "<p>some text <b>this is bold!</b> more text</p>"
# doc.root (<p> ... </p>) は2つのテキストノード("some text " と " more text"
# を持っているが、前者を返す
doc.root.get_text.value # => "some text "
//}...

REXML::Element#text=(text) (6207.0)

「先頭の」テキストノードを text で置き換えます。

...ノードを text で置き換えます。

テキストノードを1つ以上保持している場合はそのうち
最初のノードを置き換えます。

要素がテキストノードを保持していない場合は新たなテキストノードが追加されます。

text には文字...
...ext、nil のいずれかが指定できます。
REXML::Text オブジェクトを指定した場合には、それが設定され、
文字列を指定した場合には
REXML::Text.new(text, whitespace(), nil, raw())
で生成される Text オブジェクトが設定されます。
nil を指定...
...れます。

@param text 置き換え後のテキスト(文字列、REXML::Text, nil(削除))

//emlist[][ruby]{
require
'rexml/document'
doc = REXML::Document.new('<a><b/></a>')
doc.to_s # => "<a><b/></a>"
doc.root.text = "Foo"; doc.to_s # => "<a><b/>Foo</a>"
doc.root.text = "Bar"; doc.to_s # => "...

Pathname#sub_ext(replace) -> Pathname (6144.0)

拡張子を与えられた文字列で置き換えた Pathname オブジェクトを返します。

...します。

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

Pathname('/usr/bin/shutdown').sub_ext('.rb') # => #<Pathname:/usr/bin/shutdown.rb>
Pathname('/home/user/test.txt').sub_ext('.pdf') # => #<Pathname:/home/user/test.pdf>
Pathname('/home/user/test').sub_ext('.pdf') # => #<Pathname:/hom...
...e/user/test.pdf>
Pathname('/home/user/test.').sub_ext('.pdf') # => #<Pathname:/home/user/test..pdf>
Pathname('/home/user/.test').sub_ext('.pdf') # => #<Pathname:/home/user/.test.pdf>
Pathname('/home/user/test.tar.gz').sub_ext('.xz') # => #<Pathname:/home/user/test.tar.xz>
//}...

Date#next_year(n = 1) -> Date (6107.0)

n 年後を返します。

...す。

self >> (n * 12) に相当します。

//emlist[例][ruby]{
require
'date'
Date.new(2001,2,3).next_year #=> #<Date: 2002-02-03 ...>
Date.new(2008,2,29).next_year #=> #<Date: 2009-02-28 ...>
Date.new(2008,2,29).next_year(4) #=> #<Date: 2012-02-29 ...>
//}

Date#>> も参照して...
<< 1 2 3 ... > >>