るりまサーチ

最速Rubyリファレンスマニュアル検索!
171件ヒット [1-100件を表示] (0.201秒)
トップページ > クエリ:-[x] > クエリ:r[x] > クエリ:t[x] > クエリ:<[x] > クエリ:>>[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

検索結果

<< 1 2 > >>

Shell::Filter#>>(to) -> self (24324.0)

toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。

...
t
oをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば
それをそのまま出力とする。

@param to 出力先を指定します。文字列ならばファイルに、IOオブジェクトならばそれに出力します。

使用例
r
...
...equire 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> File.open("tail.out", "w") # でも同じ。
}...

rexml/parsers/streamparser (18210.0)

ストリーム式の XML パーサ。

...ストリーム式の XML パーサ。

r
exml の XML パーサの中では高速ですが、機能は限定的です。
もう少し高機能なストリーム式パーサが必要な場合は
R
EXML::Parsers::SAX2Parser を用いてください。

パーサからはコールバックによって...
...受け取ります。
R
EXML::StreamListener を include し、
必要なメソッドをオーバーライドしたクラスのオブジェクトを
コールバックオブジェクトとして REXML::Parsers::StreamParser.new
に渡します。

R
EXML::Parsers::StreamParser#parse を呼び出すと...
...t[][ruby]{
r
equire 'rexml/parsers/baseparser'
r
equire 'rexml/parsers/streamparser'
r
equire 'rexml/streamlistener'
class Listener
include REXML::StreamListener
def initialize
@events = []
end

def text(text)
@events << "text[#{text}]"
end

def tag_start(name, attrs)
@events <<...

REXML::Element#each_element_with_attribute(key, value = nil, max = 0, name = nil) {|element| ... } -> () (12384.0)

特定の属性を持つすべての子要素を引数としてブロックを呼び出します。

...と、それは xpath 文字列と見なされ、
それにマッチするもののみが対象となります。

max に 0 を指定すると、max の指定は無視されます(0個ではありません)。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param max ブロッ...
...個数
@param name xpath文字列

//emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|e| p e }
# >> <b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '...
...1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//}...

RubyVM::InstructionSequence#absolute_path -> String | nil (12312.0)

self が表す命令シーケンスの絶対パスを返します。

...irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "hello, wor...
...ld"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"

@see RubyVM::InstructionSequence#path...

RubyVM::InstructionSequence#path -> String (12312.0)

self が表す命令シーケンスの相対パスを返します。

..."<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/meth...
...od.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('method.rb')
> iseq.path # => "method.rb"

@see RubyVM::InstructionSequence#absolute_path...

絞り込み条件を変える

REXML::StreamListener#entitydecl(content) -> () (12290.0)

DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

...DTDの実体宣言をパースしたときに呼び出されるコールバックメソッドです。

@param content 実体宣言が配列で渡されます

実体宣言の書き方によって content に渡されるデータの形式が異なります。

//emlist[][ruby]{
r
equire 'rexml/parser...
...rser'
r
equire 'rexml/parsers/streamparser'
r
equire 'rexml/streamlistener'
xml = <<EOS
<
!DOCTYPE root [
<
!ENTITY % YN '"Yes"'>
<
!ENTITY % YN 'Yes'>
<
!ENTITY WhatHeSaid "He said %YN;">
<
!ENTITY open-hatch SYSTEM "http://www.textuality.com/boilerplate/OpenHatch.xml">
<
!ENTITY open-hatch PUBLIC "-//Text...
...ate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml">
<
!ENTITY hatch-pic SYSTEM "../grafix/OpenHatch.gif" NDATA gif>
]>
<
root />
EOS

class Listener
include REXML::StreamListener
def entitydecl(content); p content; end
end
R
EXML::Parsers::StreamParser.new(xml, Listener.new).parse
# >>...

rexml/document (12198.0)

DOM スタイルの XML パーサ。

...

R
EXML::Document.new で XML 文書から DOM ツリーを
構築し、ツリーのノードの各メソッドで文書の内容にアクセスします。

以下のプログラムではブックマークの XML からデータを取り出します。

//emlist[][ruby]{
r
equire 'rexml/document'
r
e...
...re 'pp'

Bookmark = Struct.new(:href, :title, :desc)

doc = REXML::Document.new(<<XML)
<
?xml version="1.0" encoding="UTF-8" ?>
<
xbel version="1.0">
<
bookmark href="http://www.ruby-lang.org/ja/">
<
title>オブジェクト指向スクリプト言語 Ruby</title>
<
desc>Rubyの公式サイト<...
...ark|
href = bookmark.attribute("href").value
t
itle_element = bookmark.elements["title"]
t
itle = title_element ? title_element.text : nil
desc_element = bookmark.elements["desc"]
desc = desc_element ? desc_element.text : nil
Bookmark.new(href, title, desc)
end
pp bookmarks
# >> [#<struct...

rexml/parsers/ultralightparser (12102.0)

パース結果を配列で作られた木構造により返すパーサ。

...より返すパーサ。

R
EXML::Parsers::UltraLightParser.new でパーサオブジェクトを
生成し、REXML::Parsers::UltraLightParser#parse でパースし
その結果の木構造を返します。

===[a:nodes] ノードの表現
R
EXML::Parsers::UltraLightParser#parse が返す
XML の各...
...: [:start_element, 親ノード, 要素名, 属性, *子ノード]
XML要素。属性は { 属性名文字列 => 属性値文字列 } という Hash。
子ノードの配列は node[4..-1] で得られる。
: [:text, 正規化文字列]
テキストノード
: [:processing_instruction, タ...
...st[][ruby]{
r
equire 'rexml/parsers/ultralightparser'
r
equire 'pp'
parser = REXML::Parsers::UltraLightParser.new(<<XML)
<
?xml version="1.0" encoding="UTF-8" ?>
<
root>
<
a n="1">xyz</a>
<
b m="2" />
<
/root>
XML
pp parser.parse
# >> [[:xmldecl, "1.0", "UTF-8", nil],
# >> [:text, "\n"],
# >> [:start...

ruby 1.6 feature (11532.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby 1.6 feature
r
uby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていました。現在は、このようなシステムでは、EWOULDBLOCK は、EAGAIN
として定義されています。(これは 1.6.7 とは異なる挙...
....keys[0].upcase!
p a
=> ruby 1.6.7 (2002-03-01) [i586-linux]
"KEY"
=> -:3:in `upcase!': can't modify frozen string (TypeError)
from -:3
r
uby 1.6.7 (2002-08-01) [i586-linux]

: 2002-06-10 Fixnum#>>, <<

負の数に対して右シフト...

RubyVM::InstructionSequence#base_label -> String (9312.0)

self が表す命令シーケンスの基本ラベルを返します。

...1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method.rb
def hello
puts "he...
..., world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"

例3:

# /tmp/method2.rb
def hello
puts "hello, world"
end

R
ubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"

@see RubyVM::InstructionS...

絞り込み条件を変える

<< 1 2 > >>