foobara 0.0.41 → 0.0.42

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cda698679edac42fcee6ab465b327133ffa4f4e434feace0de447c177622d606
4
- data.tar.gz: 923e1d3e3c5eae09e16da7b256bb471e0656b2f76719c63d5ff105cc31283d8e
3
+ metadata.gz: c7b24f7f9af98e9e8e466db8a6cf173a23ec9ff6c9b79f9300a24d30e9706f48
4
+ data.tar.gz: e55ff2870498406775063852ccca4650da55ef6d6027db5702b2b0275a42624f
5
5
  SHA512:
6
- metadata.gz: c6b9d3ee2509a34e40c114f6558199d80c4b5408b7614200fab48cd19e2328eafaf2a73956d4a31a686a5cdda49e3615af3737638df4412467f99ed2ff7c9013
7
- data.tar.gz: 71f4f90c3d98e638d722cc47f5a821b2bba17c257ada30a77769bd6f4d62abff84c775cbc1dc99f4e065939f14a488782eb34994fc2e097f07604c3272cc0eb4
6
+ metadata.gz: 6a7998ddfa98ed8d45017a23aff622f95e8defd67d82a3fcb1a4ab6bd5c7f5de263793a6e7b3cff2572333a7842d4bceaa6431d24cf031929fa0d258cb68174c
7
+ data.tar.gz: 5c0f21ab259a5d31c208bb2c74fbfa040d7dfb13caed4bdfb365f789b9a9cb0eb153d5bb3d8fa17deee56207c53626ca7747843296dc50bc9a16c851f8f6265d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.42] - 2024-12-23
2
+
3
+ - Add a Domain.domain_through_modules helper
4
+
1
5
  ## [0.0.41] - 2024-12-19
2
6
 
3
7
  - Allow marking a project as a project from outside of the monorepo
@@ -8,6 +8,7 @@ module Foobara
8
8
  foobara_delegate :global_type_declaration_handler_registry, to: TypeDeclarations
9
9
 
10
10
  # TODO: break this up
11
+ # TODO: much of this behavior is helpful to non-builtin types as well.
11
12
  def build_and_register!(
12
13
  type_symbol,
13
14
  base_type,
@@ -36,6 +36,25 @@ module Foobara
36
36
  end
37
37
  end
38
38
 
39
+ def domain_through_modules(mod)
40
+ mod = Util.module_for(mod)
41
+
42
+ while mod
43
+ if mod.foobara_domain?
44
+ namespace = mod
45
+ break
46
+ end
47
+
48
+ mod = Util.module_for(mod)
49
+ end
50
+
51
+ if namespace&.foobara_domain?
52
+ namespace
53
+ else
54
+ GlobalDomain
55
+ end
56
+ end
57
+
39
58
  def create(full_domain_name)
40
59
  if Domain.to_domain(full_domain_name)
41
60
  raise DomainAlreadyExistsError, "Domain #{full_domain_name} already exists"
@@ -66,22 +66,7 @@ module Foobara
66
66
  if model_type
67
67
  model_type.foobara_domain
68
68
  else
69
- mod = Util.module_for(self)
70
-
71
- while mod
72
- if mod.foobara_domain?
73
- namespace = mod
74
- break
75
- end
76
-
77
- mod = Util.module_for(mod)
78
- end
79
-
80
- if namespace&.foobara_domain?
81
- namespace
82
- else
83
- GlobalDomain
84
- end
69
+ Domain.domain_through_modules(self)
85
70
  end
86
71
  end
87
72
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.41
4
+ version: 0.0.42
5
5
  platform: ruby
6
- original_platform: ''
7
6
  authors:
8
7
  - Miles Georgi
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-12-19 00:00:00.000000000 Z
10
+ date: 2024-12-24 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: foobara-util
@@ -422,7 +421,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
422
421
  - !ruby/object:Gem::Version
423
422
  version: '0'
424
423
  requirements: []
425
- rubygems_version: 3.6.0
424
+ rubygems_version: 3.6.2
426
425
  specification_version: 4
427
426
  summary: A command-centric and discoverable software framework with a focus on domain
428
427
  concepts and abstracting away integration code