synvert 1.4.2 → 1.4.3
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 +6 -6
- data/lib/synvert/cli.rb +6 -0
- data/lib/synvert/version.rb +1 -1
- data/synvert-ruby.gemspec +1 -1
- data/test.rb +15 -0
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19744ed1c0594d53ade16741e59666a8cd2d7b586d90b51eb6ef0c3000ff587f
|
4
|
+
data.tar.gz: cd8f5ebba8d876d3050849b4b7bdcb39f4d90f785f128696bf4f5653545c6bc9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ed02f04fd75544802aaae831746376217eaaf9bccb97b490cf65940b2cda5b0aed47887b7cf114f716989726d07223f81975cd7cfe56b97d595cd3bc3b0780f
|
7
|
+
data.tar.gz: 5487c60b4c4d69cc3cd968b7d77e0b937e2afee42ccd1ba4a5b3333df06c617892a1dbfe63fbfac01ec4ca8a65e3dfb1a2648717b2ca9abb8da9fb5f527fc305
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert (1.4.
|
5
|
-
synvert-core (>= 1.22.
|
4
|
+
synvert (1.4.3)
|
5
|
+
synvert-core (>= 1.22.1)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
concurrent-ruby (~> 1.0)
|
34
34
|
json (2.5.1)
|
35
35
|
minitest (5.18.0)
|
36
|
-
node_mutation (1.
|
36
|
+
node_mutation (1.13.0)
|
37
37
|
erubis
|
38
38
|
node_query (1.12.0)
|
39
39
|
parallel (1.22.1)
|
@@ -63,9 +63,9 @@ 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.22.
|
66
|
+
synvert-core (1.22.1)
|
67
67
|
activesupport (< 7.0.0)
|
68
|
-
node_mutation (>= 1.
|
68
|
+
node_mutation (>= 1.13.0)
|
69
69
|
node_query (>= 1.12.0)
|
70
70
|
parallel
|
71
71
|
parser
|
@@ -95,4 +95,4 @@ DEPENDENCIES
|
|
95
95
|
webmock
|
96
96
|
|
97
97
|
BUNDLED WITH
|
98
|
-
2.
|
98
|
+
2.4.7
|
data/lib/synvert/cli.rb
CHANGED
@@ -259,6 +259,9 @@ module Synvert
|
|
259
259
|
puts output.to_json
|
260
260
|
end
|
261
261
|
rescue StandardError => e
|
262
|
+
if ENV['DEBUG']
|
263
|
+
puts e.backtrace.join("\n")
|
264
|
+
end
|
262
265
|
if plain_output?
|
263
266
|
puts "Error: #{e.message}"
|
264
267
|
else
|
@@ -272,6 +275,9 @@ module Synvert
|
|
272
275
|
results = rewriter.test
|
273
276
|
puts results.to_json
|
274
277
|
rescue StandardError => e
|
278
|
+
if ENV['DEBUG']
|
279
|
+
puts e.backtrace.join("\n")
|
280
|
+
end
|
275
281
|
puts({ error: e.message }.to_json)
|
276
282
|
raise
|
277
283
|
end
|
data/lib/synvert/version.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.22.
|
23
|
+
spec.add_runtime_dependency 'synvert-core', '>= 1.22.1'
|
24
24
|
|
25
25
|
spec.add_development_dependency 'bundler'
|
26
26
|
spec.add_development_dependency 'rake'
|
data/test.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
Synvert::Rewriter.new 'group', 'name' do
|
2
|
+
within_files 'app/controllers/**/*.rb' do
|
3
|
+
with_node node_type: 'send', receiver: nil, message: 'render', arguments: { size: 1, '0': { node_type: 'hash', nothing_value: true } } do
|
4
|
+
replace :message, with: 'head'
|
5
|
+
goto_node 'arguments.0' do
|
6
|
+
with_node node_type: 'hash', status_value: nil do
|
7
|
+
replace_with ':ok'
|
8
|
+
end
|
9
|
+
with_node node_type: 'hash', status_value: { not: nil } do
|
10
|
+
replace_with '{{status_source}}'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Huang
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-11 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.22.
|
19
|
+
version: 1.22.1
|
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.22.
|
26
|
+
version: 1.22.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,6 +109,7 @@ files:
|
|
109
109
|
- spec/synvert/snippet_spec.rb
|
110
110
|
- spec/synvert/utils_spec.rb
|
111
111
|
- synvert-ruby.gemspec
|
112
|
+
- test.rb
|
112
113
|
homepage: https://github.com/xinminlabs/synvert-ruby
|
113
114
|
licenses:
|
114
115
|
- MIT
|
@@ -128,8 +129,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
129
|
- !ruby/object:Gem::Version
|
129
130
|
version: '0'
|
130
131
|
requirements: []
|
131
|
-
rubygems_version: 3.
|
132
|
-
signing_key:
|
132
|
+
rubygems_version: 3.0.3.1
|
133
|
+
signing_key:
|
133
134
|
specification_version: 4
|
134
135
|
summary: synvert = syntax + convert.
|
135
136
|
test_files:
|