synvert-core 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/synvert/core/rewriter/instance.rb +5 -0
- data/lib/synvert/core/version.rb +1 -1
- data/spec/synvert/core/rewriter/instance_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa46b311ec4eb71e3a23d060e1a23dcceffe1b0ddea066a64043aea29635d143
|
4
|
+
data.tar.gz: 7dd8b27cfc88e3d98a876da7592e1df466e00a6c1b79309d34abc475e287b5a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46b2babf63c196c428173cac102fc55d7968e8bfee9ba484a8c25ffa3c2da711502c172a5c60ae84155e0fef7ab1e2bcad1b70367f36612550bceee010f2ac43
|
7
|
+
data.tar.gz: ca19136ae935ab915d498ab71fb286b9cf30469dbc4503e5f5fb754863cefaa290e1a833b35cedfa0b2533bf64d55987d031514be60b32884145b8df8cc42de7
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
synvert-core (1.
|
4
|
+
synvert-core (1.9.0)
|
5
5
|
activesupport (< 7.0.0)
|
6
6
|
erubis
|
7
7
|
node_mutation
|
@@ -49,7 +49,7 @@ GEM
|
|
49
49
|
method_source (1.0.0)
|
50
50
|
minitest (5.16.3)
|
51
51
|
nenv (0.3.0)
|
52
|
-
node_mutation (1.
|
52
|
+
node_mutation (1.4.0)
|
53
53
|
activesupport (< 7.0.0)
|
54
54
|
erubis
|
55
55
|
node_query (1.6.0)
|
data/README.md
CHANGED
@@ -96,3 +96,4 @@ Actions:
|
|
96
96
|
* [replace_with](./Synvert/Core/Rewriter/Instance.html#replace_with-instance_method) - replace the whole code of current node
|
97
97
|
* [warn](./Synvert/Core/Rewriter/Instance.html#warn-instance_method) - warn message
|
98
98
|
* [replace_erb_stmt_with_expr](./Synvert/Core/Rewriter/Instance.html#replace_erb_stmt_with_expr-instance_method) - replace erb stmt code to expr code
|
99
|
+
* [noop](./Synvert/Core/Rewriter/Instance.html#noop-instance_method) - no operation
|
@@ -325,6 +325,11 @@ module Synvert::Core
|
|
325
325
|
@current_mutation.wrap(@current_node, with: with)
|
326
326
|
end
|
327
327
|
|
328
|
+
# Parse +noop dsl.
|
329
|
+
def noop
|
330
|
+
@current_mutation.noop(@current_node)
|
331
|
+
end
|
332
|
+
|
328
333
|
# Parse +warn+ dsl, it creates a {Synvert::Core::Rewriter::Warning} to save warning message.
|
329
334
|
# @example
|
330
335
|
# within_files 'vendor/plugins' do
|
data/lib/synvert/core/version.rb
CHANGED
@@ -176,6 +176,13 @@ module Synvert::Core
|
|
176
176
|
instance.wrap with: 'module Foobar'
|
177
177
|
end
|
178
178
|
|
179
|
+
it 'parses noop' do
|
180
|
+
instance.current_mutation = double
|
181
|
+
instance.current_node = double
|
182
|
+
expect(instance.current_mutation).to receive(:noop).with(instance.current_node)
|
183
|
+
instance.noop
|
184
|
+
end
|
185
|
+
|
179
186
|
it 'parses warn' do
|
180
187
|
expect(Rewriter::Warning).to receive(:new).with(instance, 'foobar')
|
181
188
|
instance.warn 'foobar'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synvert-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
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-09-
|
11
|
+
date: 2022-09-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|