Fixed: warning: class variable access from toplevel on Ruby 2.0 (#14511).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12052 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2013-07-28 11:57:39 +00:00
parent 642a892c05
commit 9a0db9cb88
1 changed files with 2 additions and 3 deletions

View File

@ -1,8 +1,7 @@
begin begin
require 'zlib' require 'zlib'
@@__have_zlib = true
rescue rescue
@@__have_zlib = false # Zlib not available
end end
require 'rexml/document' require 'rexml/document'
@ -211,7 +210,7 @@ module SVG
@doc.write( data, 0 ) @doc.write( data, 0 )
if @config[:compress] if @config[:compress]
if @@__have_zlib if Object.const_defined?(:Zlib)
inp, out = IO.pipe inp, out = IO.pipe
gz = Zlib::GzipWriter.new( out ) gz = Zlib::GzipWriter.new( out )
gz.write data gz.write data