svg2img 0.2.0-x86_64-linux → 0.2.2-x86_64-linux

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
  SHA256:
3
- metadata.gz: cb45feae53bf81f067ebf6594892164044ee6c892406d5bef31ff651294ae2ba
4
- data.tar.gz: f2336c48fc8487b51e322194ebd7ec1cd1064b9e4c07521f9c437547812ebd3e
3
+ metadata.gz: 75bc20459bde33a9221de4c8822b37aa7374e3a5c97caaca483339058acf3576
4
+ data.tar.gz: 895d379a281151ebc0378f6b1d0fd2a2aa1c263a6c520500ceb193d8890f16b7
5
5
  SHA512:
6
- metadata.gz: c90f8f7858bb5f8d46325c6f1c516449c19769f00467a1a65387e2de9a8ead140fcec6f4e7ac2105bc9b2ea01aade8efee38120ce67d23fca1f97061da39679f
7
- data.tar.gz: c3f89496e7cc5ae490630468e549ade5354ce37eed37b4cb8529497a7b471191cbd44594071e0774841ee337b743197d2ee4c8fce166db4afeb1a6309be786cb
6
+ metadata.gz: 17a2172dcca3e77003bf6835c91f42beed2885b54af7c0c88f28c2e824daaea640b6ad89c54e024a084bbab6e036c2708803500f9586f54ae9b0f4f0dc235b11
7
+ data.tar.gz: 281d768ea199abe60902c4a59d28422d3edc4d21f3f597ae58e6cb0c118d854d07224ea3349f8794d26d0a9de2ab1a6de51f20ece4370b5f9312bb2fa7006979
data/README.md CHANGED
@@ -40,6 +40,11 @@ bundle lock --add-platform arm64-darwin # Apple Silicon MacOS (i.e. M1)
40
40
 
41
41
  ## Usage
42
42
 
43
+ ```ruby
44
+ require "svg2img"
45
+ Svg2Img.process_svg(svg_string, options)
46
+ ```
47
+
43
48
  Example usage:
44
49
 
45
50
  ```ruby
@@ -50,12 +55,12 @@ circle_svg = <<~SVG
50
55
  <circle cx="50" cy="50" r="40" stroke="black" stroke-width="3" fill="red" />
51
56
  </svg>
52
57
  SVG
53
- png_path = Svg2Img.process_svg(circle_svg, output_format: :png)
58
+ png_path = Svg2Img.process_svg(circle_svg, format: :png)
54
59
  # png_path is a path to the generated PNG file
55
60
 
56
61
  # Rails example
57
62
  data = Rails.cache.fetch([some, deps]) do
58
- png_path = Svg2Img.process_svg(circle_svg, output_format: :png, size: proc {|_svg_width, _svg_height| [256, 256]})
63
+ png_path = Svg2Img.process_svg(circle_svg, format: :png, size: proc {|_svg_width, _svg_height| [256, 256]})
59
64
  png_data = File.binread(png_path)
60
65
  File.delete(png_path)
61
66
  png_data
@@ -65,7 +70,8 @@ send_data(png_data, type: 'image/png', disposition: 'inline')
65
70
 
66
71
  ### Options
67
72
 
68
- - `output_format` - output format, one of `:png`, `:jpg`, `:webp`, `:gif`
73
+ - `format` - output format, one of `:png`, `:jpg`, `:webp`, `:gif`
74
+ - `output_path` - path to the output image. If not provided, a temporary file will be created and the path to it will be returned.
69
75
  - `size` - size of the output image as a proc that receives the width and height of the SVG and returns an array with the width and height of the output image. If the provides size has a different aspect ratio than the SVG, the image will be resized to fit in the center of the provided size. If not provided, the output image will have the same size as the SVG.
70
76
 
71
77
  ## Development
Binary file
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Svg2Img
4
- VERSION = "0.2.0"
4
+ VERSION = "0.2.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: svg2img
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.2
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Orvar Segerström
@@ -20,6 +20,7 @@ files:
20
20
  - LICENSE.txt
21
21
  - README.md
22
22
  - lib/svg2img.rb
23
+ - lib/svg2img/3.1/svg2img.so
23
24
  - lib/svg2img/3.2/svg2img.so
24
25
  - lib/svg2img/3.3/svg2img.so
25
26
  - lib/svg2img/version.rb
@@ -38,7 +39,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
38
39
  requirements:
39
40
  - - ">="
40
41
  - !ruby/object:Gem::Version
41
- version: '3.2'
42
+ version: '3.1'
42
43
  - - "<"
43
44
  - !ruby/object:Gem::Version
44
45
  version: 3.4.dev