foobara-remote-imports 1.2.0 → 1.2.1
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/src/foobara/authenticated_remote_command.rb +2 -2
- data/src/foobara/remote_command.rb +6 -6
- data/src/foobara/remote_imports/already_imported.rb +1 -1
- data/src/foobara/remote_imports/import_base.rb +6 -6
- data/src/foobara/remote_imports/import_error.rb +2 -2
- data/src/foobara/remote_imports/import_type.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f1748c91e76bfd28962f68cad11973d9e1b2a84a3f1c4910fadf43b121172db6
|
|
4
|
+
data.tar.gz: 75ae2b5d402baf94d46b51459958da14e1fd00136c4d3fd240a10ed4e9f447d0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ab8e8a5de0cf0557efabb6a1594659b35a51562db6cc51a719884c5211894833da24f2269967cc7b976aaba08b1cc9ed09c36fabd98eab8cb1a4699ce324130
|
|
7
|
+
data.tar.gz: 6e3753e48e483d6a36974275f8522de03bfb729f660f8fa17d2ecb5816efa376ed474e0d00b2bb15cdad5eed8e12bb16230092c913da5cf851398b276f3c2721
|
data/CHANGELOG.md
CHANGED
|
@@ -5,8 +5,8 @@ module Foobara
|
|
|
5
5
|
class << self
|
|
6
6
|
attr_accessor :auth_header_name, :auth_header_value
|
|
7
7
|
|
|
8
|
-
def subclass(auth_header:, **
|
|
9
|
-
super(base: AuthenticatedRemoteCommand, **
|
|
8
|
+
def subclass(auth_header:, **)
|
|
9
|
+
super(base: AuthenticatedRemoteCommand, **).tap do |klass|
|
|
10
10
|
klass.auth_header_name = auth_header[0]
|
|
11
11
|
klass.auth_header_value = auth_header[1]
|
|
12
12
|
end
|
|
@@ -58,9 +58,9 @@ module Foobara
|
|
|
58
58
|
def cast_and_validate_inputs
|
|
59
59
|
@inputs = if inputs_type.nil? && (raw_inputs.nil? || raw_inputs.empty?)
|
|
60
60
|
# TODO: test this path
|
|
61
|
-
# :
|
|
61
|
+
# simplecov:disable
|
|
62
62
|
{}
|
|
63
|
-
# :
|
|
63
|
+
# simplecov:enable
|
|
64
64
|
else
|
|
65
65
|
serializer_class = CommandConnectors::Serializers::EntitiesToPrimaryKeysSerializer
|
|
66
66
|
serializer = serializer_class.new(detached_to_primary_key: true)
|
|
@@ -138,17 +138,17 @@ module Foobara
|
|
|
138
138
|
path: error["path"]
|
|
139
139
|
)
|
|
140
140
|
else
|
|
141
|
-
# :
|
|
141
|
+
# simplecov:disable
|
|
142
142
|
raise "Bad error category: #{error["category"]}"
|
|
143
|
-
# :
|
|
143
|
+
# simplecov:enable
|
|
144
144
|
end
|
|
145
145
|
end
|
|
146
146
|
|
|
147
147
|
halt!
|
|
148
148
|
else
|
|
149
|
-
# :
|
|
149
|
+
# simplecov:disable
|
|
150
150
|
raise UnexpectedError, "#{response.code} from #{url}: #{response.body}"
|
|
151
|
-
# :
|
|
151
|
+
# simplecov:enable
|
|
152
152
|
end
|
|
153
153
|
end
|
|
154
154
|
end
|
|
@@ -107,10 +107,10 @@ module Foobara
|
|
|
107
107
|
response = net_http.request(request)
|
|
108
108
|
|
|
109
109
|
unless response.is_a?(Net::HTTPSuccess)
|
|
110
|
-
# :
|
|
110
|
+
# simplecov:disable
|
|
111
111
|
raise "Could not get manifest from #{manifest_url}: " \
|
|
112
112
|
"#{response.code} #{response.message}"
|
|
113
|
-
# :
|
|
113
|
+
# simplecov:enable
|
|
114
114
|
end
|
|
115
115
|
manifest_json = response.body
|
|
116
116
|
|
|
@@ -195,9 +195,9 @@ module Foobara
|
|
|
195
195
|
end
|
|
196
196
|
|
|
197
197
|
def find_manifests_to_import
|
|
198
|
-
# :
|
|
198
|
+
# simplecov:disable
|
|
199
199
|
raise "subclass responsibility"
|
|
200
|
-
# :
|
|
200
|
+
# simplecov:enable
|
|
201
201
|
end
|
|
202
202
|
|
|
203
203
|
def import_objects_from_manifests
|
|
@@ -214,9 +214,9 @@ module Foobara
|
|
|
214
214
|
end
|
|
215
215
|
|
|
216
216
|
def import_object_from_manifest
|
|
217
|
-
# :
|
|
217
|
+
# simplecov:disable
|
|
218
218
|
raise "subclass responsibility"
|
|
219
|
-
# :
|
|
219
|
+
# simplecov:enable
|
|
220
220
|
end
|
|
221
221
|
|
|
222
222
|
def imported_objects
|
|
@@ -44,9 +44,9 @@ module Foobara
|
|
|
44
44
|
base_error = if base_error_name
|
|
45
45
|
Foobara.foobara_root_namespace.foobara_lookup_error!(base_error_name)
|
|
46
46
|
else
|
|
47
|
-
# :
|
|
47
|
+
# simplecov:disable
|
|
48
48
|
Foobara::Error
|
|
49
|
-
# :
|
|
49
|
+
# simplecov:enable
|
|
50
50
|
end
|
|
51
51
|
|
|
52
52
|
Foobara::Error.subclass(
|
|
@@ -72,9 +72,9 @@ module Foobara
|
|
|
72
72
|
|
|
73
73
|
model_base_class = declaration_data["model_base_class"]
|
|
74
74
|
unless model_base_class == "Foobara::Entity"
|
|
75
|
-
# :
|
|
75
|
+
# simplecov:disable
|
|
76
76
|
raise "Expected model base class to be Foobara::Entity, but was #{model_base_class}"
|
|
77
|
-
# :
|
|
77
|
+
# simplecov:enable
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
declaration_data["model_base_class"] = "Foobara::DetachedEntity"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: foobara-remote-imports
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -15,7 +15,7 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 0.2
|
|
18
|
+
version: 0.7.2
|
|
19
19
|
- - "<"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
21
|
version: 2.0.0
|
|
@@ -25,7 +25,7 @@ dependencies:
|
|
|
25
25
|
requirements:
|
|
26
26
|
- - ">="
|
|
27
27
|
- !ruby/object:Gem::Version
|
|
28
|
-
version: 0.2
|
|
28
|
+
version: 0.7.2
|
|
29
29
|
- - "<"
|
|
30
30
|
- !ruby/object:Gem::Version
|
|
31
31
|
version: 2.0.0
|
|
@@ -71,7 +71,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
71
71
|
- !ruby/object:Gem::Version
|
|
72
72
|
version: '0'
|
|
73
73
|
requirements: []
|
|
74
|
-
rubygems_version:
|
|
74
|
+
rubygems_version: 4.0.20
|
|
75
75
|
specification_version: 4
|
|
76
76
|
summary: Used to import commands/entities/whatever from another system into this one.
|
|
77
77
|
test_files: []
|