kennel 1.163.1 → 1.163.2
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 +4 -4
- data/lib/kennel/projects_provider.rb +38 -27
- data/lib/kennel/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d1c9696c979e6a8bedf59a717376cb9d483164c86683a90e2208087694c1a83
|
4
|
+
data.tar.gz: f8c0b7f924cb4e8e3c0c3966406b47de23e472034e6fafaef5e5817826e12bb5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 218aefed2969de6f3ce27c2bb94248a486fc9eae81eda0cf546d0016995b92e994e8561abbece9c9b87cf64f0de8c266769d0aefb13bdeed90f989b683b06559
|
7
|
+
data.tar.gz: 88c1cea6f02c9952ab27de289867d2df12bbbb5e3d6bf6053145b434b34efe350e7ec01060379adee1edf244ad25ec104f9bfe03cf1fd9b1ee1e0c9db0d44979
|
@@ -51,37 +51,18 @@ module Kennel
|
|
51
51
|
projects_path = "#{File.expand_path("projects")}/"
|
52
52
|
known_paths = loader.all_expected_cpaths.keys.select! { |path| path.start_with?(projects_path) }
|
53
53
|
|
54
|
-
# - we support PROJECT being used for nested folders, to allow teams to easily group their projects
|
55
|
-
# - when loading a project we need to find anything that could be a project source
|
56
|
-
# sorting by name and nesting level to avoid confusion
|
57
54
|
projects.each do |project|
|
58
|
-
|
59
|
-
|
55
|
+
search = project_search project
|
56
|
+
|
57
|
+
# sort by name and nesting level to pick the best candidate
|
60
58
|
found = known_paths.grep(search).sort.sort_by { |path| path.count("/") }
|
59
|
+
|
61
60
|
if found.any?
|
62
61
|
require found.first
|
63
|
-
|
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.
|
71
|
-
|
72
|
-
Loaded:
|
73
|
-
#{found.first}
|
74
|
-
After finding:
|
75
|
-
#{found.join("\n")}
|
76
|
-
With regex:
|
77
|
-
#{search}
|
78
|
-
MSG
|
79
|
-
)
|
80
|
-
end
|
62
|
+
assert_project_loaded search, found
|
81
63
|
elsif autoload != "abort"
|
82
64
|
Kennel.err.puts(
|
83
|
-
"No projects/ file matching #{search} found"
|
84
|
-
", falling back to slow loading of all projects instead"
|
65
|
+
"No projects/ file matching #{search} found, falling back to slow loading of all projects instead"
|
85
66
|
)
|
86
67
|
loader.eager_load
|
87
68
|
break
|
@@ -89,10 +70,12 @@ module Kennel
|
|
89
70
|
raise AutoloadFailed, "No projects/ file matching #{search} found"
|
90
71
|
end
|
91
72
|
end
|
92
|
-
else
|
73
|
+
else
|
74
|
+
# all projects needed
|
93
75
|
loader.eager_load
|
94
76
|
end
|
95
|
-
else
|
77
|
+
else
|
78
|
+
# old style without autoload to be removed eventually
|
96
79
|
loader.setup
|
97
80
|
loader.eager_load # TODO: this should not be needed but we see hanging CI processes when it's not added
|
98
81
|
# TODO: also auto-load projects and update expected path too
|
@@ -121,5 +104,33 @@ module Kennel
|
|
121
104
|
|
122
105
|
raise
|
123
106
|
end
|
107
|
+
|
108
|
+
# - support PROJECT being used for nested folders, to allow teams to easily group their projects
|
109
|
+
# - support PROJECT.rb but also PROJECT/base.rb or PROJECT/project.rb
|
110
|
+
def project_search(project)
|
111
|
+
suffixes = ["base.rb", "project.rb"]
|
112
|
+
project_match = Regexp.escape(project.tr("-", "_")).gsub("_", "[-_/]")
|
113
|
+
/\/#{project_match}(\.rb|#{suffixes.map { |s| Regexp.escape "/#{s}" }.join("|")})$/
|
114
|
+
end
|
115
|
+
|
116
|
+
def assert_project_loaded(search, paths)
|
117
|
+
return if loaded_projects.any?
|
118
|
+
paths = paths.map { |path| path.sub("#{Dir.pwd}/", "") }
|
119
|
+
raise(
|
120
|
+
AutoloadFailed,
|
121
|
+
<<~MSG
|
122
|
+
No project found in loaded files!
|
123
|
+
Ensure the project file you want to load is first in the list,
|
124
|
+
list is sorted alphabetically and by nesting level.
|
125
|
+
|
126
|
+
Loaded:
|
127
|
+
#{paths.first}
|
128
|
+
After finding:
|
129
|
+
#{paths.join("\n")}
|
130
|
+
With regex:
|
131
|
+
#{search}
|
132
|
+
MSG
|
133
|
+
)
|
134
|
+
end
|
124
135
|
end
|
125
136
|
end
|
data/lib/kennel/version.rb
CHANGED
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.
|
4
|
+
version: 1.163.2
|
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-
|
11
|
+
date: 2025-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: diff-lcs
|