diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-16 04:39:58 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-10-16 04:39:58 +0000 |
commit | 0ebac90b0ebb07ad2aa99080c8509559a7ddc74d (patch) | |
tree | 4e0e2233ffd5cc0a5e1052471c41d5f3d3172d6e /lib/rss/2.0.rb | |
parent | 64422ae4941480634fbc2788d73ec3ba44c70b4b (diff) | |
download | ruby-0ebac90b0ebb07ad2aa99080c8509559a7ddc74d.tar.gz |
* lib/rss: supported prety print.
* test/rss/test_1.0.rb: added test for calculating default indent size.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rss/2.0.rb')
-rw-r--r-- | lib/rss/2.0.rb | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/rss/2.0.rb b/lib/rss/2.0.rb index c6c6db58a7..c4d055e984 100644 --- a/lib/rss/2.0.rb +++ b/lib/rss/2.0.rb @@ -23,11 +23,11 @@ module RSS install_model(x, occurs) end - def other_element(convert, indent='') + def other_element(convert, indent) rv = <<-EOT -#{indent}#{category_element(convert)} -#{indent}#{generator_element(convert)} -#{indent}#{ttl_element(convert)} +#{category_element(convert, indent)} +#{generator_element(convert, indent)} +#{ttl_element(convert, indent)} EOT rv << super end @@ -73,12 +73,12 @@ EOT install_model(x, occurs) end - def other_element(convert, indent='') + def other_element(convert, indent) rv = <<-EOT -#{indent}#{author_element(false)} -#{indent}#{comments_element(false)} -#{indent}#{pubDate_element(false)} -#{indent}#{guid_element(false)} +#{author_element(false, indent)} +#{comments_element(false, indent)} +#{pubDate_element(false, indent)} +#{guid_element(false, indent)} EOT rv << super end @@ -116,7 +116,7 @@ EOT @content = content end - def to_s(convert=true) + def to_s(convert=true, indent=calc_indent) if @content rv = %Q!<guid! rv << %Q! isPermaLink="#{h @isPermaLink}"! if @isPermaLink |