archspec 1.1.0.rc1 → 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: 3d1149a18e2ffb69c03d15e95ca539d3c42c1fda406376069313b9e07365a1b1
4
- data.tar.gz: 290b05eb65ad246ebd1d81a025abe013a3150d5afc7e0bb6cb834dae3f64a429
3
+ metadata.gz: 8c675a4a926497ac7ff0228a2eebe90ad4eddb39463bdbbcd1732f60f078ba5e
4
+ data.tar.gz: 2bbde647e0e899bba0a20f7953028506cfb0dcc756101a75bd4c49c11282624e
5
5
  SHA512:
6
- metadata.gz: 2e02c22290a4616b60edb2a5fd97ba991237e6da3b2fe495a5fde7802ac520fa432c821a9eb895c98333ce1acb170aff476ffa016c1de924199a9b47463d3994
7
- data.tar.gz: 99d07ea4daff657b1823a81beff200f2139a3646c1ef7ad1bb3f041f13a9a03d7bd39a8b5b4b0176bda00ca13506043a691a1c93f65f54eed33a17c129e0f6af
6
+ metadata.gz: c42af70bb7cfb04ad3f0feca6dc429b14bc1f9e55eb3b4001f4fd11aead8ca0061b22c14097def6b182d09435764e9c44e0132f02b4964718ba47fc64ee37544
7
+ data.tar.gz: 3505aa0af7fc166ce59d316eda7dfbe4deb24dbede4bbbc507f4516b82d0090c9c8b3eba4f70c3379978be6a9f582c6bb742c9416ac0b63529bb5f68aa90eb1b
@@ -35,12 +35,14 @@ module ArchSpec
35
35
  next if consumers.empty?
36
36
 
37
37
  target = graph.resolve_edge_constant(edge)
38
- includer = consumers.find { |name| target == name || target.start_with?("#{name}::") }
39
- 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)
40
42
 
41
43
  Diagnostic.new(
42
44
  rule: id,
43
- message: "#{edge.from_constant} must not reference its includer #{includer}",
45
+ message: "#{edge.from_constant} must not reference its includer #{owner}",
44
46
  location: edge.location,
45
47
  evidence: "#{edge.from_constant} #{edge.verb} #{target}"
46
48
  )
@@ -49,6 +51,10 @@ module ArchSpec
49
51
 
50
52
  private
51
53
 
54
+ def within_namespace?(constant, namespace)
55
+ constant == namespace || constant.start_with?("#{namespace}::")
56
+ end
57
+
52
58
  # Maps each mixed-in module to the set of constants that mix it in.
53
59
  def includers_by_module(graph)
54
60
  map = Hash.new { |hash, key| hash[key] = Set.new }
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ArchSpec
4
- VERSION = '1.1.0.rc1'
4
+ VERSION = '1.1.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0.rc1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carmine Paolino
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-08-26 00:00:00.000000000 Z
11
+ date: 2026-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: prism