1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@14303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
gotoyuzo 2007-12-18 13:37:10 +00:00
parent 192ec21adf
commit 06591ad6b1
7 changed files with 15 additions and 9 deletions

View file

@ -1,3 +1,12 @@
Tue Dec 18 22:11:50 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
* 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.
Tue Dec 18 22:12:35 2007 Koichi Sasada <ko1@atdot.net>
* insnhelper.ci, vm.c: rewrite sp manipulation around method/block

View file

@ -1,4 +1,3 @@
require 'base64'
require 'rss/parser'
module RSS

View file

@ -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

View file

@ -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

View file

@ -118,8 +118,7 @@ module WEBrick
proxy_host = proxy.host
proxy_port = proxy.port
if proxy.userinfo
credentials = "Basic " + [proxy.userinfo].pack("m*")
credentials.chomp!
credentials = "Basic " + [proxy.userinfo].pack("m").delete("\n")
header['proxy-authorization'] = credentials
end
end
@ -179,8 +178,7 @@ module WEBrick
if proxy = proxy_uri(req, res)
proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0"
if proxy.userinfo
credentials = "Basic " + [proxy.userinfo].pack("m*")
credentials.chomp!
credentials = "Basic " + [proxy.userinfo].pack("m").delete("\n")
end
host, port = proxy.host, proxy.port
end

View file

@ -570,7 +570,7 @@ EOA
text << char
char.succ!
end
base64_content = Base64.encode64(Zlib::Deflate.deflate(text))
base64_content = [Zlib::Deflate.deflate(text)].pack("m").delete("\n")
[false, true].each do |with_space|
xml_content = base64_content

View file

@ -658,7 +658,7 @@ module RSS
content.content = original_content
xml = REXML::Document.new(content.to_s).root
assert_rexml_element([], {"type" => type},
Base64.encode64(original_content), xml)
[original_content].pack("m").delete("\n"), xml)
end
end