foobara 0.0.134 → 0.0.135
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/projects/command_connectors/lib/foobara/command_connectors.rb +1 -1
- data/projects/command_connectors/src/command_connector.rb +1 -1
- data/projects/foobara/lib/foobara/all.rb +36 -32
- data/projects/foobara/lib/foobara.rb +1 -0
- data/projects/foobara/src/foobara.rb +53 -0
- data/projects/foobara/src/project.rb +48 -0
- metadata +3 -4
- data/projects/monorepo/lib/foobara/monorepo/project.rb +0 -54
- data/projects/monorepo/lib/foobara/monorepo.rb +0 -63
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0560b5378293e0abf5477c545b37e05646ffd31e90160e60dd9f9e107e5307f5
|
4
|
+
data.tar.gz: 1b56363410e7a2af706f001559ee7a43c9ba27683b7a2de163747c8645054e5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3af812dd4decf50d37a5080d52299aa6eafe1643846ea92e73fa1acc6bc535f6772e8cb56356fad3065ec3b0dda1ed6be695f0fb826f9fd8cf9956014dd06af
|
7
|
+
data.tar.gz: 8cafe756d10ed613cdb4da5e521a37f8e1c8cd8c40738744898224ff4cb5aadf244ac92c81f9aa608b1666debcd72a3c2ca6776262f2a4d649524dc2f8f2b4b9
|
data/CHANGELOG.md
CHANGED
@@ -303,7 +303,7 @@ module Foobara
|
|
303
303
|
end
|
304
304
|
|
305
305
|
def connect_delayed(registerable_name, *args, **opts)
|
306
|
-
delayed_connections[registerable_name] = { args:, opts: }
|
306
|
+
delayed_connections[registerable_name.to_s] = { args:, opts: }
|
307
307
|
end
|
308
308
|
|
309
309
|
def delayed_connections
|
@@ -1,43 +1,47 @@
|
|
1
1
|
require "foobara/util"
|
2
|
-
|
2
|
+
# TODO: Weird to have both of these requiring each other...
|
3
|
+
require "foobara"
|
4
|
+
|
5
|
+
Foobara::Util.require_directory "#{__dir__}/../../src"
|
3
6
|
|
4
7
|
module Foobara
|
8
|
+
# TODO: delete this but deprecate it for now to not break other projects
|
9
|
+
Monorepo = Foobara
|
10
|
+
|
5
11
|
module All
|
6
12
|
# just makes Rubocop happy
|
7
13
|
# TODO: delete this and make Rubocop exception in .rubocop.yml
|
8
14
|
end
|
9
15
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
"namespace"
|
16
|
+
# could be independent projects
|
17
|
+
projects "delegate", # Let's just kill delegate
|
18
|
+
"concerns",
|
19
|
+
"weak_object_set",
|
20
|
+
"enumerated",
|
21
|
+
"callback",
|
22
|
+
"state_machine",
|
23
|
+
"namespace"
|
19
24
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
25
|
+
# various components of the foobara framework that have some level of coupling.
|
26
|
+
# for example, Error in common knows about (or could be implemented to know about)
|
27
|
+
# type declarations to expose its context type.
|
28
|
+
projects "domain",
|
29
|
+
"common",
|
30
|
+
"value",
|
31
|
+
"types",
|
32
|
+
"type_declarations",
|
33
|
+
"builtin_types",
|
34
|
+
"model",
|
35
|
+
"detached_entity",
|
36
|
+
"entity",
|
37
|
+
"model_attribute_helpers",
|
38
|
+
"nested_transactionable",
|
39
|
+
"command",
|
40
|
+
"domain_mapper",
|
41
|
+
"persistence", # Feels like this would be loaded before command?
|
42
|
+
"in_memory_crud_driver_minimal",
|
43
|
+
"in_memory_crud_driver",
|
44
|
+
"manifest"
|
40
45
|
|
41
|
-
|
42
|
-
end
|
46
|
+
install!
|
43
47
|
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require_relative "project"
|
2
|
+
|
3
|
+
module Foobara
|
4
|
+
class << self
|
5
|
+
def require_project_file(project, path)
|
6
|
+
require_relative("../../#{project}/src/#{path}")
|
7
|
+
end
|
8
|
+
|
9
|
+
attr_accessor :is_installed
|
10
|
+
|
11
|
+
def all_projects
|
12
|
+
@all_projects ||= {}
|
13
|
+
end
|
14
|
+
|
15
|
+
def projects(*symbols)
|
16
|
+
symbols.each do |symbol|
|
17
|
+
project(symbol)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def project(symbol, project_path: nil)
|
22
|
+
if all_projects.key?(symbol)
|
23
|
+
# :nocov:
|
24
|
+
raise ArgumentError, "Project #{symbol} already loaded"
|
25
|
+
# :nocov:
|
26
|
+
end
|
27
|
+
|
28
|
+
project = Project.new(symbol, project_path:)
|
29
|
+
project.load
|
30
|
+
|
31
|
+
all_projects[symbol] = project
|
32
|
+
|
33
|
+
if is_installed
|
34
|
+
project.install!
|
35
|
+
|
36
|
+
all_projects.each_pair do |key, existing_project|
|
37
|
+
next if key == symbol
|
38
|
+
|
39
|
+
existing_project.new_project_added(project)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def install!
|
45
|
+
self.is_installed = true
|
46
|
+
all_projects.each_value(&:install!)
|
47
|
+
end
|
48
|
+
|
49
|
+
def reset_alls
|
50
|
+
all_projects.each_value(&:reset_all)
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
module Foobara
|
2
|
+
class Project
|
3
|
+
attr_accessor :symbol, :project_path
|
4
|
+
|
5
|
+
def initialize(symbol, project_path: nil)
|
6
|
+
self.symbol = symbol
|
7
|
+
self.project_path = project_path || "#{__dir__}/../../#{symbol}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def require_path
|
11
|
+
"foobara/#{symbol}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def module_name
|
15
|
+
Util.classify(symbol)
|
16
|
+
end
|
17
|
+
|
18
|
+
def module
|
19
|
+
Foobara.const_get(module_name)
|
20
|
+
end
|
21
|
+
|
22
|
+
def load
|
23
|
+
require require_path
|
24
|
+
src_dir = "#{project_path}/src"
|
25
|
+
if Dir.exist?(src_dir)
|
26
|
+
Util.require_directory(src_dir)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def install!
|
31
|
+
if self.module.respond_to?(:install!)
|
32
|
+
self.module.install!
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def reset_all
|
37
|
+
if self.module.respond_to?(:reset_all)
|
38
|
+
self.module.reset_all
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def new_project_added(project)
|
43
|
+
if self.module.respond_to?(:new_project_added)
|
44
|
+
self.module.new_project_added(project)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foobara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.135
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
@@ -320,6 +320,8 @@ files:
|
|
320
320
|
- projects/enumerated/src/values.rb
|
321
321
|
- projects/foobara/lib/foobara.rb
|
322
322
|
- projects/foobara/lib/foobara/all.rb
|
323
|
+
- projects/foobara/src/foobara.rb
|
324
|
+
- projects/foobara/src/project.rb
|
323
325
|
- projects/in_memory_crud_driver/lib/foobara/in_memory_crud_driver.rb
|
324
326
|
- projects/in_memory_crud_driver/src/in_memory.rb
|
325
327
|
- projects/in_memory_crud_driver_minimal/lib/foobara/in_memory_crud_driver_minimal.rb
|
@@ -374,8 +376,6 @@ files:
|
|
374
376
|
- projects/model_attribute_helpers/lib/foobara/model_attribute_helpers.rb
|
375
377
|
- projects/model_attribute_helpers/src/attribute_helper_aliases.rb
|
376
378
|
- projects/model_attribute_helpers/src/attribute_helpers.rb
|
377
|
-
- projects/monorepo/lib/foobara/monorepo.rb
|
378
|
-
- projects/monorepo/lib/foobara/monorepo/project.rb
|
379
379
|
- projects/namespace/lib/foobara/namespace.rb
|
380
380
|
- projects/namespace/src/ambiguous_registry.rb
|
381
381
|
- projects/namespace/src/base_registry.rb
|
@@ -512,7 +512,6 @@ require_paths:
|
|
512
512
|
- "./projects/manifest/lib"
|
513
513
|
- "./projects/model/lib"
|
514
514
|
- "./projects/model_attribute_helpers/lib"
|
515
|
-
- "./projects/monorepo/lib"
|
516
515
|
- "./projects/namespace/lib"
|
517
516
|
- "./projects/nested_transactionable/lib"
|
518
517
|
- "./projects/persistence/lib"
|
@@ -1,54 +0,0 @@
|
|
1
|
-
module Foobara
|
2
|
-
module Monorepo
|
3
|
-
# TODO: make this MonorepoProject and have a more generic Project so that other projects outside of the
|
4
|
-
# repo can have things like reset_all called on th.
|
5
|
-
class Project
|
6
|
-
attr_accessor :symbol, :project_path
|
7
|
-
|
8
|
-
# TODO: we should move these concepts out of "Monorepo" and maybe into Foobara because we sometimes need to
|
9
|
-
# be able to install!/reset foobara code that's been extracted into a gem
|
10
|
-
def initialize(symbol, project_path: nil)
|
11
|
-
self.symbol = symbol
|
12
|
-
self.project_path = project_path || "#{__dir__}/../../../../../projects/#{symbol}"
|
13
|
-
end
|
14
|
-
|
15
|
-
def require_path
|
16
|
-
"foobara/#{symbol}"
|
17
|
-
end
|
18
|
-
|
19
|
-
def module_name
|
20
|
-
Util.classify(symbol)
|
21
|
-
end
|
22
|
-
|
23
|
-
def module
|
24
|
-
Foobara.const_get(module_name)
|
25
|
-
end
|
26
|
-
|
27
|
-
def load
|
28
|
-
require require_path
|
29
|
-
src_dir = "#{project_path}/src"
|
30
|
-
if Dir.exist?(src_dir)
|
31
|
-
Util.require_directory(src_dir)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def install!
|
36
|
-
if self.module.respond_to?(:install!)
|
37
|
-
self.module.install!
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def reset_all
|
42
|
-
if self.module.respond_to?(:reset_all)
|
43
|
-
self.module.reset_all
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
def new_project_added(project)
|
48
|
-
if self.module.respond_to?(:new_project_added)
|
49
|
-
self.module.new_project_added(project)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,63 +0,0 @@
|
|
1
|
-
require_relative "monorepo/project"
|
2
|
-
|
3
|
-
module Foobara
|
4
|
-
class << self
|
5
|
-
def require_project_file(project, path)
|
6
|
-
require_relative("../../../#{project}/src/#{path}")
|
7
|
-
end
|
8
|
-
|
9
|
-
def reset_alls
|
10
|
-
Monorepo.reset_alls
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
# TODO: We should rename this to Projects or something else because we need to manage this stuff for projects
|
15
|
-
# inside and outside of the monorepo.
|
16
|
-
module Monorepo
|
17
|
-
class << self
|
18
|
-
attr_accessor :is_installed
|
19
|
-
|
20
|
-
def all_projects
|
21
|
-
@all_projects ||= {}
|
22
|
-
end
|
23
|
-
|
24
|
-
def projects(*symbols)
|
25
|
-
symbols.each do |symbol|
|
26
|
-
project(symbol)
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def project(symbol, project_path: nil)
|
31
|
-
if all_projects.key?(symbol)
|
32
|
-
# :nocov:
|
33
|
-
raise ArgumentError, "Project #{symbol} already loaded"
|
34
|
-
# :nocov:
|
35
|
-
end
|
36
|
-
|
37
|
-
project = Project.new(symbol, project_path:)
|
38
|
-
project.load
|
39
|
-
|
40
|
-
all_projects[symbol] = project
|
41
|
-
|
42
|
-
if is_installed
|
43
|
-
project.install!
|
44
|
-
|
45
|
-
all_projects.each_pair do |key, existing_project|
|
46
|
-
next if key == symbol
|
47
|
-
|
48
|
-
existing_project.new_project_added(project)
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
def install!
|
54
|
-
self.is_installed = true
|
55
|
-
all_projects.each_value(&:install!)
|
56
|
-
end
|
57
|
-
|
58
|
-
def reset_alls
|
59
|
-
all_projects.each_value(&:reset_all)
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|