foobara 0.0.40 → 0.0.42

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: f41a89aeb647d26d212e2307c71f8de476f2920cbd5ba32707cce099087562ee
4
- data.tar.gz: 873ef3c53d25f4ee069892a9a2943b8a7e0d8f4e6d2e8bfb78890d01b3016061
3
+ metadata.gz: c7b24f7f9af98e9e8e466db8a6cf173a23ec9ff6c9b79f9300a24d30e9706f48
4
+ data.tar.gz: e55ff2870498406775063852ccca4650da55ef6d6027db5702b2b0275a42624f
5
5
  SHA512:
6
- metadata.gz: 9e8cb39793b95d47aaa8bdc4e49eccd5feb41207ef41e0c2444c63328e13a00c7199e9bd0a5f977d4cf2bb483063ec32a091bd7e7953dd615913feacef7b30c5
7
- data.tar.gz: 33c727eb4cf515997e3dd940e5c3ca767b44217308d5500e9dafd18c175c3979dc0d364cae6919302540b047f1903316a873d1fbc8176276966c9b3e46b89a51
6
+ metadata.gz: 6a7998ddfa98ed8d45017a23aff622f95e8defd67d82a3fcb1a4ab6bd5c7f5de263793a6e7b3cff2572333a7842d4bceaa6431d24cf031929fa0d258cb68174c
7
+ data.tar.gz: 5c0f21ab259a5d31c208bb2c74fbfa040d7dfb13caed4bdfb365f789b9a9cb0eb153d5bb3d8fa17deee56207c53626ca7747843296dc50bc9a16c851f8f6265d
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [0.0.40] - 2024-12-19
1
+ ## [0.0.42] - 2024-12-23
2
+
3
+ - Add a Domain.domain_through_modules helper
4
+
5
+ ## [0.0.41] - 2024-12-19
2
6
 
3
7
  - Allow marking a project as a project from outside of the monorepo
4
8
 
@@ -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
 
@@ -7,9 +7,9 @@ module Foobara
7
7
 
8
8
  # TODO: we should move these concepts out of "Monorepo" and maybe into Foobara because we sometimes need to
9
9
  # be able to install!/reset foobara code that's been extracted into a gem
10
- def initialize(symbol, project_path: "#{__dir__}/../../../../../projects/#{symbol}")
10
+ def initialize(symbol, project_path: nil)
11
11
  self.symbol = symbol
12
- self.project_path = project_path
12
+ self.project_path = project_path || "#{__dir__}/../../../../../projects/#{symbol}"
13
13
  end
14
14
 
15
15
  def require_path
@@ -27,14 +27,14 @@ module Foobara
27
27
  end
28
28
  end
29
29
 
30
- def project(symbol)
30
+ def project(symbol, project_path: nil)
31
31
  if all_projects.key?(symbol)
32
32
  # :nocov:
33
33
  raise ArgumentError, "Project #{symbol} already loaded"
34
34
  # :nocov:
35
35
  end
36
36
 
37
- project = Project.new(symbol)
37
+ project = Project.new(symbol, project_path:)
38
38
  project.load
39
39
 
40
40
  all_projects[symbol] = project
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.40
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