optics-agent 0.4.3 → 0.4.4

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
  SHA1:
3
- metadata.gz: e66f0b58d77d29c4999ab86a26b9881eec66b75d
4
- data.tar.gz: 2cbac6e78c27f4636cc40c94e8cf613e764946a7
3
+ metadata.gz: f59e8f0e2858f85ede7fbc3410cc249e213326f8
4
+ data.tar.gz: dc667895f061a9edf99feb1d5bf44e1029ed0157
5
5
  SHA512:
6
- metadata.gz: 1eec3c92af1dfad4da0a0c22bba4eb0d458100e4947a3c4392867884e1f1caff11550d973aca07c4147becd0eef51bb712e5e72ab4955c03a53c3b9f011509b9
7
- data.tar.gz: 56466763944928e04c81a8467a774fd978064ce8d144be2445058add1179af57fb0bc523125c91e56be948f6566474124044d27943fbc5e39a4c928e7cd12974
6
+ metadata.gz: 5859a00a6d4f2e051948dc7e64357453c7327cff2195846732e2da0abf0c13344093aecc8f4b93157e275accec009c6977fc14a74cc4f5fac5277a492df1f4e8
7
+ data.tar.gz: 8c82ad95ee7d2363c76cfbc846323c23e87650aaf09f4e4ad00a5eda5785ecc46a2af5adf20b5fc6fbcdad7df23e3a77ee3b5a718646c746b1d4b4d4a2d19f8e
@@ -16,14 +16,20 @@ module OpticsAgent
16
16
  visitor = Visitor.new(document)
17
17
 
18
18
  stack = []
19
- visitor.enter << -> (_, _) do
20
- stack.unshift(
21
- arguments: [],
22
- directives: [],
23
- selections: []
24
- )
19
+ Nodes.constants.each do |constant|
20
+ mod = Nodes.const_get(constant)
21
+ next unless mod.is_a? Module
22
+
23
+ visitor[mod].enter << -> (_, _) do
24
+ stack.unshift(
25
+ arguments: [],
26
+ directives: [],
27
+ selections: []
28
+ )
29
+ end
30
+
31
+ visitor[mod].leave << -> (_, _) { current = stack.shift }
25
32
  end
26
- visitor.leave << -> (_, _) { current = stack.shift }
27
33
 
28
34
  visitor[Nodes::Argument].leave << -> (node, parent) do
29
35
  stack[0][:arguments] << "#{node.name}:#{genericize_type(node.value)}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optics-agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.3
4
+ version: 0.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - 'Tom Coleman '