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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba10d37c4533cfc81d05e0964f0ba945b3567d09342429d7d6b72d354fff06f3
4
- data.tar.gz: '09e88cc0896ddf2ff3e659b99a6e61e613b125f1f6fc01c5777419964313843b'
3
+ metadata.gz: a0fe6b2415dddaf6742ae9bd3809f807148d61a8595eff27c7053b7bdf2120b0
4
+ data.tar.gz: a0b48950e37a936d2b4aae09ab9fe5bceaed5ae46da724a7f0d64bfe4177e549
5
5
  SHA512:
6
- metadata.gz: 151823bcc3863a93813f36c91fce73309435541117585f0cffb4ce31ac8b523e95b50669446f096d41bca64b8c4a9c6c6c37a1a3e71cc532d379c9e8a117a886
7
- data.tar.gz: 8e03ed19e103f183a82df3c55692a523187fab9630db6692d2904dbd73da647589e6c522b493ecc52ebae9d93fd122b002225ef79f7932664caedbdcbbd1afb1
6
+ metadata.gz: 67a4249c5ca81daad7c7476eac81dafdea51224135e3e224ca31a4def8a0dc9906a79f4f4500f95a75446073ceccbab6d4ada74fca656bec305aebe7b2b546f7
7
+ data.tar.gz: da74f67ea8f39814874c2393c45ff514fd669dbd9865acbf7da4414e2ed702d9a9522d4381343f2201d6804f1b3d31565fa48926e5cf751f3376e8d7bd7069d4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## [0.0.13] - 2024-11-13
2
+
3
+ - Do not fail :one_of if it is nil and :allows_nil
4
+
1
5
  ## [0.0.12] - 2024-10-30
2
6
 
3
7
  - Support delayed command connection
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
- TODO: Write usage instructions here or defer to some tutorial somewhere
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.merge(path:))
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.12
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-10-31 00:00:00.000000000 Z
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.22
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