synvert-core 0.34.0 → 0.35.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 34cd9673c3a822eb4c9b41930aa069b8c8494d6e81091c37b0184864f302f94d
4
- data.tar.gz: 852ff317acabb0d20528a168d6639b10b9ac576f1c70f64af2e17923762addaa
3
+ metadata.gz: 9c718983fb8e6e6216ac660fba2aa1b9beeacf96db451d65b4df3df827a396c0
4
+ data.tar.gz: a6fd2918b8de9d92bfe4a50f1c135154d5b94eacd21b3e88c740e1869e4c4686
5
5
  SHA512:
6
- metadata.gz: 9a23ba7d43b7eef7a6508925a6d9aa2c925e12cd392999f0d2e263be5a5df7c934a735cb00e584f4cddbdccd8779d6eed1dddd338d9d1f9838d9d983c21f74dc
7
- data.tar.gz: 92008bfc0d05c3d71d9948e0db6a3c8c09ca05b4aff4d2a1cafb6fd93fb0308554a738f2447d962d4751b82827f22aeee9f81d2c7727fb63190018984a7a8a6e
6
+ metadata.gz: 8a828ec38b3d152a6620dd8fb5101a4fa0594da95eaede5612dd805f8b719bc52ebcaa1c00de48bb17fb306ebcf0cd6a7beb109dc91602afd5e305aafe521e47
7
+ data.tar.gz: 496d20ef84817d2e8073573b67635f8cb520fc430a647eba909ff9a49dce8fa4f9f5c99245123aa390d7b7d0356c955ca1f78c8073ee17984e1dfa14a8914e51
data/CHANGELOG.md CHANGED
@@ -1,9 +1,13 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.35.0 (2021-05-17)
4
+
5
+ * Add `contain` rule
6
+
3
7
  ## 0.34.0 (2021-05-16)
4
8
 
5
9
  * `child_node_name` supports [:def, :parentheses] and [:defs, :parentheses]
6
- * rename `pipe` to `pipes`
10
+ * Rename `pipe` to `pipes`
7
11
 
8
12
  ## 0.33.0 (2021-05-10)
9
13
 
@@ -399,7 +399,7 @@ module Parser::AST
399
399
  def match?(rules)
400
400
  flat_hash(rules).keys.all? do |multi_keys|
401
401
  case multi_keys.last
402
- when :any
402
+ when :any, :contain
403
403
  actual_values = actual_value(self, multi_keys[0...-1])
404
404
  expected = expected_value(rules, multi_keys)
405
405
  actual_values.any? { |actual| match_value?(actual, expected) }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Synvert
4
4
  module Core
5
- VERSION = '0.34.0'
5
+ VERSION = '0.35.0'
6
6
  end
7
7
  end
@@ -414,6 +414,12 @@ describe Parser::AST::Node do
414
414
  expect(node).to be_match(type: 'send', arguments: { any: 'Lifo::Cache' })
415
415
  end
416
416
 
417
+ it 'matches arguments contain' do
418
+ source = 'def slow(foo, bar, &block); end'
419
+ node = parse(source)
420
+ expect(node).to be_match(type: 'def', arguments: { contain: '&block' })
421
+ end
422
+
417
423
  it 'matches not' do
418
424
  source = 'class Synvert; end'
419
425
  node = parse(source)
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: 0.34.0
4
+ version: 0.35.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: 2021-05-16 00:00:00.000000000 Z
11
+ date: 2021-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport