svg_export 0.0.3 → 0.0.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: 6675767b2630a4b14212a2af8c67a93de82567d6
4
- data.tar.gz: 44aa32dcd6a7d5313c561c9de1206a0592170adf
3
+ metadata.gz: 07072ca352508b8fbe82c6d06f2b70a35dafa356
4
+ data.tar.gz: 33cba0193c62d8f1820bafd58d6359319a216015
5
5
  SHA512:
6
- metadata.gz: a182371837f794aaa8a25eb8dab100b57299cef19dd0c64b825bb6712f72e362b219a776edcd7c8483348685eda0e9659d6c4dbff1045107a1cc393a4449af39
7
- data.tar.gz: d49b58b7743670f25a7448467461d79f5bc85654b2892aba6e46de80d4102a098643313dba8d06f10385a5ee9734ac49281970b4c0e1d863735dee8d972d71c1
6
+ metadata.gz: 8c4ccdaf86a012e97567b48c1277c2ba6beabbee92908c90477416ed685c28b793f2a031b43fd7a4c85e4c90d925ebb5b4864625d20ff4f738a57fad71b23d53
7
+ data.tar.gz: db27bb1987f37e104cfe4efdfa90a7d6e560adb5d24de9fbdbc9ae44d3ad6617dbb07711363d7c1890bc5dbd4ad52891fde5d3b2a6c43d5f27928938c9c45a0d
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Gem Version](https://badge.fury.io/rb/svg_export.svg)](http://badge.fury.io/rb/svg_export)
2
+
1
3
  # Svg-Export Engine for Ruby on Rails
2
4
 
3
5
  Highcharts compliant svg-rasterizer. To find more about Highcharts Exporting, look [here](http://www.highcharts.com/docs/export-module/export-module-overview)
@@ -14,6 +14,7 @@ module SvgExport
14
14
  return
15
15
  end
16
16
  send_file file, type: wrapper.type, filename: wrapper.filename, disposition: 'attachment', stream: false
17
+
17
18
  end
18
19
  end
19
20
  end
@@ -12,6 +12,9 @@ module SvgExport
12
12
  def call
13
13
  transformer = @svg_transformer.new(@options)
14
14
  svg = transformer.transform(params[:svg])
15
+ File.open('/tmp/jobwert-export-last.svg', 'w+') do |f|
16
+ f.write svg
17
+ end
15
18
  infile.write(svg)
16
19
  infile.flush
17
20
  result = run!
@@ -19,6 +22,7 @@ module SvgExport
19
22
  if fs.nil? || fs < 10
20
23
  raise SvgExport::Error.new( "Output file empty; #{result}")
21
24
  end
25
+ transformer.clear!
22
26
  File.open(outfile)
23
27
  end
24
28
 
@@ -5,6 +5,12 @@ module SvgExport
5
5
  @base_url = options[:base_url]
6
6
  end
7
7
 
8
+ def clear!
9
+ @tempfiles.each do |tf|
10
+ tf.unlink
11
+ end
12
+ end
13
+
8
14
  def transform(svg)
9
15
  doc = Nokogiri::XML.parse(svg)
10
16
  doc.search('image').each do |image|
@@ -48,7 +54,12 @@ module SvgExport
48
54
  end
49
55
  end
50
56
  end
51
- nil
57
+ without_hash = partial_path.gsub(/-([0-9a-f]+)(\.\w+)$/, '\2')
58
+ if without_hash != partial_path
59
+ find_asset_path(without_hash)
60
+ else
61
+ nil
62
+ end
52
63
  end
53
64
  end
54
65
  end
@@ -1,3 +1,3 @@
1
1
  module SvgExport
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg_export
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Wienert