synvert-core 2.1.2 → 2.2.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: a46f27187479785039c353bc33688eb5528d2d6591485d5e55efd43f2f6cd817
4
- data.tar.gz: 1b96464e513f2a8b3beb3421eb021e1efd5c41045698aa4eb26fbaa0b94703d3
3
+ metadata.gz: 30e6a2e5daa58d21f2e9ba53e8cb6a16d690d7bceaae3157ee55bf4ab2539208
4
+ data.tar.gz: 1beb0959459e26b77296bf9bec157b8c4b996d24eb61bb3f0fb1ec068fab74ed
5
5
  SHA512:
6
- metadata.gz: b5b68e153d26a3bac0a6b2ced72b2cd33b7b3b05159f7932c49b9fdb20822561d17c6d13aca805b21ae3bbeb156ed479845c531755ce1d5e53f78e15bc5c2068
7
- data.tar.gz: b1978636d9eb02f79f8f92eaba1cd702d2be8748a42deb7d5c34645dd28e388b1d99471a826e0d0ce17571a2c8fe71dab32545fe5f0c4f6dc77ec54ea1edbe96
6
+ metadata.gz: bbc0e5c4250c91deb0767b11343a57089b34debbcbd02d5dfa0739352ab219fafa361e51754c9ff7f41df4a73a9275fa5334ddf7a9abeba513f4be66b1afcdec
7
+ data.tar.gz: 1f1a822643f728760ba97af47b0f1a6e436810d6e316037c1c8d38fdd8bd1e012eb2bfffedeae1b6dc6dc23b225240a585c3562b62eea2ef074af9d9a3a99f35
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 2.2.0 (2024-07-20)
4
+
5
+ * Remove `save_data` and `load_data` dsls
6
+
3
7
  ## 2.1.2 (2024-07-17)
4
8
 
5
9
  * Update `parser_node_ext` to 1.4.2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- synvert-core (2.1.2)
4
+ synvert-core (2.2.0)
5
5
  activesupport
6
6
  node_mutation (>= 1.24.4)
7
7
  node_query (>= 1.15.4)
data/README.md CHANGED
@@ -78,8 +78,6 @@ DSLs are as follows
78
78
  * [add_snippet](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#add_snippet-instance_method) - call another rewriter
79
79
  * [call_helper](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#call_helper-instance_method) - call a shared rewriter
80
80
  * [with_configurations](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#with_configurations-instance_method) - execute a block of code with temporary configurations
81
- * [save_data](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#save_data-instance_method) - save data
82
- * [load_data](https://synvert-hq.github.io/synvert-core-ruby/Synvert/Core/Rewriter.html#load_data-instance_method) - load data
83
81
 
84
82
  Scopes:
85
83
 
@@ -416,22 +416,6 @@ module Synvert::Core
416
416
  Configuration.with_temporary_configurations(configurations, &block)
417
417
  end
418
418
 
419
- # Saves data with a given key and value.
420
- #
421
- # @param key [Symbol] the key to identify the data
422
- # @param value [Object] the value to be saved
423
- def save_data(key, value)
424
- Synvert::Core.instance_variable_set("@#{key}", value)
425
- end
426
-
427
- # Loads data with the given key.
428
- #
429
- # @param key [Symbol] the key of the data to be loaded
430
- # @return [Object] the data loaded
431
- def load_data(key)
432
- Synvert::Core.instance_variable_get("@#{key}")
433
- end
434
-
435
419
  private
436
420
 
437
421
  # Handle one file.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '2.1.2'
5
+ VERSION = '2.2.0'
6
6
  end
7
7
  end
@@ -346,11 +346,10 @@ module Synvert::Core
346
346
  it 'eval helper by name' do
347
347
  block_receiver = nil
348
348
  block_options = {}
349
- helper =
350
- Synvert::Helper.new 'helper' do |options|
351
- block_receiver = self.class.name
352
- block_options = options
353
- end
349
+ Synvert::Helper.new 'helper' do |options|
350
+ block_receiver = self.class.name
351
+ block_options = options
352
+ end
354
353
  rewriter =
355
354
  Rewriter.new 'group', 'rewriter' do
356
355
  call_helper('helper', foo: 'bar')
@@ -395,18 +394,6 @@ module Synvert::Core
395
394
  expect(instance.dynamic_helper('arg1', 'arg2')).to eq 'dynamic result'
396
395
  end
397
396
 
398
- it 'parses save_data and load_data' do
399
- data = nil
400
- rewriter =
401
- Rewriter.new 'group', 'name' do
402
- hash = { foo: 'bar' }
403
- save_data :object, hash
404
- data = load_data :object
405
- end
406
- rewriter.process
407
- expect(data).to eq({ foo: 'bar' })
408
- end
409
-
410
397
  describe 'class methods' do
411
398
  before :each do
412
399
  Rewriter.clear
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: 2.1.2
4
+ version: 2.2.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: 2024-07-17 00:00:00.000000000 Z
11
+ date: 2024-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport