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 +4 -4
- data/lib/etassia/native/version.rb +1 -1
- data/lib/etassia/native.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 660f11c843b6f1bd7a1519e7fe03930063ed43fe539b14648c34337a13f464a9
|
|
4
|
+
data.tar.gz: 5bd7dd4f75067961ab0c2fcbc5a0e6f776d87833fbc20549a607350da4cd6492
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8b9f57b14b93cb0de13d40d755deaa1be44a0be3f7cfb5df079885a20fe547562008bbc573f7e76b85763b649ccdcad52718756475743c81687be7ae378c3ecb
|
|
7
|
+
data.tar.gz: c271b127bccecc05d60538ad6b2f3a8ad6b0b9e67d9fa39319679d571607756010f30c49ebb1eecadf1aa18d4e642dbd34d550918ca246947588328de0561403
|
data/lib/etassia/native.rb
CHANGED
|
@@ -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.
|
|
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:
|
|
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: []
|