foobara 0.0.12 → 0.0.14

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: ba10d37c4533cfc81d05e0964f0ba945b3567d09342429d7d6b72d354fff06f3
4
- data.tar.gz: '09e88cc0896ddf2ff3e659b99a6e61e613b125f1f6fc01c5777419964313843b'
3
+ metadata.gz: 38b777d54529187c23d8a7f67337c5cb6f841d06ca01efe3635c003359f38b47
4
+ data.tar.gz: 91bbdf579b22f6c2978180142846d8d5f14a7751840cc89b6b06d70248247f33
5
5
  SHA512:
6
- metadata.gz: 151823bcc3863a93813f36c91fce73309435541117585f0cffb4ce31ac8b523e95b50669446f096d41bca64b8c4a9c6c6c37a1a3e71cc532d379c9e8a117a886
7
- data.tar.gz: 8e03ed19e103f183a82df3c55692a523187fab9630db6692d2904dbd73da647589e6c522b493ecc52ebae9d93fd122b002225ef79f7932664caedbdcbbd1afb1
6
+ metadata.gz: f06ee9edaf6d45318abe7ad05b1a9932895443eb72a42d8fe25baa0ad5c2b666f1bacc38a14ea1d390bb75f5283ec64ccf77e2f0a3be1cc05b67e95422220371
7
+ data.tar.gz: 1facc5ea85dfab04ec0f97d96090c512c75cb676cdebde0ebbed0c981d01d4cc8780d1c2533fb2f74b8322e0c62db0caa81a838ab8d09619458d943985dee065
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [0.0.14] - 2024-11-15
2
+
3
+ - Provide a default execute because why not...
4
+ - Allow require "foobara" instead of require "foobara/all"
5
+
6
+ ## [0.0.13] - 2024-11-13
7
+
8
+ - Do not fail :one_of if it is nil and :allows_nil
9
+
1
10
  ## [0.0.12] - 2024-10-30
2
11
 
3
12
  - 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
@@ -71,6 +71,9 @@ module Foobara
71
71
  @outcome = Outcome.success(result)
72
72
  end
73
73
 
74
+ def execute
75
+ end
76
+
74
77
  def succeed
75
78
  # noop but for now helpful for carrying out state transition
76
79
  end
@@ -0,0 +1,4 @@
1
+ require "foobara/all"
2
+
3
+ module Foobara
4
+ end
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.14
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-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: foobara-util
@@ -214,6 +214,7 @@ files:
214
214
  - projects/enumerated/lib/foobara/enumerated.rb
215
215
  - projects/enumerated/src/accessors.rb
216
216
  - projects/enumerated/src/values.rb
217
+ - projects/foobara/lib/foobara.rb
217
218
  - projects/foobara/lib/foobara/all.rb
218
219
  - projects/in_memory_crud_driver/lib/foobara/in_memory_crud_driver.rb
219
220
  - projects/in_memory_crud_driver/src/in_memory.rb
@@ -399,7 +400,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
399
400
  - !ruby/object:Gem::Version
400
401
  version: '0'
401
402
  requirements: []
402
- rubygems_version: 3.5.22
403
+ rubygems_version: 3.5.23
403
404
  signing_key:
404
405
  specification_version: 4
405
406
  summary: Implements command pattern for encapsulating and managing domain complexity