foobara 0.6.3 → 0.6.4
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/.ruby-version +1 -1
- data/CHANGELOG.md +4 -0
- data/projects/big_decimal/lib/foobara/big_decimal.rb +16 -0
- data/projects/typesystem/projects/builtin_types/lib/foobara/builtin_types.rb +0 -3
- data/projects/typesystem/projects/model/lib/foobara/model.rb +0 -1
- data/projects/typesystem/projects/model/src/model.rb +16 -1
- data/projects/typesystem/projects/project/src/foobara.rb +7 -1
- data/projects/typesystem/projects/types/lib/foobara/types.rb +2 -0
- data/version.rb +1 -1
- metadata +6 -4
- /data/projects/{typesystem/projects/builtin_types/src/big_decimal → big_decimal/src}/casters/integer.rb +0 -0
- /data/projects/{typesystem/projects/builtin_types/src/big_decimal → big_decimal/src}/casters/string.rb +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3417123e9edcf11d20e2d6355e1b63d7d25b33e957b42d32c64b4452d93f4463
|
|
4
|
+
data.tar.gz: 8b94bd6c61857d89eda1bcf667a408536cad9f2a5845f9a51a57e931a64ae28c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b57004203dabc6e0d305f17dfd470e7fe47878b0c1be28fb6ebd89b5c0cbf943e96b5efa8404ce929e7a59744e0a36385649448391830886a5042ec3d48ce822
|
|
7
|
+
data.tar.gz: 77d265ecf8b8c9f2fa8dcc30f996df4f237fda07eee821f7d85c67963ab42732a5dec786e2f0a2c6e273d1077215dac22ef4ad44c2ca8dc410e56658417ec599
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
4.0.
|
|
1
|
+
4.0.7
|
data/CHANGELOG.md
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
require "foobara/builtin_types"
|
|
2
|
+
require "bigdecimal"
|
|
3
|
+
|
|
4
|
+
module Foobara
|
|
5
|
+
module BigDecimal
|
|
6
|
+
class << self
|
|
7
|
+
def install!
|
|
8
|
+
BuiltinTypes.build_and_register!(:big_decimal, BuiltinTypes[:number])
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def reset_all = install!
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
Foobara.project("big_decimal", project_path: "#{__dir__}/../..")
|
|
@@ -2,8 +2,6 @@ require "foobara/type_declarations"
|
|
|
2
2
|
|
|
3
3
|
require "date"
|
|
4
4
|
require "time"
|
|
5
|
-
# TODO: get this out of here
|
|
6
|
-
require "bigdecimal"
|
|
7
5
|
|
|
8
6
|
module Foobara
|
|
9
7
|
# TODO: rename this to PrimitiveTypes and deprecate the name BuiltinTypes
|
|
@@ -46,7 +44,6 @@ module Foobara
|
|
|
46
44
|
number = build_and_register!(:number, atomic_duck, ::Object)
|
|
47
45
|
build_and_register!(:integer, number)
|
|
48
46
|
build_and_register!(:float, number)
|
|
49
|
-
build_and_register!(:big_decimal, number)
|
|
50
47
|
# Let's skip these for now since they rarely come up in business contexts and both could be
|
|
51
48
|
# represented by a tuple of numbers.
|
|
52
49
|
# build_and_register!(:rational, number)
|
|
@@ -200,6 +200,10 @@ module Foobara
|
|
|
200
200
|
end
|
|
201
201
|
end
|
|
202
202
|
|
|
203
|
+
if Thread.inheritable_thread_local_var_get(:foobara_ignore_unexpected_attributes)
|
|
204
|
+
@ignore_unexpected_attributes = true
|
|
205
|
+
end
|
|
206
|
+
|
|
203
207
|
validate = options[:validate]
|
|
204
208
|
|
|
205
209
|
if attributes.nil?
|
|
@@ -241,6 +245,8 @@ module Foobara
|
|
|
241
245
|
validate! if validate # TODO: test this code path
|
|
242
246
|
end
|
|
243
247
|
|
|
248
|
+
def ignore_unexpected_attributes? = @ignore_unexpected_attributes
|
|
249
|
+
|
|
244
250
|
def model_name
|
|
245
251
|
self.class.model_name
|
|
246
252
|
end
|
|
@@ -333,7 +339,16 @@ module Foobara
|
|
|
333
339
|
end
|
|
334
340
|
|
|
335
341
|
def validation_errors
|
|
336
|
-
attributes_type.process_value(attributes).error_collection
|
|
342
|
+
errors = attributes_type.process_value(attributes).error_collection
|
|
343
|
+
|
|
344
|
+
unexpected_attributes_class =
|
|
345
|
+
BuiltinTypes::Attributes::SupportedProcessors::ElementTypeDeclarations::UnexpectedAttributesError
|
|
346
|
+
|
|
347
|
+
if ignore_unexpected_attributes?
|
|
348
|
+
errors.reject { unexpected_attributes_class === it }
|
|
349
|
+
else
|
|
350
|
+
errors
|
|
351
|
+
end
|
|
337
352
|
end
|
|
338
353
|
|
|
339
354
|
def validate!
|
|
@@ -46,6 +46,12 @@ module Foobara
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
def install!
|
|
49
|
+
# simplecov:disable
|
|
50
|
+
if is_installed
|
|
51
|
+
raise "Foobara.install! was already invoked"
|
|
52
|
+
end
|
|
53
|
+
# simplecov:enable
|
|
54
|
+
|
|
49
55
|
self.is_installed = true
|
|
50
56
|
all_projects.each_value(&:install!)
|
|
51
57
|
end
|
|
@@ -57,7 +63,7 @@ module Foobara
|
|
|
57
63
|
|
|
58
64
|
def raise_if_production!(method_name = nil)
|
|
59
65
|
if method_name
|
|
60
|
-
warn "DEPRECATION WARNING: Passing method_name is deprecated."
|
|
66
|
+
warn "DEPRECATION WARNING: Passing a method_name to Foobara.raise_if_production is deprecated."
|
|
61
67
|
else
|
|
62
68
|
method_name = caller_locations.map(&:label).find { |label| !label.start_with?("block in") }
|
|
63
69
|
end
|
data/version.rb
CHANGED
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.6.
|
|
4
|
+
version: 0.6.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Miles Georgi
|
|
@@ -80,6 +80,9 @@ files:
|
|
|
80
80
|
- README.md
|
|
81
81
|
- lib/foobara.rb
|
|
82
82
|
- lib/foobara/all.rb
|
|
83
|
+
- projects/big_decimal/lib/foobara/big_decimal.rb
|
|
84
|
+
- projects/big_decimal/src/casters/integer.rb
|
|
85
|
+
- projects/big_decimal/src/casters/string.rb
|
|
83
86
|
- projects/command/lib/foobara/command.rb
|
|
84
87
|
- projects/command/src/command.rb
|
|
85
88
|
- projects/command/src/command_pattern_implementation.rb
|
|
@@ -306,8 +309,6 @@ files:
|
|
|
306
309
|
- projects/typesystem/projects/builtin_types/src/attributes/supported_validators/required/type_declaration_extension/extend_attributes_type_declaration/type_declaration_validators/array_of_symbols.rb
|
|
307
310
|
- projects/typesystem/projects/builtin_types/src/attributes/supported_validators/required/type_declaration_extension/extend_attributes_type_declaration/type_declaration_validators/array_with_valid_attribute_names.rb
|
|
308
311
|
- projects/typesystem/projects/builtin_types/src/attributes/transformers/remove_unexpected_attributes.rb
|
|
309
|
-
- projects/typesystem/projects/builtin_types/src/big_decimal/casters/integer.rb
|
|
310
|
-
- projects/typesystem/projects/builtin_types/src/big_decimal/casters/string.rb
|
|
311
312
|
- projects/typesystem/projects/builtin_types/src/boolean/casters/numeric.rb
|
|
312
313
|
- projects/typesystem/projects/builtin_types/src/boolean/casters/string_or_symbol.rb
|
|
313
314
|
- projects/typesystem/projects/builtin_types/src/builtin_types.rb
|
|
@@ -555,6 +556,7 @@ require_paths:
|
|
|
555
556
|
- projects/entities/projects/nested_transactionable/lib
|
|
556
557
|
- projects/entities/projects/persistence/lib
|
|
557
558
|
- projects/entities/projects/weak_object_set/lib
|
|
559
|
+
- projects/big_decimal/lib
|
|
558
560
|
- projects/command/lib
|
|
559
561
|
- projects/command_connectors/lib
|
|
560
562
|
- projects/domain_mapper/lib
|
|
@@ -575,7 +577,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
575
577
|
- !ruby/object:Gem::Version
|
|
576
578
|
version: '0'
|
|
577
579
|
requirements: []
|
|
578
|
-
rubygems_version: 4.0.
|
|
580
|
+
rubygems_version: 4.0.20
|
|
579
581
|
specification_version: 4
|
|
580
582
|
summary: A command-centric and discoverable software framework with a focus on domain
|
|
581
583
|
concepts and abstracting away integration code
|
|
File without changes
|
|
File without changes
|