Skip to content

Commit

Permalink
* lib/xmlrpc, lib/rexml, test/ruby/test_array.rb,
Browse files Browse the repository at this point in the history
  test/ruby/test_unicode_escape.rb, test/scanf/test_scanf.rb,
  test/rss/rss-assertions.rb: fix indentation to remove warning.


git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
mame committed Oct 1, 2008
1 parent 1d94b0d commit f62b901
Show file tree
Hide file tree
Showing 40 changed files with 2,245 additions and 2,239 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
Wed Oct 1 22:43:59 2008 Yusuke Endoh <mame@tsg.ne.jp>

* lib/xmlrpc, lib/rexml, test/ruby/test_array.rb,
test/ruby/test_unicode_escape.rb, test/scanf/test_scanf.rb,
test/rss/rss-assertions.rb: fix indentation to remove warning.

Wed Oct 1 21:36:35 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>

* gc.c (rb_gc_call_finalizer_at_exit): finalize deferred IO and Data.
Expand Down
100 changes: 50 additions & 50 deletions lib/rexml/attlistdecl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,60 +3,60 @@
require 'rexml/source'

module REXML
# This class needs:
# * Documentation
# * Work! Not all types of attlists are intelligently parsed, so we just
# spew back out what we get in. This works, but it would be better if
# we formatted the output ourselves.
#
# AttlistDecls provide *just* enough support to allow namespace
# declarations. If you need some sort of generalized support, or have an
# interesting idea about how to map the hideous, terrible design of DTD
# AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
# for anything to make DTDs more palateable.
class AttlistDecl < Child
include Enumerable
# This class needs:
# * Documentation
# * Work! Not all types of attlists are intelligently parsed, so we just
# spew back out what we get in. This works, but it would be better if
# we formatted the output ourselves.
#
# AttlistDecls provide *just* enough support to allow namespace
# declarations. If you need some sort of generalized support, or have an
# interesting idea about how to map the hideous, terrible design of DTD
# AttlistDecls onto an intuitive Ruby interface, let me know. I'm desperate
# for anything to make DTDs more palateable.
class AttlistDecl < Child
include Enumerable

# What is this? Got me.
attr_reader :element_name
# What is this? Got me.
attr_reader :element_name

# Create an AttlistDecl, pulling the information from a Source. Notice
# that this isn't very convenient; to create an AttlistDecl, you basically
# have to format it yourself, and then have the initializer parse it.
# Sorry, but for the forseeable future, DTD support in REXML is pretty
# weak on convenience. Have I mentioned how much I hate DTDs?
def initialize(source)
super()
if (source.kind_of? Array)
@element_name, @pairs, @contents = *source
end
end
# Access the attlist attribute/value pairs.
# value = attlist_decl[ attribute_name ]
def [](key)
@pairs[key]
end
# Create an AttlistDecl, pulling the information from a Source. Notice
# that this isn't very convenient; to create an AttlistDecl, you basically
# have to format it yourself, and then have the initializer parse it.
# Sorry, but for the forseeable future, DTD support in REXML is pretty
# weak on convenience. Have I mentioned how much I hate DTDs?
def initialize(source)
super()
if (source.kind_of? Array)
@element_name, @pairs, @contents = *source
end
end
# Access the attlist attribute/value pairs.
# value = attlist_decl[ attribute_name ]
def [](key)
@pairs[key]
end

# Whether an attlist declaration includes the given attribute definition
# if attlist_decl.include? "xmlns:foobar"
def include?(key)
@pairs.keys.include? key
end
# Whether an attlist declaration includes the given attribute definition
# if attlist_decl.include? "xmlns:foobar"
def include?(key)
@pairs.keys.include? key
end

# Iterate over the key/value pairs:
# attlist_decl.each { |attribute_name, attribute_value| ... }
def each(&block)
@pairs.each(&block)
end
# Iterate over the key/value pairs:
# attlist_decl.each { |attribute_name, attribute_value| ... }
def each(&block)
@pairs.each(&block)
end

# Write out exactly what we got in.
def write out, indent=-1
out << @contents
end
# Write out exactly what we got in.
def write out, indent=-1
out << @contents
end

def node_type
:attlistdecl
end
end
def node_type
:attlistdecl
end
end
end
Loading

0 comments on commit f62b901

Please sign in to comment.