summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-18 08:58:18 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-18 08:58:18 +0000
commiteb8598146dcaa23230deceddff91e862e26d1b0f (patch)
tree2da1b55d258823ae845f45437f75bc949a7505d2
parentb79b5815f02f74338dcf6d1e9d072564bec78c4f (diff)
* lib/rss/rss.rb: RSS::Element#calc_indent became to be deprecated.
* lib/rss/0.9.rb: ditto. * lib/rss/1.0.rb: ditto. * lib/rss/image.rb: ditto. * lib/rss/taxonomy.rb: ditto. * lib/rss/trackback.rb: ditto. * test/rss/test_1.0.rb: removed RSS::Element.indent_size tests. * test/rss/test_2.0.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--lib/rss/0.9.rb18
-rw-r--r--lib/rss/1.0.rb22
-rw-r--r--lib/rss/image.rb4
-rw-r--r--lib/rss/rss.rb17
-rw-r--r--lib/rss/taxonomy.rb4
-rw-r--r--lib/rss/trackback.rb4
-rw-r--r--test/rss/test_1.0.rb11
-rw-r--r--test/rss/test_2.0.rb17
9 files changed, 42 insertions, 67 deletions
diff --git a/ChangeLog b/ChangeLog
index 3c7936b..9e3c20c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Sun Jun 18 17:52:39 2006 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rss/rss.rb: RSS::Element#calc_indent became to be deprecated.
+ * lib/rss/0.9.rb: ditto.
+ * lib/rss/1.0.rb: ditto.
+ * lib/rss/image.rb: ditto.
+ * lib/rss/taxonomy.rb: ditto.
+ * lib/rss/trackback.rb: ditto.
+
+ * test/rss/test_1.0.rb: removed RSS::Element.indent_size tests.
+ * test/rss/test_2.0.rb: ditto.
+
Sun Jun 18 00:49:11 2006 Tanaka Akira <akr@m17n.org>
* ext/socket/socket.c (bsock_recv_nonblock): new method
diff --git a/lib/rss/0.9.rb b/lib/rss/0.9.rb
index cfd2596..3b193c6 100644
--- a/lib/rss/0.9.rb
+++ b/lib/rss/0.9.rb
@@ -59,7 +59,7 @@ module RSS
end
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent, ns_declarations) do |next_indent|
[
channel_element(false, next_indent),
@@ -153,7 +153,7 @@ module RSS
super()
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
@@ -248,7 +248,7 @@ module RSS
install_model(name, occurs)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
day_elements(false, next_indent)
@@ -293,7 +293,7 @@ module RSS
install_model(name, occurs)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
hour_elements(false, next_indent)
@@ -355,7 +355,7 @@ module RSS
self.description = description
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
url_element(false, next_indent),
@@ -408,7 +408,7 @@ module RSS
self.protocol = protocol
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
@@ -452,7 +452,7 @@ module RSS
install_model(tag, occurs)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
@@ -561,7 +561,7 @@ module RSS
self.type = type
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
@@ -642,7 +642,7 @@ module RSS
self.link = link
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
diff --git a/lib/rss/1.0.rb b/lib/rss/1.0.rb
index 36d6f5d..23b4e99 100644
--- a/lib/rss/1.0.rb
+++ b/lib/rss/1.0.rb
@@ -60,7 +60,7 @@ module RSS
tag_name_with_prefix(PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent, ns_declarations) do |next_indent|
[
channel_element(false, next_indent),
@@ -120,7 +120,7 @@ module RSS
tag_name_with_prefix(PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
@@ -157,7 +157,7 @@ module RSS
@li = li
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
tag(indent) do |next_indent|
[
li_elements(need_convert, next_indent),
@@ -217,7 +217,7 @@ module RSS
@li = li
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
tag(indent) do |next_indent|
[
li_elements(need_convert, next_indent),
@@ -296,7 +296,7 @@ module RSS
self.about = about
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
@@ -367,7 +367,7 @@ module RSS
self.resource = resource
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
@@ -404,7 +404,7 @@ module RSS
self.resource = resource
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
@@ -441,7 +441,7 @@ module RSS
@Seq = seq
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
Seq_element(need_convert, next_indent),
@@ -512,7 +512,7 @@ module RSS
self.about = about
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
@@ -582,7 +582,7 @@ module RSS
self.about = about
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
@@ -657,7 +657,7 @@ module RSS
self.about = about
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
title_element(false, next_indent),
diff --git a/lib/rss/image.rb b/lib/rss/image.rb
index b81b725..f499a75 100644
--- a/lib/rss/image.rb
+++ b/lib/rss/image.rb
@@ -83,7 +83,7 @@ module RSS
tag_name_with_prefix(IMAGE_PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
other_element(false, next_indent),
@@ -187,7 +187,7 @@ module RSS
tag_name_with_prefix(IMAGE_PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
other_element(false, next_indent),
diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb
index c36cee0..3ef5db1 100644
--- a/lib/rss/rss.rb
+++ b/lib/rss/rss.rb
@@ -380,7 +380,7 @@ EOC
def def_content_only_to_s
module_eval(<<-EOC, *get_file_and_line_from_caller(2))
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
if @content
rv = tag(indent) do |next_indent|
h(@content)
@@ -445,7 +445,6 @@ EOC
@tag_name = name.split(/::/).last
@tag_name[0,1] = @tag_name[0,1].downcase
- @indent_size = name.split(/::/).size - 2
@have_content = false
def self.must_call_validators
@@ -547,11 +546,6 @@ EOC
def tag_name
@tag_name
end
-
- def indent_size
- @indent_size
- end
-
end
attr_accessor :do_validate
@@ -570,10 +564,6 @@ EOC
tag_name
end
- def indent_size
- self.class.indent_size
- end
-
def converter=(converter)
@converter = converter
targets = children.dup
@@ -682,9 +672,10 @@ EOC
def tag_name_with_prefix(prefix)
"#{prefix}:#{tag_name}"
end
-
+
+ # For backward compatibility
def calc_indent
- INDENT * (self.class.indent_size)
+ ''
end
def maker_target(maker)
diff --git a/lib/rss/taxonomy.rb b/lib/rss/taxonomy.rb
index 5226713..93eeac7 100644
--- a/lib/rss/taxonomy.rb
+++ b/lib/rss/taxonomy.rb
@@ -81,7 +81,7 @@ module RSS
target.taxo_topics
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
Bag_element(need_convert, next_indent),
@@ -164,7 +164,7 @@ module RSS
tag_name_with_prefix(TAXO_PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent) do |next_indent|
[
other_element(need_convert, next_indent),
diff --git a/lib/rss/trackback.rb b/lib/rss/trackback.rb
index ad6954f..befeea1 100644
--- a/lib/rss/trackback.rb
+++ b/lib/rss/trackback.rb
@@ -143,7 +143,7 @@ module RSS
tag_name_with_prefix(TRACKBACK_PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
@@ -193,7 +193,7 @@ module RSS
tag_name_with_prefix(TRACKBACK_PREFIX)
end
- def to_s(need_convert=true, indent=calc_indent)
+ def to_s(need_convert=true, indent='')
rv = tag(indent)
rv = convert(rv) if need_convert
rv
diff --git a/test/rss/test_1.0.rb b/test/rss/test_1.0.rb
index 3266e00..ff3c8a4 100644
--- a/test/rss/test_1.0.rb
+++ b/test/rss/test_1.0.rb
@@ -245,16 +245,5 @@ module RSS
rss20 = RSS::Parser.parse(rss.to_xml("2.0"))
assert_equal("2.0", rss20.rss_version)
end
-
- def test_indent_size
- assert_equal(0, RDF.indent_size)
- assert_equal(1, RDF::Channel.indent_size)
- assert_equal(2, RDF::Channel::Image.indent_size)
- assert_equal(2, RDF::Channel::Textinput.indent_size)
- assert_equal(2, RDF::Channel::Items.indent_size)
- assert_equal(1, RDF::Image.indent_size)
- assert_equal(1, RDF::Item.indent_size)
- assert_equal(1, RDF::Textinput.indent_size)
- end
end
end
diff --git a/test/rss/test_2.0.rb b/test/rss/test_2.0.rb
index b0e6b17..d39c297 100644
--- a/test/rss/test_2.0.rb
+++ b/test/rss/test_2.0.rb
@@ -386,22 +386,5 @@ module RSS
rss10 = RSS::Parser.parse(rss10)
assert_equal("1.0", rss10.rss_version)
end
-
- def test_indent_size
- assert_equal(0, Rss.indent_size)
- assert_equal(1, Rss::Channel.indent_size)
- assert_equal(2, Rss::Channel::SkipDays.indent_size)
- assert_equal(3, Rss::Channel::SkipDays::Day.indent_size)
- assert_equal(2, Rss::Channel::SkipHours.indent_size)
- assert_equal(3, Rss::Channel::SkipHours::Hour.indent_size)
- assert_equal(2, Rss::Channel::Image.indent_size)
- assert_equal(2, Rss::Channel::Cloud.indent_size)
- assert_equal(2, Rss::Channel::Item.indent_size)
- assert_equal(3, Rss::Channel::Item::Source.indent_size)
- assert_equal(3, Rss::Channel::Item::Enclosure.indent_size)
- assert_equal(3, Rss::Channel::Item::Category.indent_size)
- assert_equal(3, Rss::Channel::Item::Guid.indent_size)
- assert_equal(2, Rss::Channel::TextInput.indent_size)
- end
end
end