hub_kernel 0.12.0 → 0.13.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: 229fcc87e3137795f02b73e3f0be126e9809181b14446e09e8a1a050fa83420e
4
- data.tar.gz: 2347fa14b7911dda34f7e1cbebb924eb10f99f8da0e5e086f112f78aa79440b9
3
+ metadata.gz: d68f714812e20170c2ee5c5317e29b64c8ebbae25431492f457ae4b53263d50e
4
+ data.tar.gz: bae431b97f2e98ff2a28ed9712ab415a3e3b2dfe18753e46d93be5acfa86a9f6
5
5
  SHA512:
6
- metadata.gz: e432500a7d6b4dc4c0e7a4061d74dfc81108435a640d4098afaa0a9ca58518790b75d94ba5e5d49e28c87e88925a1b6369f36968cc5b9fafb31480034730ecde
7
- data.tar.gz: fbf852ad51486ad330f5b7b0cefa7f36d599c7c713a0a95e2cffcbd689e41ea0042550a00e24c66a19778507e32ff992001aa90828ea10f6c8ed2d4f6d74f644
6
+ metadata.gz: 1035694fa2c676b368938c61ecc21d1403fe8b68f151dba1ef80e9fc7b9166460f09a0e9c6aa275dcd005b615fd66c08dce5ae5f6b6b4f02421241ff266f8ca1
7
+ data.tar.gz: cb84d351c30f19dd86c7351351ec29ffd01e930f21ba2aece3061724ed1c7cc2a0ca3d43ec8ea0335a0741ada0debf683d379f8fa48eb12c521a2ba057fa66d8
data/README.md CHANGED
@@ -199,6 +199,9 @@ end
199
199
  - It also fails naming each class defined in the files it reads that no hub owns, such as
200
200
  "No hub owns Shop::Refund", and each class the map gives to two hubs, such as "Two hubs
201
201
  own Shop::Receipt".
202
+ - It fails naming each class the map names that no longer exists in the app, such as "The
203
+ map names Shop::Ghost, which does not exist", so a renamed or removed class does not
204
+ stay in the map.
202
205
 
203
206
  ## Installation
204
207
  Add this line to your application's Gemfile:
@@ -34,6 +34,11 @@ module HubKernel
34
34
  twice = the_crossings.claimed_twice
35
35
  assert twice.empty?, twice.map { |name| "Two hubs own #{name}" }.join("\n")
36
36
  end
37
+
38
+ test "every class the map names exists" do
39
+ missing = the_crossings.missing_classes
40
+ assert missing.empty?, missing.map { |name| "The map names #{name}, which does not exist" }.join("\n")
41
+ end
37
42
  end
38
43
 
39
44
  def crossing_paths = (Dir.glob(crossing_files, base: crossing_root) - crossing_exceptions).sort
@@ -22,6 +22,8 @@ module HubKernel
22
22
 
23
23
  def claimed_twice = @owners.values.flatten.tally.select { |_name, hubs| hubs > 1 }.keys
24
24
 
25
+ def missing_classes = @owners.values.flatten.uniq.reject(&:safe_constantize)
26
+
25
27
  private
26
28
 
27
29
  def class_of(path) = path.sub(%r{\Aapp/[^/]+/}, "").delete_suffix(".rb").camelize
@@ -1,3 +1,3 @@
1
1
  module HubKernel
2
- VERSION = "0.12.0"
2
+ VERSION = "0.13.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hub_kernel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tylercschneider