kennel 2.22.1 → 2.22.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 21600f7f1ed4c550d106f75619a29a57cf2c6631c95a04b332f2d1a808fc94be
4
- data.tar.gz: e366f291cf986a51e7841a70641854fe3090ed39b8616b4acc6b80fc030dcf33
3
+ metadata.gz: 371dd82c75198714d213f7aae056198d110a862559e7c7f880aa3d94049590fa
4
+ data.tar.gz: b68693df3582c1c0344454af713c155210b9a477c311edff0278fd68134fc8f5
5
5
  SHA512:
6
- metadata.gz: cb9953eb8430131345f3b21ef6cec57ece7248114439a2d5c6bbe22ca522b72350077ff927f8521f51a97695827f8dc1b91cf1809b0c0e05d7dab486643465c7
7
- data.tar.gz: dca2a03ad0132035f34d331daf622ed41c281e993037212b8d7894fbdcdd6442dcc7fe62bc2ca9f125ef816027f70d94422a1e06bda60e42743309e8a787958c
6
+ metadata.gz: 56020b989084f93c418ac3afc2a03fafea9eb2e0b9d9d760c7b06a152556d67f884d523b38c9178b8777edc5c09faff5d465dffd846e2b56cbb5652b106fd53d
7
+ data.tar.gz: a10a1fb9a3b35bccde14f09a154b42f65f360d8887a0886df1fe73846d026df3a58f877ca247e7e7f572769cce0d0334a4a6f2e41edca26a98fdb0a11eb1d563
@@ -2,6 +2,11 @@
2
2
  module Kennel
3
3
  module Models
4
4
  class Project < Base
5
+ class FileLocationNotFound < StandardError
6
+ end
7
+
8
+ GEM_LIB = File.expand_path("..", __dir__)
9
+
5
10
  settings :team, :parts, :tags, :mention, :name, :kennel_id
6
11
  defaults(
7
12
  tags: -> { team.tags },
@@ -14,10 +19,12 @@ module Kennel
14
19
  if methods.any?
15
20
  @file_location = methods.detect do |method|
16
21
  location = instance_method(method).source_location.first
22
+ # methods created by `settings` point inside this gem, which is not the project file
23
+ next if location.start_with?("#{GEM_LIB}/")
17
24
  if (path = find_relative_path(location))
18
25
  break path
19
26
  end
20
- end || raise("Unable to find file_location for #{name}")
27
+ end || raise(FileLocationNotFound, "Unable to find file_location for #{name}")
21
28
  else
22
29
  @file_location = nil # not sure if this is actually needed
23
30
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Kennel
3
- VERSION = "2.22.1"
3
+ VERSION = "2.22.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kennel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.1
4
+ version: 2.22.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser