kennel 1.163.0 → 1.163.1

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: 0b07d4f21ef18f6f89875f4bdb1f4ba86144d4291180ffeff34ef6c8c8b6ad01
4
- data.tar.gz: e90f0c27577b343baf745b342b6eea95053b029a788bdaf740c9a1e717da0303
3
+ metadata.gz: 81d0c04d0d3a16c2c46d12aa217e5c5353702a613af3a0d3fea52832839ebd12
4
+ data.tar.gz: 4619a82006932e5d0dc4782488b1caec8a789ab4614b8968185ba41defd768d7
5
5
  SHA512:
6
- metadata.gz: 4aa14e50c3b4c17690de793c84889e0a92fa48c6d59b491226cc487de75922ec98300cdaded30781ac22f1845c14a834aa9fec0bffe2b31d72fc4726a7948d95
7
- data.tar.gz: 95b2a1d28f5f98703c7ba448cf865009e9d53989bb7aec3492adddde172f032ebdae447688615e29a1d47055f785a50ee8ea9fe7278ab7c88436b5e418529c7e
6
+ metadata.gz: 87bb834a983a635134521548d01f278dcd26c93cbb88c5e929ca3a7a454b241dfccd5e74ec65936c61120d9785dbab027c028c12a35fbb9b481efb0bd4bde157
7
+ data.tar.gz: 94abdde8bf155cd9ea7a6ed74d3e7216937af142224b2e8e7766b0506874d7abfa9c494c05716f365644272e439bece107126c9edae038ca79e919fd00939db3
@@ -13,7 +13,7 @@ module Kennel
13
13
  # Use `projects` to get all projects in the system.
14
14
  def all_projects
15
15
  load_all
16
- Models::Project.recursive_subclasses.map(&:new)
16
+ loaded_projects.map(&:new)
17
17
  end
18
18
 
19
19
  # @return [Array<Models::Project>]
@@ -21,11 +21,15 @@ module Kennel
21
21
 
22
22
  def projects
23
23
  load_all
24
- Models::Project.recursive_subclasses.map(&:new)
24
+ loaded_projects.map(&:new)
25
25
  end
26
26
 
27
27
  private
28
28
 
29
+ def loaded_projects
30
+ Models::Project.recursive_subclasses
31
+ end
32
+
29
33
  # load_all's purpose is to "require" all the .rb files under './projects',
30
34
  # while allowing them to resolve reference to ./teams and ./parts via autoload
31
35
  def load_all
@@ -53,9 +57,27 @@ module Kennel
53
57
  projects.each do |project|
54
58
  segments = project.tr("-", "_").split("_")
55
59
  search = /#{segments[0...-1].map { |part| "#{part}[_/]" }.join}#{segments[-1]}(\.rb|\/project\.rb|\/base\.rb)/
60
+ found = known_paths.grep(search).sort.sort_by { |path| path.count("/") }
61
+ if found.any?
62
+ require found.first
63
+ if loaded_projects.empty?
64
+ found.map! { |path| path.sub("#{Dir.pwd}/", "") }
65
+ raise(
66
+ AutoloadFailed,
67
+ <<~MSG
68
+ No project found in loaded files!
69
+ Ensure the project file you want to load is first in the list,
70
+ list is sorted alphabetically and by nesting level.
56
71
 
57
- if (project_path = known_paths.grep(search).sort.min_by { |path| path.count("/") })
58
- require project_path
72
+ Loaded:
73
+ #{found.first}
74
+ After finding:
75
+ #{found.join("\n")}
76
+ With regex:
77
+ #{search}
78
+ MSG
79
+ )
80
+ end
59
81
  elsif autoload != "abort"
60
82
  Kennel.err.puts(
61
83
  "No projects/ file matching #{search} found" \
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.163.0"
3
+ VERSION = "1.163.1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.163.0
4
+ version: 1.163.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-13 00:00:00.000000000 Z
11
+ date: 2025-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs