Mercurial > hg > soundsoftware-site
comparison lib/SVG/Graph/Graph.rb @ 1464:261b3d9a4903 redmine-2.4
Update to Redmine 2.4 branch rev 12663
author | Chris Cannam |
---|---|
date | Tue, 14 Jan 2014 14:37:42 +0000 |
parents | 3e4c3460b6ca |
children |
comparison
equal
deleted
inserted
replaced
1296:038ba2d95de8 | 1464:261b3d9a4903 |
---|---|
1 begin | 1 begin |
2 require 'zlib' | 2 require 'zlib' |
3 @@__have_zlib = true | |
4 rescue | 3 rescue |
5 @@__have_zlib = false | 4 # Zlib not available |
6 end | 5 end |
7 | 6 |
8 require 'rexml/document' | 7 require 'rexml/document' |
9 | 8 |
10 module SVG | 9 module SVG |
209 | 208 |
210 data = "" | 209 data = "" |
211 @doc.write( data, 0 ) | 210 @doc.write( data, 0 ) |
212 | 211 |
213 if @config[:compress] | 212 if @config[:compress] |
214 if @@__have_zlib | 213 if Object.const_defined?(:Zlib) |
215 inp, out = IO.pipe | 214 inp, out = IO.pipe |
216 gz = Zlib::GzipWriter.new( out ) | 215 gz = Zlib::GzipWriter.new( out ) |
217 gz.write data | 216 gz.write data |
218 gz.close | 217 gz.close |
219 data = inp.read | 218 data = inp.read |