synvert-core 1.27.0 → 1.27.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: 6505a54441fe208f10c8c57b79d3ba5dab41fe7bc484d5ebaeb39da041775c9b
4
- data.tar.gz: a198d79b76780f320d159a379eb8cc05e30e74419a8759d37f9c2eb9fe83c902
3
+ metadata.gz: 76a57aa5fe7a0dfc34c17b5afb0be7657f08b29e7efa7aceb85350a5d7571260
4
+ data.tar.gz: 6706bbbce5a521aaa00b625ae1c0052241485f7eb230f5c99af68466b0effc7e
5
5
  SHA512:
6
- metadata.gz: f76e819dc63a12e5c7e50f77f5f96e104b22181d1748a897a445b11b7fd1ca1f8342855c4f3911cd0848747c3581d18784bf7bc2670bef866084fea1bff82811
7
- data.tar.gz: 77ffc3abe94e91b73d2e4ffa06455f4378687d833e0911f4716a1ea9cd5a7149bdac4af32c23e3183c7a6a784a064b12dcafc4171afdd083a911eb9fe899344c
6
+ metadata.gz: 2b87be0f4fc6ce7aa88c96644182cb7c479a89104cee0a43779b1e2345cc1e24709e360970896890000042e2f80d8fd297eec435a499ebd28feb1abd283ff6f5
7
+ data.tar.gz: bc08baeaa494b5307428ec5e2ce4e88d639f8262200fed27d8b5dae4da646e5c0b470be3ceb7f6e55650b4fdcd0daefcb48ca921fafa43763ce34ed91c24e08c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.27.1 (2023-05-30)
4
+
5
+ * Puts error message when rescue `Parser::SyntaxError`
6
+ * Update `node_mutation` to 1.18.2
7
+
3
8
  ## 1.27.0 (2023-05-16)
4
9
 
5
10
  * Configure `parser`, can be `parser` or `syntax_tree`
data/Gemfile.lock CHANGED
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert-core (1.27.0)
4
+ synvert-core (1.27.1)
5
5
  activesupport (< 7.0.0)
6
- node_mutation (>= 1.18.0)
6
+ node_mutation (>= 1.18.2)
7
7
  node_query (>= 1.13.2)
8
8
  parallel
9
9
  parser
10
- parser_node_ext (>= 1.1.0)
10
+ parser_node_ext (>= 1.1.1)
11
11
  syntax_tree
12
12
  syntax_tree_ext (>= 0.3.1)
13
13
 
@@ -50,7 +50,7 @@ GEM
50
50
  method_source (1.0.0)
51
51
  minitest (5.18.0)
52
52
  nenv (0.3.0)
53
- node_mutation (1.18.0)
53
+ node_mutation (1.18.2)
54
54
  node_query (1.13.2)
55
55
  notiffany (0.1.3)
56
56
  nenv (~> 0.1)
@@ -58,7 +58,7 @@ GEM
58
58
  parallel (1.23.0)
59
59
  parser (3.2.2.1)
60
60
  ast (~> 2.4.1)
61
- parser_node_ext (1.1.0)
61
+ parser_node_ext (1.1.1)
62
62
  parser
63
63
  prettier_print (1.2.1)
64
64
  pry (0.14.1)
@@ -47,7 +47,7 @@ module Synvert::Core
47
47
  puts @file_path if Configuration.show_run_process
48
48
 
49
49
  absolute_file_path = File.join(Configuration.root_path, @file_path)
50
- while true
50
+ loop do
51
51
  source = read_source(absolute_file_path)
52
52
  encoded_source = Engine.encode(File.extname(file_path), source)
53
53
  @current_mutation = NodeMutation.new(source)
@@ -66,9 +66,10 @@ module Synvert::Core
66
66
  write_source(absolute_file_path, result.new_source)
67
67
  end
68
68
  break unless result.conflicted?
69
- rescue Parser::SyntaxError
69
+ rescue Parser::SyntaxError => e
70
70
  puts "[Warn] file #{file_path} was not parsed correctly."
71
- # do nothing, iterate next file
71
+ puts e.message
72
+ break
72
73
  end
73
74
  end
74
75
  end
@@ -93,9 +94,9 @@ module Synvert::Core
93
94
  result = @current_mutation.test
94
95
  result.file_path = file_path
95
96
  result
96
- rescue Parser::SyntaxError
97
+ rescue Parser::SyntaxError => e
97
98
  puts "[Warn] file #{file_path} was not parsed correctly."
98
- # do nothing, iterate next file
99
+ puts e.message
99
100
  end
100
101
  end
101
102
 
@@ -253,13 +253,13 @@ module Synvert::Core
253
253
 
254
254
  if @options[:write_to_file]
255
255
  handle_one_file(Array(file_patterns)) do |file_path|
256
- instance = Rewriter::Instance.new(self, file_path, &block)
256
+ instance = Instance.new(self, file_path, &block)
257
257
  instance.process
258
258
  end
259
259
  else
260
260
  results =
261
261
  handle_one_file(Array(file_patterns)) do |file_path|
262
- instance = Rewriter::Instance.new(self, file_path, &block)
262
+ instance = Instance.new(self, file_path, &block)
263
263
  instance.test
264
264
  end
265
265
  merge_test_results(results)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.27.0'
5
+ VERSION = '1.27.1'
6
6
  end
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
4
4
 
5
- require 'pp'
5
+ require 'pp' # rubocop:disable Lint/RedundantRequireStatement
6
6
  require 'synvert/core'
7
7
  require 'fakefs/spec_helpers'
8
8
 
@@ -21,9 +21,9 @@ Gem::Specification.new do |spec|
21
21
 
22
22
  spec.add_runtime_dependency "activesupport", "< 7.0.0"
23
23
  spec.add_runtime_dependency "node_query", ">= 1.13.2"
24
- spec.add_runtime_dependency "node_mutation", ">= 1.18.0"
24
+ spec.add_runtime_dependency "node_mutation", ">= 1.18.2"
25
25
  spec.add_runtime_dependency "parser"
26
- spec.add_runtime_dependency "parser_node_ext", ">= 1.1.0"
26
+ spec.add_runtime_dependency "parser_node_ext", ">= 1.1.1"
27
27
  spec.add_runtime_dependency "syntax_tree"
28
28
  spec.add_runtime_dependency "syntax_tree_ext", ">= 0.3.1"
29
29
  spec.add_runtime_dependency "parallel"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synvert-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.0
4
+ version: 1.27.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-18 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.18.0
47
+ version: 1.18.2
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 1.18.0
54
+ version: 1.18.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: parser
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 1.1.0
75
+ version: 1.1.1
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
- version: 1.1.0
82
+ version: 1.1.1
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: syntax_tree
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -207,7 +207,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  requirements: []
210
- rubygems_version: 3.4.7
210
+ rubygems_version: 3.4.10
211
211
  signing_key:
212
212
  specification_version: 4
213
213
  summary: convert ruby code to better syntax.