synvert 1.2.2 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -1
- data/Gemfile.lock +15 -16
- data/README.md +2 -1
- data/lib/synvert/cli.rb +2 -11
- data/lib/synvert/snippet.rb +0 -16
- data/lib/synvert/version.rb +1 -1
- data/spec/synvert/snippet_spec.rb +0 -9
- 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: 5a5aafd01e044e25452de4751866ae7784b2d094dc00a60aea6b3893001cfdfe
|
4
|
+
data.tar.gz: feebe5fa35b6d849ac9fae2f9264ed8006739cc97763f5674185d8d2180272af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c374ab4211680408d85ae820eaab5f06ad6a7dd81cb4af5df8cfc9319cd0546526c5718c85346cfdac5a07e789fd48ca8467821a3464e26f0566bcc5ca4ffb5
|
7
|
+
data.tar.gz: b954b52b313a2dd0fbebe99d43cce2719227f77f1c2714543593f9082c5997a88b180524bcaf43128a0345b5003fd04566a4c63e0659999f291cf6fe27918b26
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,19 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## 1.2.5 (2023-02-01)
|
4
|
+
|
5
|
+
* Remove `rewriter.todo`
|
6
|
+
* Update ``synvert-core`` to 1.18.0
|
7
|
+
|
8
|
+
## 1.2.4 (2023-01-21)
|
9
|
+
|
10
|
+
* Update ``synvert-core`` to 1.17.0
|
11
|
+
|
12
|
+
## 1.2.3 (2022-12-29)
|
13
|
+
|
14
|
+
* Do not install synvert-core after syncing snippet
|
15
|
+
* Update `synvert-core` to 1.16.0
|
16
|
+
|
3
17
|
## 1.2.2 (2022-11-13)
|
4
18
|
|
5
19
|
* Fix `default_snippets_home` in windows
|
@@ -50,7 +64,7 @@
|
|
50
64
|
## 0.19.3 (2022-07-18)
|
51
65
|
|
52
66
|
* Require json
|
53
|
-
*
|
67
|
+
* Update `synvert-core` to 1.5.0
|
54
68
|
|
55
69
|
## 0.19.2 (2021-12-15)
|
56
70
|
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert (1.2.
|
5
|
-
synvert-core (>= 1.
|
4
|
+
synvert (1.2.5)
|
5
|
+
synvert-core (>= 1.18.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.2)
|
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.
|
19
|
+
concurrent-ruby (1.2.0)
|
20
20
|
coveralls (0.8.23)
|
21
21
|
json (>= 1.8, < 3)
|
22
22
|
simplecov (~> 0.16.1)
|
@@ -32,16 +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.
|
37
|
-
activesupport (< 7.0.0)
|
35
|
+
minitest (5.17.0)
|
36
|
+
node_mutation (1.8.2)
|
38
37
|
erubis
|
39
|
-
node_query (1.
|
40
|
-
activesupport (< 7.0.0)
|
38
|
+
node_query (1.12.0)
|
41
39
|
parallel (1.22.1)
|
42
|
-
parser (3.
|
40
|
+
parser (3.2.0.0)
|
43
41
|
ast (~> 2.4.1)
|
44
|
-
parser_node_ext (0.
|
42
|
+
parser_node_ext (0.9.0)
|
45
43
|
parser
|
46
44
|
public_suffix (4.0.6)
|
47
45
|
rake (13.0.6)
|
@@ -65,20 +63,20 @@ GEM
|
|
65
63
|
simplecov-html (~> 0.10.0)
|
66
64
|
simplecov-html (0.10.2)
|
67
65
|
sync (0.5.0)
|
68
|
-
synvert-core (1.
|
66
|
+
synvert-core (1.18.0)
|
69
67
|
activesupport (< 7.0.0)
|
70
68
|
erubis
|
71
|
-
node_mutation
|
72
|
-
node_query
|
69
|
+
node_mutation (>= 1.8.2)
|
70
|
+
node_query (>= 1.12.0)
|
73
71
|
parallel
|
74
72
|
parser
|
75
|
-
parser_node_ext
|
73
|
+
parser_node_ext (>= 0.9.0)
|
76
74
|
term-ansicolor (1.7.1)
|
77
75
|
tins (~> 1.0)
|
78
76
|
thor (1.1.0)
|
79
77
|
tins (1.29.1)
|
80
78
|
sync
|
81
|
-
tzinfo (2.0.
|
79
|
+
tzinfo (2.0.6)
|
82
80
|
concurrent-ruby (~> 1.0)
|
83
81
|
webmock (3.14.0)
|
84
82
|
addressable (>= 2.8.0)
|
@@ -89,6 +87,7 @@ GEM
|
|
89
87
|
PLATFORMS
|
90
88
|
x86_64-darwin-20
|
91
89
|
x86_64-darwin-21
|
90
|
+
x86_64-darwin-22
|
92
91
|
x86_64-linux
|
93
92
|
|
94
93
|
DEPENDENCIES
|
data/README.md
CHANGED
@@ -23,7 +23,8 @@ $ gem install synvert
|
|
23
23
|
|
24
24
|
This will also install `synvert-core-ruby`.
|
25
25
|
|
26
|
-
|
26
|
+
Synvert is completely working with remote snippets on github,
|
27
|
+
but you can sync all official snippets locally to make it run faster.
|
27
28
|
|
28
29
|
```
|
29
30
|
$ synvert-ruby --sync
|
data/lib/synvert/cli.rb
CHANGED
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'optparse'
|
4
4
|
require 'json'
|
5
|
-
require 'uri'
|
6
|
-
require 'open-uri'
|
7
5
|
require 'fileutils'
|
8
6
|
|
9
7
|
module Synvert
|
@@ -147,7 +145,7 @@ module Synvert
|
|
147
145
|
# List and print all available rewriters.
|
148
146
|
def list_available_rewriters
|
149
147
|
if Core::Rewriter.availables.empty?
|
150
|
-
puts "There is no snippet under #{
|
148
|
+
puts "There is no snippet under #{default_snippets_home}, please run `synvert-ruby --sync` to fetch snippets."
|
151
149
|
return
|
152
150
|
end
|
153
151
|
|
@@ -224,11 +222,6 @@ module Synvert
|
|
224
222
|
def sync_snippets
|
225
223
|
Snippet.new(default_snippets_home).sync
|
226
224
|
puts 'synvert snippets are synced'
|
227
|
-
core_version = Snippet.fetch_core_version
|
228
|
-
if Gem::Version.new(core_version) > Gem::Version.new(Synvert::Core::VERSION)
|
229
|
-
puts "synvert-core is updated, installing synvert-core #{core_version}"
|
230
|
-
system('gem install synvert-core')
|
231
|
-
end
|
232
225
|
end
|
233
226
|
|
234
227
|
# eval snippet name by user input
|
@@ -244,14 +237,12 @@ module Synvert
|
|
244
237
|
rewriter.warnings.each do |warning|
|
245
238
|
puts '[Warn] ' + warning.message
|
246
239
|
end
|
247
|
-
puts rewriter.todo if rewriter.todo
|
248
240
|
puts "===== #{rewriter.group}/#{rewriter.name} done ====="
|
249
241
|
elsif json_output?
|
250
242
|
rewriter.process
|
251
243
|
output = {
|
252
244
|
affected_files: rewriter.affected_files.union(rewriter.sub_snippets.sum(Set.new, &:affected_files)).to_a,
|
253
|
-
warnings: rewriter.warnings.union(rewriter.sub_snippets.sum([], &:warnings))
|
254
|
-
todo: rewriter.todo
|
245
|
+
warnings: rewriter.warnings.union(rewriter.sub_snippets.sum([], &:warnings))
|
255
246
|
}
|
256
247
|
puts JSON.generate(output)
|
257
248
|
end
|
data/lib/synvert/snippet.rb
CHANGED
@@ -1,16 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require 'open-uri'
|
4
|
-
require 'json'
|
5
|
-
|
6
3
|
module Synvert
|
7
4
|
# Manage synvert snippets.
|
8
5
|
class Snippet
|
9
|
-
def self.fetch_core_version
|
10
|
-
content = uri_open('https://rubygems.org/api/v1/versions/synvert-core.json').read
|
11
|
-
JSON.parse(content).first['number']
|
12
|
-
end
|
13
|
-
|
14
6
|
def initialize(snippets_path)
|
15
7
|
@snippets_path = snippets_path
|
16
8
|
end
|
@@ -25,13 +17,5 @@ module Synvert
|
|
25
17
|
Kernel.system("git clone https://github.com/xinminlabs/synvert-snippets-ruby.git #{@snippets_path}")
|
26
18
|
end
|
27
19
|
end
|
28
|
-
|
29
|
-
def self.uri_open(url)
|
30
|
-
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.5.0')
|
31
|
-
URI.open(url)
|
32
|
-
else
|
33
|
-
open(url)
|
34
|
-
end
|
35
|
-
end
|
36
20
|
end
|
37
21
|
end
|
data/lib/synvert/version.rb
CHANGED
@@ -8,15 +8,6 @@ module Synvert
|
|
8
8
|
let(:snippet) { Snippet.new(snippets_path) }
|
9
9
|
after { FileUtils.rmdir(snippets_path) if File.exist?(snippets_path) }
|
10
10
|
|
11
|
-
describe '.fetch_core_version' do
|
12
|
-
it 'gets remote version' do
|
13
|
-
stub_request(:get, 'https://rubygems.org/api/v1/versions/synvert-core.json').to_return(
|
14
|
-
body: '[{"number":"0.4.2"}]'
|
15
|
-
)
|
16
|
-
expect(Snippet.fetch_core_version).to eq '0.4.2'
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
11
|
describe 'sync' do
|
21
12
|
it 'git clones snippets' do
|
22
13
|
expect(Kernel).to receive(:system).with(
|
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.18.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.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-01 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.18.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.18.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.
|
131
|
+
rubygems_version: 3.4.1
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: synvert = syntax + convert.
|