jsonnet 0.4.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/jsonnet/callbacks.c +1 -1
- data/ext/jsonnet/extconf.rb +37 -8
- data/ext/jsonnet/vm.c +8 -4
- data/lib/jsonnet/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92c5f9344c4b31e1c183acd4e12b5bd596540a13c938a4eb938f0759a754adce
|
4
|
+
data.tar.gz: db67d7972db0f962419dafb2b8ae8fdcd2bd7e3847f6315379a4fdaa1843b3f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b2b912c43980ad07bb4e40c1f467c67b919c80552b6c51984699f9127a645b099e5f43e60bfe2574634d8ba8e9b2116106511ee54880eae2e876aead524169f
|
7
|
+
data.tar.gz: 1aac5b2c3b9047242184d613a26730a4418abbcb35008f1a91c71279d95a6747952c46b39b5720c25ced447e3a325d1b2aef7d7de92fe11775c3033bc734368b
|
data/README.md
CHANGED
@@ -24,7 +24,7 @@ Or install it yourself as:
|
|
24
24
|
$ gem install jsonnet
|
25
25
|
```
|
26
26
|
|
27
|
-
By default this gem will compile and install Jsonnet (v0.
|
27
|
+
By default this gem will compile and install Jsonnet (v0.18.0) as part of
|
28
28
|
installation. However you can use the system version of Jsonnet if you prefer.
|
29
29
|
This would be the recommended route if you want to use a different version
|
30
30
|
of Jsonnet or are having problems installing this.
|
data/ext/jsonnet/callbacks.c
CHANGED
@@ -27,7 +27,7 @@ invoke_callback(VALUE args)
|
|
27
27
|
{
|
28
28
|
long len = RARRAY_LEN(args);
|
29
29
|
VALUE callback = rb_ary_entry(args, 0);
|
30
|
-
return rb_funcall2(callback, id_call, len - 1, RARRAY_PTR(args) + 1);
|
30
|
+
return rb_funcall2(callback, id_call, (int)(len - 1), RARRAY_PTR(args) + 1);
|
31
31
|
}
|
32
32
|
|
33
33
|
/*
|
data/ext/jsonnet/extconf.rb
CHANGED
@@ -13,9 +13,28 @@ unless using_system_libraries?
|
|
13
13
|
require 'mini_portile2'
|
14
14
|
message "Using mini_portile version #{MiniPortile::VERSION}\n"
|
15
15
|
|
16
|
-
recipe = MiniPortile.new('jsonnet', 'v0.
|
17
|
-
recipe.files = ['https://github.com/google/jsonnet/archive/v0.
|
16
|
+
recipe = MiniPortile.new('jsonnet', 'v0.18.0')
|
17
|
+
recipe.files = ['https://github.com/google/jsonnet/archive/v0.18.0.tar.gz']
|
18
18
|
class << recipe
|
19
|
+
CORE_OBJS = %w[
|
20
|
+
desugarer.o formatter.o lexer.o libjsonnet.o parser.o pass.o static_analysis.o string_utils.o vm.o
|
21
|
+
].map {|name| File.join('core', name) }
|
22
|
+
MD5_OBJS = %w[
|
23
|
+
md5.o
|
24
|
+
].map {|name| File.join('third_party', 'md5', name) }
|
25
|
+
C4_CORE_OBJS = %w[
|
26
|
+
base64.o
|
27
|
+
char_traits.o
|
28
|
+
error.o
|
29
|
+
format.o
|
30
|
+
language.o
|
31
|
+
memory_resource.o
|
32
|
+
memory_util.o
|
33
|
+
time.o
|
34
|
+
].map {|name| File.join('third_party', 'rapidyaml', 'rapidyaml', 'ext', 'c4core', 'src', 'c4', name) }
|
35
|
+
RAPID_YAML_OBJS = %w[
|
36
|
+
common.o parse.o preprocess.o tree.o
|
37
|
+
].map {|name| File.join('third_party', 'rapidyaml', 'rapidyaml', 'src', 'c4', 'yml', name) }
|
19
38
|
|
20
39
|
def compile
|
21
40
|
# We want to create a file a library we can link to. Jsonnet provides us
|
@@ -24,7 +43,7 @@ unless using_system_libraries?
|
|
24
43
|
# we compile the c into .o files and then create an archive that can
|
25
44
|
# be linked to
|
26
45
|
execute('compile', make_cmd)
|
27
|
-
execute('archive', 'ar rcs libjsonnet.a
|
46
|
+
execute('archive', 'ar rcs libjsonnet.a ' + target_object_files.join(' '))
|
28
47
|
end
|
29
48
|
|
30
49
|
def configured?
|
@@ -41,6 +60,15 @@ unless using_system_libraries?
|
|
41
60
|
FileUtils.cp(File.join(work_path, 'include', 'libjsonnet.h'), include_path)
|
42
61
|
FileUtils.cp(File.join(work_path, 'include', 'libjsonnet_fmt.h'), include_path)
|
43
62
|
end
|
63
|
+
|
64
|
+
private
|
65
|
+
def target_object_files
|
66
|
+
if version >= 'v0.18.0'
|
67
|
+
CORE_OBJS + MD5_OBJS + C4_CORE_OBJS + RAPID_YAML_OBJS
|
68
|
+
else
|
69
|
+
CORE_OBJS + MD5_OBJS
|
70
|
+
end
|
71
|
+
end
|
44
72
|
end
|
45
73
|
|
46
74
|
recipe.cook
|
@@ -49,11 +77,12 @@ unless using_system_libraries?
|
|
49
77
|
$LIBPATH = ["#{recipe.path}/lib"] | $LIBPATH
|
50
78
|
$CPPFLAGS << " -I#{recipe.path}/include"
|
51
79
|
|
52
|
-
#
|
53
|
-
#
|
54
|
-
|
55
|
-
|
56
|
-
|
80
|
+
# jsonnet_wrap extension must be linked with c++ stdlib because
|
81
|
+
# the C++ library Rapid YAML is being statically linked.
|
82
|
+
rbconfig = RbConfig::MAKEFILE_CONFIG
|
83
|
+
if rbconfig['LDSHAREDXX']
|
84
|
+
rbconfig['LDSHARED'] = rbconfig['LDSHAREDXX']
|
85
|
+
end
|
57
86
|
end
|
58
87
|
|
59
88
|
abort 'libjsonnet.h not found' unless have_header('libjsonnet.h')
|
data/ext/jsonnet/vm.c
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
|
8
8
|
#include "ruby_jsonnet.h"
|
9
9
|
|
10
|
+
#ifndef NORETURN
|
11
|
+
# define NORETURN(x) x
|
12
|
+
#endif
|
13
|
+
|
10
14
|
/*
|
11
15
|
* defines the core part of Jsonnet::VM
|
12
16
|
*/
|
@@ -385,7 +389,7 @@ vm_fmt_snippet(VALUE self, VALUE snippet, VALUE fname)
|
|
385
389
|
void
|
386
390
|
rubyjsonnet_init_vm(VALUE mJsonnet)
|
387
391
|
{
|
388
|
-
cVM = rb_define_class_under(mJsonnet, "VM",
|
392
|
+
cVM = rb_define_class_under(mJsonnet, "VM", rb_cObject);
|
389
393
|
rb_define_singleton_method(cVM, "new", vm_s_new, -1);
|
390
394
|
rb_define_private_method(cVM, "eval_file", vm_evaluate_file, 3);
|
391
395
|
rb_define_private_method(cVM, "eval_snippet", vm_evaluate, 3);
|
@@ -424,7 +428,7 @@ rubyjsonnet_init_vm(VALUE mJsonnet)
|
|
424
428
|
}
|
425
429
|
|
426
430
|
static void
|
427
|
-
raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
|
431
|
+
NORETURN(raise_error)(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
|
428
432
|
{
|
429
433
|
VALUE ex;
|
430
434
|
const int state = rubyjsonnet_jump_tag(msg);
|
@@ -451,13 +455,13 @@ raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding
|
|
451
455
|
* @sa rescue_callback
|
452
456
|
*/
|
453
457
|
static void
|
454
|
-
raise_eval_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
|
458
|
+
NORETURN(raise_eval_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
|
455
459
|
{
|
456
460
|
raise_error(eEvaluationError, vm, msg, enc);
|
457
461
|
}
|
458
462
|
|
459
463
|
static void
|
460
|
-
raise_format_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
|
464
|
+
NORETURN(raise_format_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
|
461
465
|
{
|
462
466
|
raise_error(eFormatError, vm, msg, enc);
|
463
467
|
}
|
data/lib/jsonnet/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonnet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuki Yugui Sonoda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mini_portile2
|
@@ -129,7 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
rubygems_version: 3.
|
132
|
+
rubygems_version: 3.3.7
|
133
133
|
signing_key:
|
134
134
|
specification_version: 4
|
135
135
|
summary: Jsonnet library
|