foobara 0.0.12 → 0.0.13
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/README.md +1 -1
- data/projects/builtin_types/src/duck/supported_validators/one_of.rb +12 -0
- data/projects/command/src/concerns/errors.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0fe6b2415dddaf6742ae9bd3809f807148d61a8595eff27c7053b7bdf2120b0
|
4
|
+
data.tar.gz: a0b48950e37a936d2b4aae09ab9fe5bceaed5ae46da724a7f0d64bfe4177e549
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67a4249c5ca81daad7c7476eac81dafdea51224135e3e224ca31a4def8a0dc9906a79f4f4500f95a75446073ceccbab6d4ada74fca656bec305aebe7b2b546f7
|
7
|
+
data.tar.gz: da74f67ea8f39814874c2393c45ff514fd669dbd9865acbf7da4414e2ed702d9a9522d4381343f2201d6804f1b3d31565fa48926e5cf751f3376e8d7bd7069d4
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -14,7 +14,7 @@ run `foob generate ruby-project --name your-org/your-new-project-name`
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
|
-
|
17
|
+
You can find a code demo video and an overview video of what Foobara is at https://foobara.com
|
18
18
|
|
19
19
|
## Contributing
|
20
20
|
|
@@ -3,6 +3,12 @@ module Foobara
|
|
3
3
|
module Duck
|
4
4
|
module SupportedValidators
|
5
5
|
class OneOf < TypeDeclarations::Validator
|
6
|
+
class << self
|
7
|
+
def requires_parent_declaration_data?
|
8
|
+
true
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
6
12
|
class ValueNotValidError < Foobara::Value::DataError
|
7
13
|
class << self
|
8
14
|
def context_type_declaration
|
@@ -18,6 +24,12 @@ module Foobara
|
|
18
24
|
declaration_data
|
19
25
|
end
|
20
26
|
|
27
|
+
def applicable?(value)
|
28
|
+
# Might there be some way this validator could be marked not-applicable that doesn't require coupling
|
29
|
+
# this processor to allow_nil? (or vice-versa)
|
30
|
+
!value.nil? || !parent_declaration_data[:allow_nil]
|
31
|
+
end
|
32
|
+
|
21
33
|
def validation_errors(value)
|
22
34
|
unless valid_values.include?(value)
|
23
35
|
build_error(value)
|
@@ -90,7 +90,7 @@ module Foobara
|
|
90
90
|
end
|
91
91
|
|
92
92
|
error_class = self.class.lookup_input_error_class(symbol, path)
|
93
|
-
error_class.new(**error_args
|
93
|
+
error_class.new(**error_args, path:)
|
94
94
|
elsif args.size == 2 || args.size == 3
|
95
95
|
input, symbol, message = args
|
96
96
|
context = opts
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miles Georgi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: foobara-util
|
@@ -399,7 +399,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
399
399
|
- !ruby/object:Gem::Version
|
400
400
|
version: '0'
|
401
401
|
requirements: []
|
402
|
-
rubygems_version: 3.5.
|
402
|
+
rubygems_version: 3.5.23
|
403
403
|
signing_key:
|
404
404
|
specification_version: 4
|
405
405
|
summary: Implements command pattern for encapsulating and managing domain complexity
|