kennel 1.96.0 → 1.96.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kennel/version.rb +1 -1
  3. data/lib/kennel.rb +20 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dad671ae1433588cff8641dbe5337c5db450d2bda9a05d61ba272a76c2482a5b
4
- data.tar.gz: 493cac344bfa4b1e2cab2de6e395887e91eac3d374fea84333af0268b8ee544d
3
+ metadata.gz: aca7576bcde423ec1f4e559d88f13ee64ed5efb116a212f49e67ac6b792ddb16
4
+ data.tar.gz: a6b60f7d6a73ca82d2478f565435e0ebb95a79f7d3bd5bcebfd6712a3e9c8cfb
5
5
  SHA512:
6
- metadata.gz: 6048d4264a57b5b1bbda44bbc302965de9b09ba8985f397d5c537910d1d79fad0b0e77b02dfcda9e43b2168bc32b1c3ad335081afb1f9f2a3c09096c811d0b4d
7
- data.tar.gz: d4f919fcda3553c30bcfb38719b9996b5eca9189c0f4d7d73718f52b526a5eb84cb35f128463ae35fbac525dd61aacc54f7d2447bcf53eff5ed4f2bc5a30cc22
6
+ metadata.gz: 1767ebe1e61ea9a314b99f14a2cd15a31dc09419dafa2a9100244c83acfc40cd9eba0ccf1e9ad6c4cf9c3026cd1493e6b62cdc6a867b18720ed517908e702768
7
+ data.tar.gz: 382486fbfb3c52346262ad43c63ed21164676189a880d405914de54539907a0a193960f173daa9aa16f41d847959b140a9c60cee886f85d63473d599bd00b807
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "1.96.0"
3
+ VERSION = "1.96.1"
4
4
  end
data/lib/kennel.rb CHANGED
@@ -138,10 +138,29 @@ module Kennel
138
138
  Dir.exist?("parts") && loader.push_dir("parts")
139
139
  loader.setup
140
140
 
141
- # TODO: also do projects
141
+ # TODO: also do projects and update expected path too
142
142
  ["projects"].each do |folder|
143
143
  Dir["#{folder}/**/*.rb"].sort.each { |f| require "./#{f}" }
144
144
  end
145
+ rescue NameError => e
146
+ message = e.message
147
+ raise unless klass = message[/uninitialized constant (.*)/, 1]
148
+
149
+ # inverse of zeitwerk lib/zeitwerk/inflector.rb
150
+ path = klass.gsub("::", "/").gsub(/([a-z])([A-Z])/, "\\1_\\2").downcase + ".rb"
151
+ expected_path = (path.start_with?("teams/") ? path : "parts/#{path}")
152
+
153
+ # TODO: prefer to raise a new exception with the old backtrace attacked
154
+ e.define_singleton_method(:message) do
155
+ "\n" + <<~MSG.gsub(/^/, " ")
156
+ #{message}
157
+ Unable to load #{klass} from #{expected_path}
158
+ - Option 1: rename the constant or the file it lives in, to make them match
159
+ - Option 2: Use `require` or `require_relative` to load the constant
160
+ MSG
161
+ end
162
+
163
+ raise
145
164
  end
146
165
  end
147
166
  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.96.0
4
+ version: 1.96.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: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2021-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday