svg_template_to_pdf 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 94286bb0289f93f94bfd32ebe980024f62b6a1eb
4
- data.tar.gz: decca2a8e5a877d1ac93491ea6b4d2c009d5fbaf
3
+ metadata.gz: a6c8933ec11c846615351647706591beb904f458
4
+ data.tar.gz: e3af2100151911bddc88c3009d82ea3eb0e4db68
5
5
  SHA512:
6
- metadata.gz: 24b8b0792da79465a34e76fb6a980c7f927667c6fded1a8425e3c4e55faf83352938af5b0bdd03158a75f406339bd7fb8cef0252e4d7e8f62aa0beaf4d4ebdc6
7
- data.tar.gz: d416e946065c5c49783e7eaacf8f2bb7440fba367b622e0ffdadd3a647299de52d94a83ec08a3f1b8d5950eab6144f06bda3d18f74feac1b4925dd78df7f0903
6
+ metadata.gz: 3d4e36a00627e1538daadab41cdaa84f0d5482c612c5a7ee975e8aedb79cd7897042f2ea325b425bf5ed65109e736eaef5d46e82b45e97afd351cd80a0c22c4f
7
+ data.tar.gz: afc8920352d9aab9665970a39d1a827898dfdd7b4c365ae22c86f98fe0bcd08e5c5c46525c09a9593c35cb44e0168f9f63f00ddea73903fd7d55d6cf538b2262
@@ -14,7 +14,7 @@ class SvgTemplateToPdf
14
14
 
15
15
  # Get header names from svg
16
16
  def variables
17
- result = @input.scan(/%VAR_(\w+)%/).flatten
17
+ result = @svg_input.scan(/%VAR_(\w+)%/).flatten
18
18
  duplicates = get_duplicates(result)
19
19
  raise StandardError, "More than 1 use of variables #{duplicates.join(", ")} in the SVG file." if duplicates.size != 0
20
20
  result
@@ -23,7 +23,7 @@ class SvgTemplateToPdf
23
23
  def process
24
24
  output_files = []
25
25
  CSV.read(@csv_filename, headers: true).each_with_index do |row, i| # for each row produce pdf with data
26
- content = @input.dup
26
+ content = @svg_input.dup
27
27
  variables.each { |col| content.sub!("%VAR_#{col}%", row[col].to_s) }
28
28
  output_files << Svg2pdf.convert_from_data(content, :pdf, working_dir: @output_folder, output_name: "#{@pdf_filename}#{i}")
29
29
  end
@@ -1,3 +1,3 @@
1
1
  class SvgTemplateToPdf
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg_template_to_pdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filip Sakala