835件ヒット
[1-100件を表示]
(0.071秒)
別のキーワード
ライブラリ
- fileutils (55)
- pathname (12)
- pstore (72)
-
rexml
/ document (612) -
rexml
/ streamlistener (12)
クラス
- PStore (60)
- Pathname (12)
-
REXML
:: Attributes (156) -
REXML
:: CData (36) -
REXML
:: DocType (24) -
REXML
:: Element (192) -
REXML
:: Elements (72) -
REXML
:: Instruction (24) -
REXML
:: Text (12) -
REXML
:: XPath (36)
モジュール
- FileUtils (55)
-
REXML
:: StreamListener (12)
キーワード
- Comment (12)
- Default (12)
- Instruction (12)
- PStore (12)
- Pretty (12)
- ReFe (12)
- Transitive (12)
- [] (24)
- []= (24)
- abort (12)
-
add
_ attribute (24) -
add
_ element (12) - attribute (12)
- chown (12)
-
chown
_ R (12) - commit (12)
- content (12)
-
cp
_ lr (7) -
cp
_ r (12) - delete (36)
-
delete
_ all (12) -
delete
_ element (12) -
delete
_ namespace (12) - each (36)
-
each
_ attribute (12) -
each
_ element _ with _ attribute (12) -
each
_ element _ with _ text (12) - entitydecl (12)
- fetch (12)
- first (12)
-
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ text (12) -
has
_ elements? (12) - length (12)
- match (12)
- namespaces (12)
- new (24)
-
next
_ element (12) - prefixes (12)
- public (12)
- rdoc (12)
-
rexml
/ parsers / pullparser (12) -
rexml
/ parsers / sax2parser (12) -
rexml
/ parsers / streamparser (12) -
rexml
/ parsers / ultralightparser (12) - root? (12)
-
root
_ node (12) - size (24)
- system (12)
- target (12)
- text (12)
- text= (12)
-
to
_ a (24) -
to
_ s (12) - transaction (12)
- value (12)
- xpath (12)
検索結果
先頭5件
-
REXML
:: Element # root -> REXML :: Element (18155.0) -
self が属する文書のルート要素を返します。
...list[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS
children = doc.get_elements("/root/children").first
children.name # => "children"
children.root.name # => "root"
grandchildren = doc.get_elements("/root/children/gra......ndchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root.name # => "root"
//}... -
REXML
:: Element # root _ node -> REXML :: Document | REXML :: Node (6143.0) -
self が属する文書のルートノードを返します。
...st[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root>
<children>
<grandchildren />
</children>
</root>
EOS
children = doc.get_elements("/root/children").first
children.name # => "children"
children.root_node == doc # => true
grandchildren = doc.get_elements("/root/children/......grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren.root_node == doc # => true
//}... -
Pathname
# root? -> bool (6119.0) -
self がルートディレクトリであれば真を返します。判断は文字列操作によっ て行われ、ファイルシステムはアクセスされません。
...self がルートディレクトリであれば真を返します。判断は文字列操作によっ
て行われ、ファイルシステムはアクセスされません。
//emlist[例][ruby]{
require 'pathname'
Pathname('/').root? # => true
Pathname('/im/sure').root? # => false
//}... -
FileUtils
. # cp _ lr(src , dest , noop: nil , verbose: nil , dereference _ root: true , remove _ destination: false) (125.0) -
src へのハードリンク dest を作成します。 src がディレクトリの場合、再帰的にリンクします。 dest がディレクトリの場合、src へのハードリンク dest/src を作成します。
...列で指定します。
@param dest リンク作成先のファイルかディレクトリです。
@param options :noop, :verbose, :dereference_root, :remove_destination が指定できます。
c:FileUtils#options
@raise ArgumentError dest が src に含まれる場合に発生......ruby にインストールする例][ruby]{
require 'fileutils'
FileUtils.rm_r site_ruby + '/mylib', force: true
FileUtils.cp_lr 'lib/', site_ruby + '/mylib'
//}
//emlist[様々なファイルを対象ディレクトリにリンクする例][ruby]{
require 'fileutils'
FileUtils.cp_lr %w(mail.rb fie......+ '/tmail'
FileUtils.cp_lr Dir.glob('*.rb'), '/home/aamine/lib/ruby', noop: true, verbose: true
//}
//emlist[内容をリンクする例][ruby]{
require 'fileutils'
# ディレクトリそのものではなく、ディレクトリの内容をリンクしたい場合は、
# 以下のようにな... -
rexml
/ parsers / sax2parser (102.0) -
SAX2 と同等の API を持つストリーム式の XML パーサ。
...パーサよりは高機能です。
//emlist[][ruby]{
require 'rexml/parsers/sax2parser'
require 'rexml/sax2listener'
parser = REXML::Parsers::SAX2Parser.new(<<XML)
<root n="0">
<a n="1">111</a>
<b n="2">222</b>
<a n="3">333</a>
</root>
XML
elements = []
parser.listen(:start_element){|uri,......parser.parse
elements # => [["root", {"n"=>"0"}], ["a", {"n"=>"1"}], ["b", {"n"=>"2"}], ["a", {"n"=>"3"}]]
as # => [["a", {"n"=>"1"}], ["a", {"n"=>"3"}]]
texts # => ["111", "333"]
//}
//emlist[仕様確認サンプル][ruby]{
require 'rexml/parsers/sax2parser'
require 'rexml/sax2listener'
xml = <......n="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<!DOCTYPE root SYSTEM "foo" [
<!ELEMENT root (a+)>
<!ELEMENT a>
<!ENTITY bar "barbarbarbar">
<!ATTLIST a att CDATA #REQUIRED xyz CDATA "foobar">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
<!ENT... -
rexml
/ parsers / streamparser (84.0) -
ストリーム式の XML パーサ。
...ています。
空白や改行もテキストであることに注意してください。
//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
class Listener
include REXML::StreamListener
def initialize
@events = []
end......。
//emlist[][ruby]{
require 'rexml/parsers/baseparser'
require 'rexml/parsers/streamparser'
require 'rexml/streamlistener'
xml = <<EOS
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<!DOCTYPE root SYSTEM "foo" [
<!ELEMENT root (a+)>
<!ELEMENT a>......"barbarbarbar">
<!ATTLIST a att CDATA #REQUIRED xyz CDATA "foobar">
<!NOTATION foobar SYSTEM "http://example.org/foobar.dtd">
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
]>
<root xmlns:foo="http://example.org/foo"... -
REXML
:: CData . new(text , respect _ whitespace = true , parent = nil) -> REXML :: CData (60.0) -
text をテキストとして持つ CData オブジェクトを生成します。
...ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz "))
doc.to_s # => "<root><![CDATA[foo bar baz ]]></root>\n"
doc = REXML::Document.new(<<EOS)
<root />
EOS
doc.root.add(REXML::CData.new("foo bar baz ", true))
doc.root.add(R......EXML::CData.new("foo bar baz ", false))
doc.to_s # => "<root><![CDATA[foo bar baz ]]><![CDATA[foo bar baz ]]></root>\n"
//}... -
REXML
:: Elements # delete(element) -> Element (54.0) -
element で指定した子要素を取り除きます。
...[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c id="1"/></a>'
b = doc.root.elements[1]
doc.root.elements.delete b # => <b/>
doc.root.to_s # => "<a><c/><c id='1'/></a>"
doc.elements.delete("a/c[@id='1']") # => <c id='1'/>
doc.root.to_s......# => "<a><c/></a>"
doc.root.elements.delete 1 # => <c/>
doc.root.to_s # => "<a/>"
doc.root.elements.delete '/a'
doc.root.to_s # => ""
//}... -
REXML
:: Formatters :: Default (54.0) -
XMLドキュメントを(文字列として)出力するクラスです。
...uby]{
require 'rexml/document'
require 'rexml/formatters/default'
doc = REXML::Document.new <<EOS
<root>
<children>
<grandchildren/>
</children>
</root>
EOS
default_formatter = REXML::Formatters::Default.new
output = StringIO.new
default_formatter.write(doc, output)
output.string
# => "<root>\n<c......hildren>\n <grandchildren/>\n</children>\n</root>\n"
output = StringIO.new
default_formatter.write(REXML::XPath.first(doc, "/root/children"), output)
output.string
# => "<children>\n <grandchildren/>\n</children>"
ie_hack_formatter = REXML::Formatters::Default.new(true)
output = StringIO.new
ie_......hack_formatter.write(doc, output)
output.string
# => "<root>\n<children>\n <grandchildren />\n</children>\n</root>\n"
//}...