summaryrefslogtreecommitdiff
path: root/lib/rss
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rss')
-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
6 files changed, 30 insertions, 39 deletions
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