synvert 1.1.3 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/Gemfile.lock +9 -7
- data/lib/synvert/cli.rb +4 -3
- data/lib/synvert/snippet.rb +3 -3
- data/lib/synvert/version.rb +1 -1
- data/spec/synvert/snippet_spec.rb +1 -1
- data/synvert-ruby.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fbf03f5ea8a59861b385bad8c4f225a62b42ce0bb32436cd96283263512fdfd2
|
4
|
+
data.tar.gz: cbeaddf5e452d8c5f0256aba60d654b76dcedb48831ec2bc58cb828e321e023e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96128edaf536e29443e9e07907d0f3ef06c14b4b82cd95f311efce9afcaf3539afa1dc316ad0a5a12adb05c81dcb3c794e02ab7b91160a0b9b21532fb1ee2a14
|
7
|
+
data.tar.gz: 60056a971dd88b68ec6daab79bbc1906f065ed60850bbe2af4c4c86d8a1dbd121a8ecb6eadd4b7da3ac7377e94fc2d7888159c2005341b333f1f397d67aff20a
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert (1.1
|
5
|
-
synvert-core (>= 1.
|
4
|
+
synvert (1.2.1)
|
5
|
+
synvert-core (>= 1.12.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -33,14 +33,15 @@ GEM
|
|
33
33
|
concurrent-ruby (~> 1.0)
|
34
34
|
json (2.5.1)
|
35
35
|
minitest (5.16.3)
|
36
|
-
node_mutation (1.
|
36
|
+
node_mutation (1.7.1)
|
37
37
|
activesupport (< 7.0.0)
|
38
38
|
erubis
|
39
|
-
node_query (1.
|
39
|
+
node_query (1.10.0)
|
40
40
|
activesupport (< 7.0.0)
|
41
|
+
parallel (1.22.1)
|
41
42
|
parser (3.1.2.1)
|
42
43
|
ast (~> 2.4.1)
|
43
|
-
parser_node_ext (0.4.
|
44
|
+
parser_node_ext (0.4.1)
|
44
45
|
parser
|
45
46
|
public_suffix (4.0.6)
|
46
47
|
rake (13.0.6)
|
@@ -64,11 +65,12 @@ GEM
|
|
64
65
|
simplecov-html (~> 0.10.0)
|
65
66
|
simplecov-html (0.10.2)
|
66
67
|
sync (0.5.0)
|
67
|
-
synvert-core (1.
|
68
|
+
synvert-core (1.14.1)
|
68
69
|
activesupport (< 7.0.0)
|
69
70
|
erubis
|
70
71
|
node_mutation
|
71
72
|
node_query
|
73
|
+
parallel
|
72
74
|
parser
|
73
75
|
parser_node_ext
|
74
76
|
term-ansicolor (1.7.1)
|
@@ -82,7 +84,7 @@ GEM
|
|
82
84
|
addressable (>= 2.8.0)
|
83
85
|
crack (>= 0.3.2)
|
84
86
|
hashdiff (>= 0.4.0, < 2.0.0)
|
85
|
-
zeitwerk (2.6.
|
87
|
+
zeitwerk (2.6.6)
|
86
88
|
|
87
89
|
PLATFORMS
|
88
90
|
x86_64-darwin-20
|
data/lib/synvert/cli.rb
CHANGED
@@ -4,6 +4,7 @@ require 'optparse'
|
|
4
4
|
require 'json'
|
5
5
|
require 'uri'
|
6
6
|
require 'open-uri'
|
7
|
+
require 'fileutils'
|
7
8
|
|
8
9
|
module Synvert
|
9
10
|
# Synvert command line interface.
|
@@ -61,9 +62,6 @@ module Synvert
|
|
61
62
|
puts "file #{e.diagnostic.location.source_buffer.name}"
|
62
63
|
puts "line #{e.diagnostic.location.line}"
|
63
64
|
false
|
64
|
-
rescue Synvert::Core::RewriterNotFound => e
|
65
|
-
puts e.message
|
66
|
-
false
|
67
65
|
end
|
68
66
|
|
69
67
|
private
|
@@ -123,6 +121,9 @@ module Synvert
|
|
123
121
|
opts.on '-f', '--format FORMAT', 'output format' do |format|
|
124
122
|
@options[:format] = format
|
125
123
|
end
|
124
|
+
opts.on '--number-of-workers NUMBER_OF_WORKERS', 'set the number of workers, if it is greater than 1, it tests snippet in parallel' do |number_of_workers|
|
125
|
+
Core::Configuration.number_of_workers = number_of_workers.to_i
|
126
|
+
end
|
126
127
|
opts.on '-v', '--version', 'show this version' do
|
127
128
|
puts "#{VERSION} (with synvert-core #{Core::VERSION} and parser #{Parser::VERSION})"
|
128
129
|
exit
|
data/lib/synvert/snippet.rb
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'open-uri'
|
4
4
|
require 'json'
|
5
|
-
require 'fileutils'
|
6
5
|
|
7
6
|
module Synvert
|
8
7
|
# Manage synvert snippets.
|
@@ -19,8 +18,9 @@ module Synvert
|
|
19
18
|
# synchronize snippets from github.
|
20
19
|
def sync
|
21
20
|
if File.exist?(@snippets_path)
|
22
|
-
|
23
|
-
|
21
|
+
Dir.chdir(@snippets_path) do
|
22
|
+
Kernel.system('git checkout . && git pull --rebase')
|
23
|
+
end
|
24
24
|
else
|
25
25
|
Kernel.system("git clone https://github.com/xinminlabs/synvert-snippets-ruby.git #{@snippets_path}")
|
26
26
|
end
|
data/lib/synvert/version.rb
CHANGED
@@ -27,7 +27,7 @@ module Synvert
|
|
27
27
|
|
28
28
|
it 'git pull snippets' do
|
29
29
|
FileUtils.mkdir snippets_path
|
30
|
-
expect(Kernel).to receive(:system).with('git checkout
|
30
|
+
expect(Kernel).to receive(:system).with('git checkout . && git pull --rebase')
|
31
31
|
snippet.sync
|
32
32
|
FileUtils.cd File.dirname(__FILE__)
|
33
33
|
end
|
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.12.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.1
|
4
|
+
version: 1.2.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: 2022-
|
11
|
+
date: 2022-11-13 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.12.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.12.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|