synvert 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +11 -12
- data/lib/synvert/cli.rb +14 -10
- data/lib/synvert/utils.rb +1 -1
- data/lib/synvert/version.rb +1 -1
- data/spec/synvert/utils_spec.rb +1 -1
- data/synvert-ruby.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28d92b2de7ea796dad931f1219c866db250d1278055ccb44c395c70ebad7ac8d
|
4
|
+
data.tar.gz: 90e282eec3f0b6999e1cd95f4b58d80e5569355a9c51ef1c6dab82bb659175cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa69626768b9bb88b37d7b7e86e2be5fb6a10804ec5e7b2f0cc9cdce115cee64632d24ea41eb1bd4a3e046e05345316b52e8dfc29316cffd200b72edf9484b55
|
7
|
+
data.tar.gz: 889bc4708047dd6346ab897d3c9d43c939fad0c6430c6778cf7a4f5a35cf63fdd9417f691a9a7c0d19803b73285e05783e01ea560a907c6ff7b93b4df05c9ed5
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert (1.4.
|
5
|
-
synvert-core (>= 1.
|
4
|
+
synvert (1.4.2)
|
5
|
+
synvert-core (>= 1.22.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.1.7.
|
10
|
+
activesupport (6.1.7.3)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 1.6, < 2)
|
13
13
|
minitest (>= 5.1)
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
addressable (2.8.0)
|
17
17
|
public_suffix (>= 2.0.2, < 5.0)
|
18
18
|
ast (2.4.2)
|
19
|
-
concurrent-ruby (1.2.
|
19
|
+
concurrent-ruby (1.2.2)
|
20
20
|
coveralls (0.8.23)
|
21
21
|
json (>= 1.8, < 3)
|
22
22
|
simplecov (~> 0.16.1)
|
@@ -32,14 +32,14 @@ GEM
|
|
32
32
|
i18n (1.12.0)
|
33
33
|
concurrent-ruby (~> 1.0)
|
34
34
|
json (2.5.1)
|
35
|
-
minitest (5.
|
36
|
-
node_mutation (1.
|
35
|
+
minitest (5.18.0)
|
36
|
+
node_mutation (1.12.2)
|
37
37
|
erubis
|
38
38
|
node_query (1.12.0)
|
39
39
|
parallel (1.22.1)
|
40
|
-
parser (3.2.1.
|
40
|
+
parser (3.2.1.1)
|
41
41
|
ast (~> 2.4.1)
|
42
|
-
parser_node_ext (0.
|
42
|
+
parser_node_ext (1.0.0)
|
43
43
|
parser
|
44
44
|
public_suffix (4.0.6)
|
45
45
|
rake (13.0.6)
|
@@ -63,14 +63,13 @@ GEM
|
|
63
63
|
simplecov-html (~> 0.10.0)
|
64
64
|
simplecov-html (0.10.2)
|
65
65
|
sync (0.5.0)
|
66
|
-
synvert-core (1.
|
66
|
+
synvert-core (1.22.0)
|
67
67
|
activesupport (< 7.0.0)
|
68
|
-
|
69
|
-
node_mutation (>= 1.9.0)
|
68
|
+
node_mutation (>= 1.12.1)
|
70
69
|
node_query (>= 1.12.0)
|
71
70
|
parallel
|
72
71
|
parser
|
73
|
-
parser_node_ext (>= 0.
|
72
|
+
parser_node_ext (>= 1.0.0)
|
74
73
|
term-ansicolor (1.7.1)
|
75
74
|
tins (~> 1.0)
|
76
75
|
thor (1.1.0)
|
data/lib/synvert/cli.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'optparse'
|
4
|
-
require 'json'
|
5
4
|
require 'fileutils'
|
6
5
|
|
7
6
|
module Synvert
|
@@ -99,11 +98,15 @@ module Synvert
|
|
99
98
|
@options[:command] = 'execute'
|
100
99
|
@options[:execute_command] = execute_command
|
101
100
|
end
|
102
|
-
opts.on '-r',
|
101
|
+
opts.on '-r',
|
102
|
+
'--run SNIPPET_NAME',
|
103
|
+
'run a snippet with snippet name, e.g. ruby/new_hash_syntax, or remote url, or local file path' do |snippet_name|
|
103
104
|
@options[:command] = 'run'
|
104
105
|
@options[:snippet_name] = snippet_name
|
105
106
|
end
|
106
|
-
opts.on '-t',
|
107
|
+
opts.on '-t',
|
108
|
+
'--test SNIPPET_NAME',
|
109
|
+
'test a snippet with snippet name, e.g. ruby/new_hash_syntax, or remote url, or local file path' do |snippet_name|
|
107
110
|
@options[:command] = 'test'
|
108
111
|
@options[:snippet_name] = snippet_name
|
109
112
|
end
|
@@ -121,10 +124,11 @@ module Synvert
|
|
121
124
|
opts.on '-f', '--format FORMAT', 'output format' do |format|
|
122
125
|
@options[:format] = format
|
123
126
|
end
|
124
|
-
opts.on '--number-of-workers NUMBER_OF_WORKERS',
|
127
|
+
opts.on '--number-of-workers NUMBER_OF_WORKERS',
|
128
|
+
'set the number of workers, if it is greater than 1, it tests snippet in parallel' do |number_of_workers|
|
125
129
|
Core::Configuration.number_of_workers = number_of_workers.to_i
|
126
130
|
end
|
127
|
-
opts.on '--double-quote', 'prefer double quote, it uses single quote by default' do |
|
131
|
+
opts.on '--double-quote', 'prefer double quote, it uses single quote by default' do |_double_quote|
|
128
132
|
Core::Configuration.single_quote = false
|
129
133
|
end
|
130
134
|
opts.on '--tab-width TAB_WIDTH', 'prefer tab width, it uses 2 by default' do |tab_width|
|
@@ -181,7 +185,7 @@ module Synvert
|
|
181
185
|
end
|
182
186
|
end
|
183
187
|
|
184
|
-
puts
|
188
|
+
puts output.to_json
|
185
189
|
end
|
186
190
|
end
|
187
191
|
|
@@ -252,13 +256,13 @@ module Synvert
|
|
252
256
|
affected_files: rewriter.affected_files.union(rewriter.sub_snippets.sum(Set.new, &:affected_files)).to_a,
|
253
257
|
warnings: rewriter.warnings.union(rewriter.sub_snippets.sum([], &:warnings))
|
254
258
|
}
|
255
|
-
puts
|
259
|
+
puts output.to_json
|
256
260
|
end
|
257
261
|
rescue StandardError => e
|
258
262
|
if plain_output?
|
259
263
|
puts "Error: #{e.message}"
|
260
264
|
else
|
261
|
-
puts
|
265
|
+
puts({ error: e.message }.to_json)
|
262
266
|
end
|
263
267
|
raise
|
264
268
|
end
|
@@ -266,9 +270,9 @@ module Synvert
|
|
266
270
|
# test a snippet
|
267
271
|
def test_snippet(rewriter)
|
268
272
|
results = rewriter.test
|
269
|
-
puts
|
273
|
+
puts results.to_json
|
270
274
|
rescue StandardError => e
|
271
|
-
puts
|
275
|
+
puts({ error: e.message }.to_json)
|
272
276
|
raise
|
273
277
|
end
|
274
278
|
|
data/lib/synvert/utils.rb
CHANGED
data/lib/synvert/version.rb
CHANGED
data/spec/synvert/utils_spec.rb
CHANGED
data/synvert-ruby.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ['lib']
|
21
21
|
spec.post_install_message = 'Please run `synvert-ruby --sync` first to sync snippets remotely.'
|
22
22
|
|
23
|
-
spec.add_runtime_dependency 'synvert-core', '>= 1.
|
23
|
+
spec.add_runtime_dependency 'synvert-core', '>= 1.22.0'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler'
|
26
26
|
spec.add_development_dependency 'rake'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synvert
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
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-
|
11
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: synvert-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.22.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.22.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
- !ruby/object:Gem::Version
|
129
129
|
version: '0'
|
130
130
|
requirements: []
|
131
|
-
rubygems_version: 3.4.
|
131
|
+
rubygems_version: 3.4.7
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: synvert = syntax + convert.
|