foobara 0.0.47 → 0.0.48
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c661c32185af433ba2355ce71bf37524893d00901a6e885ab5bd874339e48b6
|
4
|
+
data.tar.gz: 8ab10b8b9191bc81548d07269ca8c4906515164aa87a702ac7b944170e2420a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3aaff8aa022ea5cf95ab300430576fbf08d813ccd2344630b035bf54372826fda4de76e5b7d9937e70278fcc7b0c23973d4499be25ad1531401b8b82004c153a
|
7
|
+
data.tar.gz: ffbc1887647b08588f218798cb99ab27af30ece05d4540926cb521a429c3dc9a4d992163802528f9f3a8022a52558e5158ee4b5b13dbe297a2e6036393ec49dd
|
data/CHANGELOG.md
CHANGED
@@ -91,7 +91,7 @@ module Foobara
|
|
91
91
|
|
92
92
|
error_class = self.class.lookup_input_error_class(symbol, path)
|
93
93
|
error_class.new(**error_args, path:)
|
94
|
-
elsif
|
94
|
+
elsif [2, 3].include?(args.size)
|
95
95
|
input, symbol, message = args
|
96
96
|
context = opts
|
97
97
|
|
@@ -143,7 +143,7 @@ module Foobara
|
|
143
143
|
|
144
144
|
error_class = self.class.lookup_runtime_error_class(symbol)
|
145
145
|
error_class.new(**error_args)
|
146
|
-
elsif args.is_a?(::Array) &&
|
146
|
+
elsif args.is_a?(::Array) && [1, 2].include?(args.size)
|
147
147
|
symbol, message = args
|
148
148
|
context = opts
|
149
149
|
|
@@ -2,6 +2,8 @@ module Foobara
|
|
2
2
|
class Command
|
3
3
|
module Concerns
|
4
4
|
module Inputs
|
5
|
+
class UnexpectedInputValidationError < StandardError; end
|
6
|
+
|
5
7
|
include Concern
|
6
8
|
|
7
9
|
attr_reader :inputs
|
@@ -41,9 +43,8 @@ module Foobara
|
|
41
43
|
if error.is_a?(Value::DataError)
|
42
44
|
add_input_error(error)
|
43
45
|
else
|
44
|
-
# TODO: raise a real error
|
45
46
|
# :nocov:
|
46
|
-
raise "
|
47
|
+
raise UnexpectedInputValidationError, "Unexpected input validation error: #{error}"
|
47
48
|
# :nocov:
|
48
49
|
end
|
49
50
|
end
|
@@ -109,6 +109,8 @@ module Foobara
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
+
# TODO: this big switch is a problem. Hard to create new types in other projects without being able
|
113
|
+
# to modify this switch. Figure out what to do.
|
112
114
|
def construct_associations(
|
113
115
|
type = attributes_type,
|
114
116
|
path = DataPath.new,
|
@@ -135,7 +137,12 @@ module Foobara
|
|
135
137
|
construct_associations(element_type, path.append(attribute_name), result)
|
136
138
|
end
|
137
139
|
elsif type.extends?(BuiltinTypes[:model])
|
138
|
-
|
140
|
+
target_class = type.target_class
|
141
|
+
|
142
|
+
method = target_class.respond_to?(:foobara_attributes_type) ? :foobara_attributes_type : :attributes_type
|
143
|
+
attributes_type = target_class.send(method)
|
144
|
+
|
145
|
+
construct_associations(attributes_type, path, result)
|
139
146
|
elsif type.extends?(BuiltinTypes[:associative_array])
|
140
147
|
# not going to bother testing this for now
|
141
148
|
# :nocov:
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
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.48
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-01-
|
10
|
+
date: 2025-01-18 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bigdecimal
|