foobara-remote-imports 0.0.9 → 0.0.11

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: d7717fdab6149b75d7ad8264a2eca16c6eda0a5511701dd14b82495ea911405d
4
- data.tar.gz: 1f465d2a7ccd458b665f0b95f08bdcdc71e1d2b808feba8309921963a02756ec
3
+ metadata.gz: 6618b6975d35dbe7af376615f41d0d751643beaa41affc79233790a312f5ec96
4
+ data.tar.gz: 6591a7dc132e364238b76757236e95fc57cee6b8014653ed023df3f012e69303
5
5
  SHA512:
6
- metadata.gz: b94e278e3b03297163c37f780b3bd393aa909cac377e4efb1d1314d82d4be8e5ba4a7201f8c243b782267ac99bf5d281f304703ce56d8e69440a83594fe480fa
7
- data.tar.gz: 2c244f74a798926288b72816a62a46010e1508198ecacd487ef39cda77b52e9375044c9b7fdaef31c947ab9404f9787958717d97febaec6aff6343355117d1ef
6
+ metadata.gz: df41f1c9e935122256b3da5411705de12a1e63e881959047534e2ec9a385256e365e01be11a1fe137b5cab1385eb2abdc9bf12bf7ba2d94641a390ef99d1e177
7
+ data.tar.gz: 31d8ea034d85432104cbafd7f04f9ac8e94f12854dd157864d8142c1cc3340afadcffb8c0e5c83eef18c5d32708adbf3afcce883227160836a8730e3ba9e71f7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [0.0.11] - 2025-04-19
2
+
3
+ - Facilitate overriding methods in RemoteCommand
4
+
5
+ ## [0.0.10] - 2025-03-28
6
+
7
+ - Default to deanonymizing imported model classes by default to preserve existing behavior
8
+
1
9
  ## [0.0.9] - 2025-01-07
2
10
 
3
11
  - Bump Ruby to 3.4.1
@@ -145,6 +145,7 @@ module Foobara
145
145
  # :nocov:
146
146
  end
147
147
  end
148
+
148
149
  halt!
149
150
  else
150
151
  # :nocov:
@@ -35,7 +35,8 @@ module Foobara
35
35
  cache: { type: :boolean, default: true },
36
36
  cache_path: { type: :string, default: "tmp/cache/foobara-remote-imports" },
37
37
  to_import: :duck,
38
- already_imported: { type: :duck, allow_nil: true }
38
+ already_imported: { type: :duck, allow_nil: true },
39
+ deanonymize_models: { type: :boolean, default: true }
39
40
  )
40
41
 
41
42
  klass.result :duck
@@ -8,6 +8,10 @@ module Foobara
8
8
  class ImportCommand < Command
9
9
  include ImportBase
10
10
 
11
+ add_inputs do
12
+ base_command_class Class, default: RemoteCommand
13
+ end
14
+
11
15
  depends_on ImportDomain, ImportType, ImportError
12
16
 
13
17
  def find_manifests_to_import
@@ -31,7 +35,7 @@ module Foobara
31
35
  already_imported:
32
36
  )
33
37
 
34
- Util.make_class_p(manifest_to_import.reference, RemoteCommand)
38
+ Util.make_class_p(manifest_to_import.reference, base_command_class)
35
39
 
36
40
  manifest_to_import.types_depended_on.each do |type|
37
41
  run_subcommand!(
@@ -75,7 +79,8 @@ module Foobara
75
79
  inputs: manifest_to_import.inputs_type.relevant_manifest,
76
80
  result: manifest_to_import.result_type.relevant_manifest,
77
81
  possible_errors: manifest_to_import.possible_errors,
78
- name: manifest_to_import.reference
82
+ name: manifest_to_import.reference,
83
+ base: base_command_class
79
84
  )
80
85
  end
81
86
  end
@@ -9,6 +9,7 @@ module Foobara
9
9
  root_manifest.types
10
10
  end
11
11
 
12
+ # TODO: break this method up?
12
13
  def import_object_from_manifest
13
14
  existing_type = Foobara.foobara_root_namespace.foobara_lookup_type(
14
15
  manifest_to_import.reference,
@@ -57,6 +58,7 @@ module Foobara
57
58
  # create the entity class, which should be considered a bug.
58
59
  declaration_data = manifest_to_import.declaration_data
59
60
 
61
+ # TODO: how do we solve this for :active_record type??
60
62
  if declaration_data["type"] == "entity"
61
63
  declaration_data = Util.deep_dup(declaration_data)
62
64
 
@@ -80,12 +82,20 @@ module Foobara
80
82
 
81
83
  type = domain.foobara_type_from_strict_stringified_declaration(declaration_data)
82
84
 
85
+ if deanonymize_models? && type.extends?(:model)
86
+ Foobara::Model.deanonymize_class(type.target_class)
87
+ end
88
+
83
89
  unless domain.foobara_registered?(type)
84
90
  domain.foobara_register_type(manifest_to_import.scoped_path, type)
85
91
  end
86
92
 
87
93
  type
88
94
  end
95
+
96
+ def deanonymize_models?
97
+ deanonymize_models
98
+ end
89
99
  end
90
100
  end
91
101
  end
metadata CHANGED
@@ -1,28 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foobara-remote-imports
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-07 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: foobara
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - ">="
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: '0'
18
+ version: 0.0.88
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
- - - ">="
23
+ - - "~>"
24
24
  - !ruby/object:Gem::Version
25
- version: '0'
25
+ version: 0.0.88
26
26
  email:
27
27
  - azimux@gmail.com
28
28
  executables: []
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  - !ruby/object:Gem::Version
65
65
  version: '0'
66
66
  requirements: []
67
- rubygems_version: 3.6.2
67
+ rubygems_version: 3.6.7
68
68
  specification_version: 4
69
69
  summary: Used to import commands/entities/whatever from another system into this one.
70
70
  test_files: []