synvert-core 1.8.1 → 1.9.0

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: 6007d28c9a4371057b72bfbd4e73c23163cf52c384e7cef0a3fcdcd71b384fcd
4
- data.tar.gz: 5b43685d36948aaf52dd313fdf0e6198eefa73ff12813853d1f289577f58da07
3
+ metadata.gz: aa46b311ec4eb71e3a23d060e1a23dcceffe1b0ddea066a64043aea29635d143
4
+ data.tar.gz: 7dd8b27cfc88e3d98a876da7592e1df466e00a6c1b79309d34abc475e287b5a7
5
5
  SHA512:
6
- metadata.gz: bc762494a28bc325231e1903130fbd14056442646b463b2e336426e59830f2ee8216fb6caa29c50960fed82a75bc320d4196919b0bffb9ab2547674f19bc89ac
7
- data.tar.gz: 60e6b882a9b039c42acecb27581fca198482eeef15628ac9123daf4e08dd0bc109ebff3a1e5c2c7ac62ad8fd4fc7e6fdf65871d83b98a3a90c32b71702ff4057
6
+ metadata.gz: 46b2babf63c196c428173cac102fc55d7968e8bfee9ba484a8c25ffa3c2da711502c172a5c60ae84155e0fef7ab1e2bcad1b70367f36612550bceee010f2ac43
7
+ data.tar.gz: ca19136ae935ab915d498ab71fb286b9cf30469dbc4503e5f5fb754863cefaa290e1a833b35cedfa0b2533bf64d55987d031514be60b32884145b8df8cc42de7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.9.0 (2022-09-20)
4
+
5
+ * Add `noop` dsl
6
+
3
7
  ## 1.8.1 (2022-09-17)
4
8
 
5
9
  * Fix test snippet, return test results
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert-core (1.8.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.3.3)
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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '1.8.1'
5
+ VERSION = '1.9.0'
6
6
  end
7
7
  end
@@ -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.8.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-17 00:00:00.000000000 Z
11
+ date: 2022-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport