archspec 1.1.0.rc2 → 1.1.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: 9ae3db03b27c8b620de672283e7ff539eacf0e02db06a8f02c169aad8f4bf314
4
- data.tar.gz: '01364687e888415205e3397ffc649e38d96e6bd5ae63cc2dbaae6c453d6bdd22'
3
+ metadata.gz: 8c675a4a926497ac7ff0228a2eebe90ad4eddb39463bdbbcd1732f60f078ba5e
4
+ data.tar.gz: 2bbde647e0e899bba0a20f7953028506cfb0dcc756101a75bd4c49c11282624e
5
5
  SHA512:
6
- metadata.gz: a3744ea8826f19ff6a0c125c54bfac608c36faca53d4a56e15f5c0a5bbc334610985c34cba9cc5b2624939a18062e82d8a4d7c47a21fcaa0ab7250f561516b15
7
- data.tar.gz: 74b660133723ac4baa18c980c2caa53a9e63e373f37abeb5a2c2a57b43d022a4c41faf6ab4ea3b45bd88f71d5ead637308c106801dfe880179bded85e4b5008b
6
+ metadata.gz: c42af70bb7cfb04ad3f0feca6dc429b14bc1f9e55eb3b4001f4fd11aead8ca0061b22c14097def6b182d09435764e9c44e0132f02b4964718ba47fc64ee37544
7
+ data.tar.gz: 3505aa0af7fc166ce59d316eda7dfbe4deb24dbede4bbbc507f4516b82d0090c9c8b3eba4f70c3379978be6a9f582c6bb742c9416ac0b63529bb5f68aa90eb1b
@@ -35,14 +35,14 @@ module ArchSpec
35
35
  next if consumers.empty?
36
36
 
37
37
  target = graph.resolve_edge_constant(edge)
38
- next if within_namespace?(target, edge.from_constant)
39
-
40
- includer = consumers.find { |name| within_namespace?(target, name) }
41
- next unless includer
38
+ owner = [edge.from_constant, *consumers]
39
+ .select { |namespace| within_namespace?(target, namespace) }
40
+ .max_by(&:length)
41
+ next unless consumers.include?(owner)
42
42
 
43
43
  Diagnostic.new(
44
44
  rule: id,
45
- message: "#{edge.from_constant} must not reference its includer #{includer}",
45
+ message: "#{edge.from_constant} must not reference its includer #{owner}",
46
46
  location: edge.location,
47
47
  evidence: "#{edge.from_constant} #{edge.verb} #{target}"
48
48
  )
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArchSpec
4
- VERSION = '1.1.0.rc2'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.rc2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carmine Paolino