universa 0.2.3 → 0.2.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 +4 -4
- data/lib/universa/umi.rb +31 -23
- data/lib/universa/version.rb +1 -1
- 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: e1074fb463df9773322f96a839584fe34062586a808296be953360f4dc0f7deb
|
4
|
+
data.tar.gz: 597cb764db52578dc54a2026ede9039cd0b7d58a00baaaed9966f4596f06cebf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 229f6752e523b12cb8f831c40df5c4906907c296ae6e3daf1ad29f26dfce85900d70ab55b91431ac94ed8d8c4761777cb54d6f109afaeb72a71a2ce921b0ae64
|
7
|
+
data.tar.gz: ac84e741062e461f0d4f3cfc8f86f946f37be818cd76541df806d3ab9fdf5114278698b83d6cc22ea74edce3fd7d3b69bcf7628948b83a507580225276500a66
|
data/lib/universa/umi.rb
CHANGED
@@ -235,30 +235,38 @@ module Universa
|
|
235
235
|
# convert ruby arguments array to corresponding UMI values
|
236
236
|
def prepare_args args
|
237
237
|
raise "pp bug" if args == [:pretty_print] # this often happens whilte tracing
|
238
|
-
args.map {|x|
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
238
|
+
args.map {|x| prepare x }
|
239
|
+
end
|
240
|
+
|
241
|
+
# convert single argument to UMI value to pass
|
242
|
+
def prepare(x)
|
243
|
+
if x.respond_to?(:_as_umi_arg)
|
244
|
+
x._as_umi_arg(self)
|
245
|
+
else
|
246
|
+
case x
|
247
|
+
when Array
|
248
|
+
# deep convert all array items
|
249
|
+
x.map{|a| prepare a }
|
250
|
+
when Set
|
251
|
+
# Make a Java Set
|
252
|
+
r = call("instantiate", "Set", x.to_a.map {|i| i._as_umi_arg(self)})
|
253
|
+
# Ref will garbage collect it
|
254
|
+
Ref.new(self, r)
|
255
|
+
# but we need a ref struct only:
|
256
|
+
r
|
257
|
+
when Time
|
258
|
+
{__type: 'unixtime', seconds: x.to_i}
|
259
|
+
when String
|
260
|
+
x.encoding == Encoding::BINARY ? {__type: 'binary', base64: Base64.encode64(x)} : x
|
261
|
+
when Ref
|
262
|
+
x._as_umi_arg(self)
|
263
|
+
when RemoteAdapter
|
264
|
+
# this need special treatment with direct call:
|
265
|
+
x.__getobj__._as_umi_arg(self)
|
266
|
+
else
|
267
|
+
x
|
260
268
|
end
|
261
|
-
|
269
|
+
end
|
262
270
|
end
|
263
271
|
|
264
272
|
# Convert remote call result from UMI structures to ruby types
|
data/lib/universa/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: universa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sergeych
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: farcall
|