ruby_tree_sitter 0.20.6.3-x86_64-linux → 0.20.8.1-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: 66f3c718ba1bb03d6db4b418d6ca9e6fa11a071f2d07379497d57298b57415c2
4
- data.tar.gz: e25e0f44fc08cfacdc5f6aced98a26b127294726a835a41a605996189f5d317e
3
+ metadata.gz: 7a6f2bbfd48e8ad005f6a1492fe5a77744d96ebbdefcfbb4444b4feb585793fa
4
+ data.tar.gz: 27a035bbd5cc1ed84dd0ff0677022841f9f7a404d0bb28513fbb5ea8b1fc9626
5
5
  SHA512:
6
- metadata.gz: 628079b69ee0279679074bf76b8be2d179aa0fb0f419e306dce7472450389a6106ff049767a4d7a8b3ac756b458b0bc5cb0afb7658b740160cb2be29b1473dc9
7
- data.tar.gz: aba7b46de4bc19d453cac906ca7784b4be2ba6a9482d6061e7a1ff15b86ca6a80173931c0f9ebc655785fd8e7ffd4f149a9e5d10cf5db499ff7a045dd70f90f8
6
+ metadata.gz: 27e3aed67258cfbc6684101d0e1c44ea2fdc852627001feb5c921353bc562a542f0c1c160d6e7f83fc7484842e69a3e1848fa55e58993b3a416832d8bfeca6aa
7
+ data.tar.gz: 3ec4660b0996197367f76821fa1fc5bd4522658871eda1326a9470241fa144da3a5a4b976245147ee50bb9576dac385d043cd869e3e8cf47fd05cba584675083
data/README.md CHANGED
@@ -41,8 +41,8 @@ allows us to better experiment, and easily port ideas from other projects.
41
41
  This gem follows the `tree-sitter` versioning scheme, and appends its own
42
42
  version at the end.
43
43
 
44
- For instance, `tree-sitter` is now at version `0.20.6`, so this gem's version
45
- will be `0.20.6.x` where x is incremented with every notable batch of
44
+ For instance, `tree-sitter` is now at version `0.20.8`, so this gem's version
45
+ will be `0.20.8.x` where x is incremented with every notable batch of
46
46
  bugfixes or some ruby-only additions.
47
47
 
48
48
  ## Dependencies
@@ -100,20 +100,25 @@ static VALUE tree_changed_ranges(VALUE _self, VALUE old_tree, VALUE new_tree) {
100
100
  static VALUE tree_print_dot_graph(VALUE self, VALUE file) {
101
101
  Check_Type(file, T_STRING);
102
102
  char *path = StringValueCStr(file);
103
- FILE *fd = fopen(path, "w+");
103
+ int fd = open(path, O_CREAT | O_WRONLY | O_TRUNC,
104
+ S_IWUSR | S_IRUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
105
+ if (fd < 0) {
106
+ rb_raise(rb_eRuntimeError, "Could not open file `%s'.\nReason:\n%s", path,
107
+ strerror(fd));
108
+ return Qnil;
109
+ }
104
110
  ts_tree_print_dot_graph(SELF, fd);
105
- fclose(fd);
111
+ close(fd);
106
112
  return Qnil;
107
113
  }
108
114
 
109
115
  static VALUE tree_finalizer(VALUE _self) {
110
116
  VALUE rc = rb_cv_get(cTree, "@@rc");
111
117
  VALUE keys = rb_funcall(rc, rb_intern("keys"), 0);
112
- VALUE *elements = RARRAY_PTR(keys);
113
118
  long len = RARRAY_LEN(keys);
114
119
 
115
120
  for (long i = 0; i < len; ++i) {
116
- VALUE curr = elements[i];
121
+ VALUE curr = RARRAY_AREF(keys, i);
117
122
  unsigned int val = NUM2UINT(rb_hash_lookup(rc, curr));
118
123
  if (val > 0) {
119
124
  ts_tree_delete((TSTree *)NUM2ULONG(curr));
Binary file
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TreeSitter
4
- VERSION = '0.20.6.3'
4
+ VERSION = '0.20.8.1'
5
5
  end
@@ -38,7 +38,7 @@ end
38
38
 
39
39
  describe 'print_dot_graph' do
40
40
  it 'must save to disk' do
41
- dot = File.expand_path('tmp/tree-dot.gv', FileUtils.getwd)
41
+ dot = File.expand_path('/tmp/tree-dot.gv', FileUtils.getwd)
42
42
  tree.print_dot_graph(dot)
43
43
 
44
44
  assert File.exist?(dot), 'dot file must be exist'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_tree_sitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.6.3
4
+ version: 0.20.8.1
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Firas al-Khalil
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-11 00:00:00.000000000 Z
11
+ date: 2023-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  - !ruby/object:Gem::Version
177
177
  version: '0'
178
178
  requirements: []
179
- rubygems_version: 3.4.6
179
+ rubygems_version: 3.4.10
180
180
  signing_key:
181
181
  specification_version: 4
182
182
  summary: Ruby bindings for Tree-Sitter