synvert-core 1.10.1 → 1.11.0
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/CHANGELOG.md +5 -0
- data/Gemfile.lock +3 -1
- data/lib/synvert/core/configuration.rb +9 -1
- data/lib/synvert/core/rewriter/instance.rb +9 -2
- data/lib/synvert/core/version.rb +1 -1
- data/synvert-core-ruby.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0663ba61695ae5b47f27e9a23f1edbfe31d3746f9b3e02a79315a827fae6f36c
|
4
|
+
data.tar.gz: 8199c6c8a122555bfbf0df0ef79f6bd96ade0cdfe472d81d6abe4cccde3b6c59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3609b9bdb845681c9dd71d9d0eca4985d43203ce28fb1e874e9538322f8205995d77f5b8c2b43fb11caf698a69772c3e7bdd5114a709e4513313339870576a5e
|
7
|
+
data.tar.gz: 952578268a2c8cba6dcd2883141fe5977917594ea01b76e51e93032fc71225c813b9021ec1852c3a93d76f6438f30f9975ac47b36c5da3d7c5805fa15763fa9e
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert-core (1.
|
4
|
+
synvert-core (1.11.0)
|
5
5
|
activesupport (< 7.0.0)
|
6
6
|
erubis
|
7
7
|
node_mutation
|
8
8
|
node_query
|
9
|
+
parallel
|
9
10
|
parser
|
10
11
|
parser_node_ext
|
11
12
|
|
@@ -57,6 +58,7 @@ GEM
|
|
57
58
|
notiffany (0.1.3)
|
58
59
|
nenv (~> 0.1)
|
59
60
|
shellany (~> 0.0)
|
61
|
+
parallel (1.22.1)
|
60
62
|
parser (3.1.2.1)
|
61
63
|
ast (~> 2.4.1)
|
62
64
|
parser_node_ext (0.4.0)
|
@@ -8,7 +8,8 @@ module Synvert::Core
|
|
8
8
|
# @!attribute [w] skip_paths
|
9
9
|
# @!attribute [w] only_paths
|
10
10
|
# @!attribute [w] show_run_process
|
11
|
-
|
11
|
+
# @!attribute [w] number_of_workers
|
12
|
+
attr_writer :root_path, :skip_paths, :only_paths, :show_run_process, :number_of_workers
|
12
13
|
|
13
14
|
# Get the path.
|
14
15
|
#
|
@@ -37,6 +38,13 @@ module Synvert::Core
|
|
37
38
|
def show_run_process
|
38
39
|
@show_run_process || false
|
39
40
|
end
|
41
|
+
|
42
|
+
# Number of workers
|
43
|
+
#
|
44
|
+
# @return [Integer] default is 1
|
45
|
+
def number_of_workers
|
46
|
+
@number_of_workers || 1
|
47
|
+
end
|
40
48
|
end
|
41
49
|
end
|
42
50
|
end
|
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
require 'parallel'
|
2
3
|
|
3
4
|
module Synvert::Core
|
4
5
|
# Instance is an execution unit, it finds specified ast nodes,
|
@@ -41,8 +42,14 @@ module Synvert::Core
|
|
41
42
|
# It finds specified files, for each file, it executes the block code, tests the original code,
|
42
43
|
# then returns the actions.
|
43
44
|
def test
|
44
|
-
|
45
|
-
|
45
|
+
if Configuration.number_of_workers > 1
|
46
|
+
Parallel.map(get_file_paths, in_processes: Configuration.number_of_workers) do |file_path|
|
47
|
+
test_file(file_path)
|
48
|
+
end
|
49
|
+
else
|
50
|
+
get_file_paths.map do |file_path|
|
51
|
+
test_file(file_path)
|
52
|
+
end
|
46
53
|
end
|
47
54
|
end
|
48
55
|
|
data/lib/synvert/core/version.rb
CHANGED
data/synvert-core-ruby.gemspec
CHANGED
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.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-10-
|
11
|
+
date: 2022-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: parallel
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
97
111
|
description: convert ruby code to better syntax automatically.
|
98
112
|
email:
|
99
113
|
- flyerhzm@gmail.com
|