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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 15c02ce8eccc05ac9bd74acc1c48a41299e7feed9e6f5aa74fbdc76001a4ed24
4
- data.tar.gz: 9d9ae61df8d41a97652cf35839c76134fc1a8def2bf6ec3c1da09a80ae71b02e
3
+ metadata.gz: fbf03f5ea8a59861b385bad8c4f225a62b42ce0bb32436cd96283263512fdfd2
4
+ data.tar.gz: cbeaddf5e452d8c5f0256aba60d654b76dcedb48831ec2bc58cb828e321e023e
5
5
  SHA512:
6
- metadata.gz: 9c69f27c9cc0a1dccb25c00732aef5ad2fcdfbdf8e43767392a6920a16265403c8e6d7f0b23682d62c0ed378cb88e052df55de14bf78dcdee8c0b27e7d41cfa1
7
- data.tar.gz: 62ad7f2c78e77ee8d6f68e6820b0efd8cd86af1e219ba99248a7dd28ea9436bd33cdf92a32c56599f1f3b1cf4a3bf432bb5f89ed0d5861ba24592305aae48e5a
6
+ metadata.gz: 96128edaf536e29443e9e07907d0f3ef06c14b4b82cd95f311efce9afcaf3539afa1dc316ad0a5a12adb05c81dcb3c794e02ab7b91160a0b9b21532fb1ee2a14
7
+ data.tar.gz: 60056a971dd88b68ec6daab79bbc1906f065ed60850bbe2af4c4c86d8a1dbd121a8ecb6eadd4b7da3ac7377e94fc2d7888159c2005341b333f1f397d67aff20a
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.2.1 (2022-11-13)
4
+
5
+ * Concat multiple git commands with &&
6
+
7
+ ## 1.2.0 (2022-10-11)
8
+
9
+ * Add `--number-of-workers` option
10
+
3
11
  ## 1.1.3 (2022-10-09)
4
12
 
5
13
  * No need to read rewriters before run or test a snippet
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert (1.1.3)
5
- synvert-core (>= 1.10.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.4.4)
36
+ node_mutation (1.7.1)
37
37
  activesupport (< 7.0.0)
38
38
  erubis
39
- node_query (1.7.0)
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.0)
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.10.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.1)
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
@@ -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
- FileUtils.cd @snippets_path
23
- Kernel.system('git checkout .; git pull --rebase')
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Synvert
4
- VERSION = '1.1.3'
4
+ VERSION = '1.2.1'
5
5
  end
@@ -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 .; git pull --rebase')
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.10.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.3
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-10-09 00:00:00.000000000 Z
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.10.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.10.1
26
+ version: 1.12.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement