foobara 0.0.16 → 0.0.18

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: a386511b5dd07ad9a067ce02cdf7dfef7436a9db51fe938e26e1dec2c42b836f
4
- data.tar.gz: bf3f4960d49e6ca8f9a17ee7f4ceb7d3f04dd433172bc0028d8314081c933049
3
+ metadata.gz: 20e1fd1d627256c51ce809f550eec383139b59e29b6d45062deac0f0d3a0b3ec
4
+ data.tar.gz: 59f5be1a4dbbf0085971965bd23e7f7ff077fd61d18ec0cb903a48e2a4f8196c
5
5
  SHA512:
6
- metadata.gz: 7cd69b5365baa7bb77534875bed988c638b2c48d79d28119337adca49c8a2551bd958bd3835da682fc143d57186ba7efbf8a36630fc573d0991ae0c10c4cf6bb
7
- data.tar.gz: e00097bd3e762179bd14bfa9e292a2b93c6f063d5dd67b82ec6942d7578af206dd97322a560a7f0e9771bb5b799d2acb34d07e08db4d3f46f6f22ab48f2be642
6
+ metadata.gz: f8da4d579c0e7b159cb1a4531589f310d52e755312f33fc72195b8e2f64c599d797b2b2329b8bbccc58a42bd2f5640f1a7716e58d5edf158955a4774d4b6a29d
7
+ data.tar.gz: 9de070ec54db593d33a5234630dc4c8c0ab43e9605dd6630dcde55ee4fc73d51c3469cb8fbb5fe97c03592889e9c787b8450e1a07936977dbc3bfc7bdf13067a
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.2.2
data/CHANGELOG.md CHANGED
@@ -1,7 +1,13 @@
1
- ## [0.0.16] - 2024-11-22
1
+ ## [0.0.18] - 2024-11-30
2
+
3
+ - Add some noop crud driver method implementations to
4
+ make implementing simple crud drivers easier
5
+
6
+ ## [0.0.17] - 2024-11-22
2
7
 
3
8
  - Fix bug where mutable not being set explicitly raises
4
9
  - Also, make it so models don't default to mutable false when processed by a model type
10
+ - Add a Transaction#perform convenience method
5
11
 
6
12
  ## [0.0.15] - 2024-11-20
7
13
 
data/README.md CHANGED
@@ -1,9 +1,42 @@
1
1
  # Foobara
2
2
 
3
- Foobara is a command-based software framework with an emphasis on reflection features to facilitate integration with
4
- other systems or subsystems. The focus of the framework is to provide these features to help
5
- with managing domain complexity in projects with higher domain complexity. However, Foobara
6
- is also expected to be pleasant for use in projects with simpler domains as well.
3
+ Foobara is a software framework meant to help with projects that have
4
+ a complicated business domain. It accomplishes this by helping to
5
+ build projects that are command-centric and discoverable, as well as some other features.
6
+
7
+ ### Commands
8
+
9
+ * Foobara commands are meant to encapsulate high-level domain operations.
10
+ * They serve as the public interface to Foobara systems/subsystems.
11
+ * They are organized into Organizations and Domains.
12
+
13
+ ### Discoverability
14
+ * This means there is a formal machine-readable description of the systems/subsystems
15
+ * The implication of this is that integration code can be abstracted away.
16
+
17
+ ### Implications of command-centric + discoverability
18
+ * The system better communicates the mental model of the problem and the chosen solution
19
+ * Engineers are able to spend more time writing code relevant to the domain and less time
20
+ writing code related to specific tech-stack, software pattern, or architecture decisions.
21
+ * Engineers can spend more time operating within a specific mental model at a time instead of
22
+ multiple mental models all at once.
23
+
24
+ ### Other features for helping with Domain complexity
25
+
26
+ * Domain mappers
27
+ * These can map a concept from one domain to another.
28
+ * This separation of concerns leads to commands that have code
29
+ that reflects the domain they belong to as opposed to logic from many different domains.
30
+ * Remote commands
31
+ * These have the same interface as commands that live in other systems and act as a proxy to them.
32
+ * This allows rearchitecting of systems without changing interfaces and so reducing refactoring/testing required.
33
+ * These currently exist for both Ruby and Typescript
34
+ * An extract-repo script
35
+ * Can be used to extract files from one Foobara project to another, preserving history.
36
+ * Making this easier can help with rearchitecting systems.
37
+ * Custom crud-drivers (if needed)
38
+ * You could hypothetically write your own custom CRUD driver that knows how
39
+ to assemble an entity record with a clean mental model from a mismodeled legacy database.
7
40
 
8
41
  ## Installation
9
42
 
@@ -2,26 +2,6 @@ module Foobara
2
2
  module Persistence
3
3
  module CrudDrivers
4
4
  class InMemoryMinimal < EntityAttributesCrudDriver
5
- # TODO: delete
6
- def open_connection(_connection_or_credentials)
7
- # TODO: figure out what we expect here when there is no connection necessary
8
- Object.new
9
- end
10
-
11
- def open_transaction
12
- # TODO: figure out what we expect here when there is no native transaction support
13
- Object.new
14
- end
15
-
16
- def close_transaction(_raw_tx)
17
- # can't fail since there's no native transaction support...
18
- end
19
-
20
- def rollback_transaction(_raw_tx)
21
- # nothing to do... except maybe enter a state where we don't flush anything else
22
- # but can just rely on higher-up plumbing for that
23
- end
24
-
25
5
  class Table < EntityAttributesCrudDriver::Table
26
6
  attr_accessor :records
27
7
 
@@ -8,41 +8,29 @@ module Foobara
8
8
  self.tables = {}
9
9
  end
10
10
 
11
- # TODO: audit that this interface is correct
11
+ # Default behavior is for technologies that don't have a connection concept
12
+ # in a proper sense
12
13
  def open_connection(_connection_or_credentials)
13
- # :nocov:
14
- raise "subclass responsibility"
15
- # :nocov:
14
+ # should we return some kind of Connection object here even if it does nothing interesting?
16
15
  end
17
16
 
17
+ # Default behavior is for storage technologies that don't support proper
18
+ # transaction support
18
19
  def open_transaction
19
- # :nocov:
20
- raise "subclass responsibility"
21
- # :nocov:
20
+ # Should we have some kind of fake transaction object that raises errors when used after rolledback/closed?
21
+ Object.new
22
22
  end
23
23
 
24
24
  def flush_transaction(_raw_tx)
25
- # :nocov:
26
- raise "subclass responsibility"
27
- # :nocov:
28
25
  end
29
26
 
30
27
  def revert_transaction(_raw_tx)
31
- # :nocov:
32
- raise "subclass responsibility"
33
- # :nocov:
34
28
  end
35
29
 
36
30
  def rollback_transaction(_raw_tx)
37
- # :nocov:
38
- raise "subclass responsibility"
39
- # :nocov:
40
31
  end
41
32
 
42
33
  def close_transaction(_raw_tx)
43
- # :nocov:
44
- raise "subclass responsibility"
45
- # :nocov:
46
34
  end
47
35
 
48
36
  def table_for(entity_class)
@@ -157,6 +157,11 @@ module Foobara
157
157
  def flush_created_record!(record)
158
158
  table_for(record).flush_created_record!(record)
159
159
  end
160
+
161
+ # convenience method...
162
+ def perform(&)
163
+ entity_base.using_transaction(self, &)
164
+ end
160
165
  end
161
166
  end
162
167
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-22 00:00:00.000000000 Z
11
+ date: 2024-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foobara-util
@@ -32,6 +32,7 @@ executables: []
32
32
  extensions: []
33
33
  extra_rdoc_files: []
34
34
  files:
35
+ - ".ruby-version"
35
36
  - CHANGELOG.md
36
37
  - LICENSE-MPL-2.0.txt
37
38
  - LICENSE.txt
@@ -354,13 +355,13 @@ files:
354
355
  - projects/value/src/validator.rb
355
356
  - projects/weak_object_set/lib/foobara/weak_object_set.rb
356
357
  - projects/weak_object_set/src/weak_object_set.rb
357
- homepage: https://github.com/foobara/foobara
358
+ homepage: https://foobara.com
358
359
  licenses:
359
360
  - MPL-2.0
360
361
  metadata:
361
- homepage_uri: https://github.com/foobara/foobara
362
- source_code_uri: https://github.com/foobara/foobara
363
- changelog_uri: https://github.com/foobara/foobara/CHANGELOG.md
362
+ homepage_uri: https://foobara.com
363
+ source_code_uri: https://foobara.com
364
+ changelog_uri: https://foobara.com/blob/main/CHANGELOG.md
364
365
  rubygems_mfa_required: 'true'
365
366
  post_install_message:
366
367
  rdoc_options: []