kennel 1.157.0 → 1.158.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: a0eb799adf9a9e41a5b3220147a7e348ee75583e642d0ee9aa1db6ca2a021028
4
- data.tar.gz: 804bd718f42d35986d42ab53df20cd4ae97611f6e665553050812e24b653b833
3
+ metadata.gz: 0622cc6a3d8c7a66e692373a5cbd88ceafc6fa6d705524492a06c5e2c67e4204
4
+ data.tar.gz: d1c057023a8c6d0f093b752ec8cc64c9a8fa185e49d5251b44eeeb87f2441377
5
5
  SHA512:
6
- metadata.gz: 90dccebc1bba4e4ed329cbd3a495c7808c5ee37ea5b8705e64fc132de9ea3cb62f6f49cfc4e949c77364922ff6032609fa4c3e654ce0033e3b4be81ce2475084
7
- data.tar.gz: a5ba017d7c0887cd25ef7c9ce4effeba46dbc527c0705829cda5ce0f6deddd32fadda3856b9163ed245032c94d75e5d60bd91dcb614716da4760d956b231bb51
6
+ metadata.gz: fcfb2a52f2cbbe918d77bebfc2fc19334ad892691a538bd14dc043b52bbf71bcebb11793704798069a7779d20cf67cb096c88347c1f14d35e4a16b691ad3f99a
7
+ data.tar.gz: d21f845c889de0d9bcfc8e54fefa141e1abfaa3a50bd2556294e468c191d15eaa48cbf054c6f1b1c4f0a7d43b8d5df780f0e3e567b9002826bb6dffa5f1550b7
@@ -31,15 +31,19 @@ module Kennel
31
31
  # we support PROJECT being used for nested folders, to allow teams to easily group their projects
32
32
  # so when loading a project we need to find anything that could be a project source
33
33
  # sorting by name and nesting level to avoid confusion
34
+ segments = project.split("_")
35
+ search = /#{segments[0...-1].map { |p| "#{p}[_/]" }.join}#{segments[-1]}(\.rb|\/project\.rb)/
36
+
34
37
  projects_path = "#{File.expand_path("projects")}/"
35
- project_path = loader.all_expected_cpaths.each_key.select do |path|
36
- path.start_with?(projects_path) && path.end_with?("/#{project}.rb", "/#{project}/project.rb")
38
+ known_paths = loader.all_expected_cpaths.keys
39
+ project_path = known_paths.select do |path|
40
+ path.start_with?(projects_path) && path.match?(search)
37
41
  end.sort.min_by { |p| p.count("/") }
38
42
  if project_path
39
43
  require project_path
40
44
  else
41
45
  Kennel.err.puts(
42
- "No file named #{project}.rb or #{project}/project.rb" \
46
+ "No projects/ file matching #{search} found" \
43
47
  ", falling back to slow loading of all projects instead"
44
48
  )
45
49
  loader.eager_load
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.157.0"
3
+ VERSION = "1.158.0"
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.157.0
4
+ version: 1.158.0
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-03-22 00:00:00.000000000 Z
11
+ date: 2025-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: diff-lcs