foobara 0.0.127 → 0.0.129

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: 531c75e332f6e7cc297b0b56689d91f59737040fe533814a8b780defc937b2aa
4
- data.tar.gz: 16dd8725423abe9155c1fd5b89c752271ce568ec83cca52c7654204ee114f559
3
+ metadata.gz: 15b1706d7c689286e46b908cf33a5cbb73150f3c74111b9b5b7ebb18ca44bc64
4
+ data.tar.gz: b28594fe6a5e374f3c2b857b5f90c3af65b7f5e6e2b7f2ebaef806bf2c39fa39
5
5
  SHA512:
6
- metadata.gz: 9c97ed1f00a114ea3ff8e1932cb32a13e8e538b1a0dc694f542060febafcae9e515e4888695cdbeede192e490ea280e6bddf8bf54b64e6339fe7adeaaeaa42a1
7
- data.tar.gz: 4e414afd9090bc83685ce1b2e30fb31948963f4d57cff4d77ba4aa698547e716fd5a562442845f60cd8e6affb06263797fcf0c539a7f5478fceb9dec6b1412de
6
+ metadata.gz: 7fdd98642fe183f25a31d680c0362828d7cd8d68a9f0e02d80235991a3bf67a7c4e8671fc9552da3ed50e991bca009912e8de6fa688c8039eef61a4d752b52f6
7
+ data.tar.gz: 63ad9eadd3b77791cc6a04f63831cacfd11cc06b04691d93bba68ab309a506326c44dcccd664bc14d57914e7c4bca1425c8a99ea36e93e3259f0e173f681779e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # [0.0.129] - 2025-05-30
2
+
3
+ - Store the raw, unprocessed, command result for debugging/introspection
4
+
5
+ # [0.0.128] - 2025-05-29
6
+
7
+ - Add StateMachine.for convenience method
8
+
1
9
  # [0.0.127] - 2025-05-25
2
10
 
3
11
  - Add better support for using ruby classes as types
@@ -18,6 +18,7 @@ module Foobara
18
18
  end
19
19
 
20
20
  attr_reader :outcome, :exception
21
+ attr_accessor :raw_result
21
22
 
22
23
  def run!
23
24
  run.result!
@@ -67,7 +68,7 @@ module Foobara
67
68
  end
68
69
 
69
70
  def run_execute
70
- raw_result = execute
71
+ self.raw_result = execute
71
72
  result = process_result_using_result_type(raw_result)
72
73
  @outcome = Outcome.success(result)
73
74
  end
@@ -3,6 +3,8 @@ module Foobara
3
3
  require_project_file("state_machine", "callbacks")
4
4
  require_project_file("state_machine", "validations")
5
5
 
6
+ # TODO: allow quick creation of a statemachine either through better options to #initialize or a
7
+ # .for method.
6
8
  class StateMachine
7
9
  include Sugar
8
10
  include Callbacks
@@ -32,6 +34,13 @@ module Foobara
32
34
  create_can_methods
33
35
  create_register_callback_methods
34
36
  end
37
+
38
+ def for(transition_map)
39
+ klass = Class.new(self)
40
+
41
+ klass.set_transition_map(transition_map)
42
+ klass
43
+ end
35
44
  end
36
45
 
37
46
  attr_accessor :target_attribute, :owner
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.127
4
+ version: 0.0.129
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miles Georgi
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-26 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bigdecimal
@@ -529,7 +529,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
529
529
  - !ruby/object:Gem::Version
530
530
  version: '0'
531
531
  requirements: []
532
- rubygems_version: 3.6.2
532
+ rubygems_version: 3.6.7
533
533
  specification_version: 4
534
534
  summary: A command-centric and discoverable software framework with a focus on domain
535
535
  concepts and abstracting away integration code