etassia-native 0.1.0 → 0.1.1

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: ad82fe8761289ebe9e5a7774a68667f747318cfc6c07eaedaa5a459b15bdcdef
4
- data.tar.gz: d09df242a26ebbbe0019de672709091a8af7ef28b6890467bb551654ea3c8d77
3
+ metadata.gz: 660f11c843b6f1bd7a1519e7fe03930063ed43fe539b14648c34337a13f464a9
4
+ data.tar.gz: 5bd7dd4f75067961ab0c2fcbc5a0e6f776d87833fbc20549a607350da4cd6492
5
5
  SHA512:
6
- metadata.gz: 654196fe987e74cbedd99d6edb3e34113c495aeeb373331bccb0a8bee3f040d46155119f0010ce2867489f3a7ed3cd08bc7e82c35c9d1205e2e3cd22c67c1ddf
7
- data.tar.gz: 84080656b0b0eb0c44d8b7c95c788d25d69dbf30f57362eca88b948c3aa98402209b52bdda4731f30044e5b3e159d892c3af687bf403619e5d7b40388e649e73
6
+ metadata.gz: 8b9f57b14b93cb0de13d40d755deaa1be44a0be3f7cfb5df079885a20fe547562008bbc573f7e76b85763b649ccdcad52718756475743c81687be7ae378c3ecb
7
+ data.tar.gz: c271b127bccecc05d60538ad6b2f3a8ad6b0b9e67d9fa39319679d571607756010f30c49ebb1eecadf1aa18d4e642dbd34d550918ca246947588328de0561403
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Etassia
4
4
  module Native
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
@@ -58,6 +58,7 @@ module Etassia
58
58
 
59
59
  ffi_lib path
60
60
  attach_function :etassia_render, %i[pointer size_t pointer], buf.by_value
61
+ attach_function :etassia_render_dim, %i[pointer size_t], buf.by_value
61
62
  attach_function :etassia_detect, %i[pointer size_t], buf.by_value
62
63
  attach_function :etassia_free, [buf.by_value], :void
63
64
  end
@@ -68,6 +69,11 @@ module Etassia
68
69
  take(@lib.etassia_render(ptr, len, nil))
69
70
  end
70
71
 
72
+ def render_dim(source)
73
+ ptr, len = input(source)
74
+ take(@lib.etassia_render_dim(ptr, len))
75
+ end
76
+
71
77
  def detect(source)
72
78
  ptr, len = input(source)
73
79
  take(@lib.etassia_detect(ptr, len))
@@ -139,6 +145,16 @@ module Etassia
139
145
  lib.detect(source)
140
146
  end
141
147
 
148
+ # SVG for a DIM document. Native only: DIM has no pure-Ruby
149
+ # implementation, so there is no fallback path; without a library
150
+ # this raises Unavailable.
151
+ def render_dim(source)
152
+ lib = library or raise Unavailable,
153
+ "#{LIBRARY_ENV} not set and no #{library_filename} in the gem or under target/"
154
+
155
+ lib.render_dim(source)
156
+ end
157
+
142
158
  def library
143
159
  path = library_path
144
160
  return nil if path.nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etassia-native
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
  - Etassia contributors
@@ -47,7 +47,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  - !ruby/object:Gem::Version
48
48
  version: '0'
49
49
  requirements: []
50
- rubygems_version: 4.0.23
50
+ rubygems_version: 3.6.9
51
51
  specification_version: 4
52
52
  summary: Ruby binding to the etassia-ffi C ABI, with a pure-Ruby fallback
53
53
  test_files: []