ruby_tree_sitter 0.20.6.3 → 0.20.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 828f990fa56f7b0d11f29d78e6e9db76e3fcf396efa7dbeb1bd2c1970e91c803
4
- data.tar.gz: f606ad470989a4cff66f221e2b46aa9e7b20dcc32f3222ff917670202002e633
3
+ metadata.gz: 94cb2ce80adc91e98ee79fb48b89a8f35b750b57b38272d0f1256a2641b36434
4
+ data.tar.gz: a84e39a7e69d457f187ae20627a03a19476a6956ba05fe53d3088cd4ae899e22
5
5
  SHA512:
6
- metadata.gz: bf61b4c1c9dbab462e394f37c699faa13bed918dc8a8e30042729104c6f50985948e919da6384e2e1dd58b58fe10fc997f85cebd575eabf4244ad27f6a3d5dc3
7
- data.tar.gz: 82195400b664a2c99689526f5cbf0bcc7e5def7ad659e7e253197df68988b18f3afbe2242141867c486fc28463ff64326a4a7b88567a4f38841d7209ef960b0b
6
+ metadata.gz: c9d6f4150314194818f1d61030324b32ff763d2d0c799a76373ec6e4d3d1fc85b660c8848df867c73eafb3903ac426f684010465cedcbd1e1a11d2cfbc11efdc
7
+ data.tar.gz: aeed7a952d3b640d8f9bc2c35abf73e05f3c0d921f13776ca938b6dbdaf21eaec97f617ee6984f399ab320c2066b383cc081aee287a3ac2123c6e0185ff5df74
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));
@@ -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: ruby
6
6
  authors:
7
7
  - Firas al-Khalil
8
- autorequire:
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
@@ -108,7 +108,7 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
- description:
111
+ description:
112
112
  email:
113
113
  - firasalkhalil@gmail.com
114
114
  executables: []
@@ -158,7 +158,7 @@ homepage: https://www.github.com/Faveod/ruby-tree-sitter
158
158
  licenses:
159
159
  - MIT
160
160
  metadata: {}
161
- post_install_message:
161
+ post_install_message:
162
162
  rdoc_options: []
163
163
  require_paths:
164
164
  - lib
@@ -173,17 +173,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  requirements: []
176
- rubygems_version: 3.1.6
177
- signing_key:
176
+ rubygems_version: 3.4.10
177
+ signing_key:
178
178
  specification_version: 4
179
179
  summary: Ruby bindings for Tree-Sitter
180
180
  test_files:
181
- - test/tree_sitter/query_test.rb
182
- - test/tree_sitter/node_test.rb
183
- - test/tree_sitter/tree_cursor_test.rb
181
+ - test/README.md
182
+ - test/test_helper.rb
184
183
  - test/tree_sitter/language_test.rb
185
184
  - test/tree_sitter/logger_test.rb
185
+ - test/tree_sitter/node_test.rb
186
186
  - test/tree_sitter/parser_test.rb
187
+ - test/tree_sitter/query_test.rb
188
+ - test/tree_sitter/tree_cursor_test.rb
187
189
  - test/tree_sitter/tree_test.rb
188
- - test/test_helper.rb
189
- - test/README.md