synvert 1.2.0 → 1.2.2

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: 21d219aaf7db59c0b63d0e4ef6458168e13b76ace165b8990e82efd34097ea2f
4
- data.tar.gz: 938601896e1bbf2651ac78cf348af5edec9370c39d69e5a2129c47f01745bc33
3
+ metadata.gz: 973dcf09ece6f354f815d767476cca4f48a8d9359c86c2f1472e079441441141
4
+ data.tar.gz: b00a52b60ad18aee2558ea9e1940b7291838a323a6fe0da090e14e901a352d53
5
5
  SHA512:
6
- metadata.gz: 4fa0c007a3d150cf2508bd30049b8fe527154b5847211dce2fc3f08ebbcd9a26e031162a875390900117c2b6cc03667a67f9dab2a4a3507a58fbdd27c9c6bb8d
7
- data.tar.gz: 2027f1f6daa49fbd78d3d47667148811b14d182d215f8c47ea41e4c2d50782cea4fa2e8515fb2678991508a48df6cbb606ed41bf1c516dc8ac825ddd2116ce03
6
+ metadata.gz: a7e8ae8262b1e50aff36f47c432dd05f908f1a6ae50718fd4a0551172bc76dcd16f4f8c96c8081ad02cce438b7049bce36e96c9861f746dd043e4fa2ccc86b52
7
+ data.tar.gz: ffb7c0efd9d20546213336695a662bfd0cd578b9ab25f43bb8157b04e552a0644898d5db0577857e25512137e8328366facd0b798ac24f01f541840b73e09ff8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.2.2 (2022-11-13)
4
+
5
+ * Fix `default_snippets_home` in windows
6
+
7
+ ## 1.2.1 (2022-11-13)
8
+
9
+ * Concat multiple git commands with &&
10
+
3
11
  ## 1.2.0 (2022-10-11)
4
12
 
5
13
  * Add `--number-of-workers` option
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert (1.2.0)
5
- synvert-core (>= 1.11.0)
4
+ synvert (1.2.2)
5
+ synvert-core (>= 1.12.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
@@ -33,15 +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
41
  parallel (1.22.1)
42
42
  parser (3.1.2.1)
43
43
  ast (~> 2.4.1)
44
- parser_node_ext (0.4.0)
44
+ parser_node_ext (0.4.1)
45
45
  parser
46
46
  public_suffix (4.0.6)
47
47
  rake (13.0.6)
@@ -65,7 +65,7 @@ GEM
65
65
  simplecov-html (~> 0.10.0)
66
66
  simplecov-html (0.10.2)
67
67
  sync (0.5.0)
68
- synvert-core (1.11.0)
68
+ synvert-core (1.14.1)
69
69
  activesupport (< 7.0.0)
70
70
  erubis
71
71
  node_mutation
@@ -84,7 +84,7 @@ GEM
84
84
  addressable (>= 2.8.0)
85
85
  crack (>= 0.3.2)
86
86
  hashdiff (>= 0.4.0, < 2.0.0)
87
- zeitwerk (2.6.1)
87
+ zeitwerk (2.6.6)
88
88
 
89
89
  PLATFORMS
90
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.
@@ -146,7 +147,7 @@ module Synvert
146
147
  # List and print all available rewriters.
147
148
  def list_available_rewriters
148
149
  if Core::Rewriter.availables.empty?
149
- puts 'There is no snippet under ~/.synvert-ruby, please run `synvert-ruby --sync` to fetch snippets.'
150
+ puts "There is no snippet under #{default_snippets_name}, please run `synvert-ruby --sync` to fetch snippets."
150
151
  return
151
152
  end
152
153
 
@@ -321,7 +322,9 @@ module Synvert
321
322
  end
322
323
 
323
324
  def default_snippets_home
324
- ENV['SYNVERT_SNIPPETS_HOME'] || File.join(ENV['HOME'], '.synvert-ruby')
325
+ # ENV['HOME'] may use \ as file separator,
326
+ # but File.join always uses / as file separator.
327
+ ENV['SYNVERT_SNIPPETS_HOME'] || File.join(ENV['HOME'].gsub("\\", "/"), '.synvert-ruby')
325
328
  end
326
329
 
327
330
  def plain_output?
@@ -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.2.0'
4
+ VERSION = '1.2.2'
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.11.0'
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.2.0
4
+ version: 1.2.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: 2022-10-11 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.11.0
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.11.0
26
+ version: 1.12.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement