node_visitor 1.0.0 → 1.0.1

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: a596ef648c5a209a47fa0355a8956a14df436f9b82d178560323809387a235aa
4
- data.tar.gz: 98d3fe4e938c5d841c9d1e34c037cdfa1f1c209cf521c005f732d07cefc8da65
3
+ metadata.gz: 733804b808e37fc559e0cb45451f1f1417479e6cfcc9e48c9372a9fdb392ff4d
4
+ data.tar.gz: 0115f0af3b595803bdfa0bcfe04a0d109a3935ac32ab735eef2577a6523daa1b
5
5
  SHA512:
6
- metadata.gz: beb38d152e58c83c48c7a1d714b4ba635e6ce226e804d04e00b38568afc6b10f6f4a82e9074ac1e998d30ebd0ff2cdcb271c09748cdb2e3993a132d3e9f4ab06
7
- data.tar.gz: 5ad89b6ee986b7ac6a7d4ff7834905633a5302018a2e23de16769dab74bd3798ac4ace624f6c5641db3f2ef26de833914b710ca7bc744f7ddb65255c01460732
6
+ metadata.gz: f34adbca18a00f13e2a1c8bfd7be646d042fa68fc681bd214618bf85bf4ba57a30831ccc47665d713d1901597cf9aa41324f91042d726ee7e0c314f0deb96a2b
7
+ data.tar.gz: 1bdd078316a131230adf7957186826ce050719be9c416ee5795ba3f1cf4e17d3c2467845332b971ed856642993f57f28ccdbf6bc06acd25d75b40613757823df
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 1.0.1 (2024-04-27)
4
+
5
+ * Do not visit if `@callbacks` is empty
6
+
3
7
  ## 1.0.0 (2024-04-27)
4
8
 
5
9
  * Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- node_visitor (1.0.0)
4
+ node_visitor (1.0.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,3 +1,3 @@
1
1
  class NodeVisitor
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
data/lib/node_visitor.rb CHANGED
@@ -19,6 +19,8 @@ class NodeVisitor
19
19
  end
20
20
 
21
21
  def visit(node, block_context = self)
22
+ return if @callbacks.empty?
23
+
22
24
  callbacks = @callbacks[:all]
23
25
  callbacks.each { |callback| block_context.instance_exec(node, &callback[:block]) if callback[:at] == 'start' } if callbacks
24
26
  visit_node(node)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: node_visitor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Huang