From 92f480254b9c33907f92c74ad195327cfda2ed6f Mon Sep 17 00:00:00 2001 From: gotoyuzo Date: Tue, 18 Dec 2007 13:37:10 +0000 Subject: * lib/rss/parser.rb, lib/rss/atom.rb, lib/rss/rss.rb, test/rss/rss-assertions.rb, test/rss/test_atom.rb: use pack/unpack("m") instead of base64 library. * lib/webrick/httpproxy.rb: use delete("\n") instead of chomp/chop because the result of pack("m") might be multi-line. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@14303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rss/atom.rb | 1 - lib/rss/parser.rb | 2 +- lib/rss/rss.rb | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) (limited to 'lib/rss') diff --git a/lib/rss/atom.rb b/lib/rss/atom.rb index 7cba934fe..10282a874 100644 --- a/lib/rss/atom.rb +++ b/lib/rss/atom.rb @@ -1,4 +1,3 @@ -require 'base64' require 'rss/parser' module RSS diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb index b716dd8bd..7f5f57a1e 100644 --- a/lib/rss/parser.rb +++ b/lib/rss/parser.rb @@ -474,7 +474,7 @@ module RSS else if klass.have_content? if @last_element.need_base64_encode? - text = Base64.decode64(text.lstrip) + text = text.lstrip.unpack("m").first end @last_element.content = text end diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 0242a2a6a..32741b03d 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -1201,7 +1201,7 @@ EOC __send__(self.class.xml_getter).to_s else _content = content - _content = Base64.encode64(_content) if need_base64_encode? + _content = [_content].pack("m").delete("\n") if need_base64_encode? h(_content) end end -- cgit