foobara 0.0.41 → 0.0.43

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: aa2be36d2ee83554bf301d1fffd4e39e99da510bb817c212835df9eab32b8a4e
4
+ data.tar.gz: 71232aec15786e518056e59c978d5ae42e291bf844110b6d01202200c8a35b25
5
5
  SHA512:
6
- metadata.gz: c6b9d3ee2509a34e40c114f6558199d80c4b5408b7614200fab48cd19e2328eafaf2a73956d4a31a686a5cdda49e3615af3737638df4412467f99ed2ff7c9013
7
- data.tar.gz: 71f4f90c3d98e638d722cc47f5a821b2bba17c257ada30a77769bd6f4d62abff84c775cbc1dc99f4e065939f14a488782eb34994fc2e097f07604c3272cc0eb4
6
+ metadata.gz: c9e95192d7d5a4da5f8ea25190bb1a14f99d9df8d7ef11370c87c02f9bba022b0d536d246beffad9dfd64dcc6c135dc9ac46c7463c94b4773729a100a0e0ae1c
7
+ data.tar.gz: 5430f3014eb74bc235e842decc7ab33790ac0359339005d1573123b9df8f6a4689f7a55aec0f32ec4b4fa24572c55c8e97c98520decd349805aa7cec938b3852
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.2
1
+ 3.4.1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.43] - 2025-01-03
2
+
3
+ - Bumped Ruby from 3.2.2 to 3.4.1
4
+
5
+ ## [0.0.42] - 2024-12-23
6
+
7
+ - Add a Domain.domain_through_modules helper
8
+
1
9
  ## [0.0.41] - 2024-12-19
2
10
 
3
11
  - Allow marking a project as a project from outside of the monorepo
data/README.md CHANGED
@@ -78,6 +78,8 @@ You can watch a video that gives a good overview of what Foobara is and its goal
78
78
  * Engineers can spend more time operating within a specific mental model at a time instead of
79
79
  multiple mental models all at once.
80
80
 
81
+ ![Command-centric + Discoverability](https://github.com/foobara/examples/blob/main/images/cc-plus-disc-small.jpg?raw=true)
82
+
81
83
  ## Other features for helping with Domain complexity
82
84
 
83
85
  * Domains and Organizations
@@ -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,
@@ -6,8 +6,7 @@ module Foobara
6
6
  def to_proc
7
7
  @to_proc ||= if has_keyword_args?
8
8
  proc do |*args, &block|
9
- keyword_args = args.reduce(:merge) || {}
10
- original_block.call(**keyword_args, &block)
9
+ original_block.call(**args.reduce(:merge), &block)
11
10
  end
12
11
  else
13
12
  original_block
@@ -261,7 +261,7 @@ module Foobara
261
261
  def process_delayed_connections
262
262
  delayed_connections.each_pair do |registerable_name, arg_hash|
263
263
  args = arg_hash[:args]
264
- opts = arg_hash[:opts] || {}
264
+ opts = arg_hash[:opts]
265
265
 
266
266
  const = Object.const_get(registerable_name)
267
267
  connect(const, *args, **opts)
@@ -211,8 +211,6 @@ module Foobara
211
211
  end
212
212
 
213
213
  def normalize(key_parts)
214
- return nil if key_parts.nil?
215
-
216
214
  case key_parts
217
215
  when Array
218
216
  key_parts.map do |key_part|
@@ -223,9 +221,7 @@ module Foobara
223
221
  when Integer
224
222
  key_parts
225
223
  when String
226
- if key_parts.empty?
227
- nil
228
- elsif key_parts =~ INDEX_VALUE
224
+ if key_parts =~ INDEX_VALUE
229
225
  key_parts.to_i
230
226
  else
231
227
  key_parts.to_sym
@@ -153,11 +153,7 @@ module Foobara
153
153
  when Symbol, Integer
154
154
  key_parts
155
155
  when String
156
- if key_parts.empty?
157
- nil
158
- else
159
- key_parts.to_sym
160
- end
156
+ key_parts.to_sym
161
157
  else
162
158
  # :nocov:
163
159
  raise ArgumentError, "expected nil, a symbol, or a string, an integer, or an array of such values "
@@ -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
 
@@ -55,7 +55,9 @@ module Foobara
55
55
  # interpret how it goes. This might create some awkwardness or confusion at least when creating one of the
56
56
  # two types of transformer.
57
57
  def type_declaration(_from_type)
58
+ # :nocov:
58
59
  nil
60
+ # :nocov:
59
61
  end
60
62
 
61
63
  def type(from_type)
@@ -66,7 +68,6 @@ module Foobara
66
68
  dec
67
69
  else
68
70
  Domain.current.foobara_type_from_declaration(dec)
69
-
70
71
  end
71
72
  end
72
73
  end
metadata CHANGED
@@ -1,15 +1,28 @@
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.43
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: 2025-01-03 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: bigdecimal
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: foobara-util
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -415,14 +428,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
415
428
  requirements:
416
429
  - - ">="
417
430
  - !ruby/object:Gem::Version
418
- version: 3.2.2
431
+ version: 3.4.0
419
432
  required_rubygems_version: !ruby/object:Gem::Requirement
420
433
  requirements:
421
434
  - - ">="
422
435
  - !ruby/object:Gem::Version
423
436
  version: '0'
424
437
  requirements: []
425
- rubygems_version: 3.6.0
438
+ rubygems_version: 3.6.2
426
439
  specification_version: 4
427
440
  summary: A command-centric and discoverable software framework with a focus on domain
428
441
  concepts and abstracting away integration code