graphvizml 0.5.3 → 0.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f91025e58e6fdb9bf6f70e6fc887fc8e6abd519b
4
- data.tar.gz: 012a43379aca125399052ceb02de608f1926db22
3
+ metadata.gz: 78dc36faf679576f5f913a3135a1247b6bbcfeb2
4
+ data.tar.gz: 356e751c7b8dc79f8dc609b586fb49d0c25bce82
5
5
  SHA512:
6
- metadata.gz: c197b2997c70661f337db9b96fb92d35019436856347b828e01f3141f457328c016e1ccba7bc80314aef2433c45fb5de90c5db1f7243c9bb6c3494ac3f8c26f6
7
- data.tar.gz: d0a3df99d9e8da696f4bc39747a6e36fee6afe4803a4325f89b8adc44124278d8335290dbf1bb5c8f28911d9a436788e3d23c63a0804aa43b1849077ca01de78
6
+ metadata.gz: 6ccbb933bfa3271231bca47d52a3a9c8ce5b0a7dec25783dbda8a85938df88463929dd1e901262f3099057c12f32bc3b202a38379cf22a707a4dc38bf4af3e7d
7
+ data.tar.gz: 491c0d9fdf2d41518f8254e3e57f5b3757f33537bda9ebaa3bab3d7b40f1498a8fc9bae244d1c24c1854480f3100b8c8ea0aa8d6b846956d507ec159017e3fb5
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/graphvizml.rb CHANGED
@@ -5,6 +5,7 @@
5
5
 
6
6
  require 'domle'
7
7
  require 'graphviz'
8
+ require 'tempfile'
8
9
 
9
10
 
10
11
  class GraphVizML
@@ -48,17 +49,25 @@ class GraphVizML
48
49
  @g.to_dot
49
50
  end
50
51
 
51
- # writes to a PNG file (not a PNG blob)
52
+ # returns a PNG blob
52
53
  #
53
- def to_png(filename=@filename.sub(/\.xml$/,'.png'))
54
- Graphviz::output(@g, :path => filename)
54
+ def to_png()
55
+ f = Tempfile.new('graphvizml')
56
+ Graphviz::output(@g, output_format: 'png', path: f.path)
57
+ File.read f.path
55
58
  end
56
59
 
57
- # writes to a SVG file (not an SVG blob)
60
+ # returns an SVG blob
58
61
  #
59
- def to_svg(filename=@filename.sub(/\.xml$/,'.svg'))
62
+ def to_svg()
63
+ f = Tempfile.new('graphvizml')
64
+ Graphviz::output(@g, format: 'svg', path: f.path)
65
+ File.read f.path
66
+ end
67
+
68
+ def write(filename)
60
69
  Graphviz::output(@g, :path => filename)
61
- end
70
+ end
62
71
 
63
72
  private
64
73
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphvizml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  0fBBWVqwHyWs77T9gCuDZmQrw2NmfyhNWhBw0iljBXo7WLDNB3x0nP6mYTzk47O8
32
32
  sL5FGYJNgQqFlw==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-09-08 00:00:00.000000000 Z
34
+ date: 2017-09-09 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: domle
metadata.gz.sig CHANGED
Binary file