ask-graph 0.1.1 → 0.1.2

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: 79153d7eedc0823a4831f68994771bf5b57e7e50aa872ddafff3254670d2dc7a
4
- data.tar.gz: f5a32f4df22bfebefda9e8963684137bd620fbb47fa70cf088fed10cfb0e2d3f
3
+ metadata.gz: c00714c8b8feb0d71aa93636f39f077b14f19ef5405efdc667317f4fe99cc6a2
4
+ data.tar.gz: 29cc8acc5187762918a2084bd2f3578df5ee5e6383a3b6d1edde1e4df519604a
5
5
  SHA512:
6
- metadata.gz: 1a502848e6dec5c7fdbf47bb5cdf7d74104d8706e68d674c7b9f33da462e330aa429fb9df493aa71d8309fe57cb46352461ff54a488452e4768d5628ed7a93ae
7
- data.tar.gz: 55b42aad5f0b6f1ec4e7bb81661ed068ebd37dabd1d95fe6429ffb09cf2ad5ba91aa747f46560a26b5f2b65e6b4b377d18be8bc07e45ea191eb4b147ec0fa0d6
6
+ metadata.gz: 7291024a6f4b113e87f0cf2b6005e6dd44aa3e913dc509350e6d15fb061d64b091d05c7cd6c72dca4dae291a7a329c5d95dda94c80122b128773fda1ae510102
7
+ data.tar.gz: 1d5692fdd06f6a3a626f704f32bef5f75e70078846567650fb583325b188f16f2647ac17e87c0bc3c441f71ac6d1fd8ffce580fddf8f3fa7b999f462b2227079
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [0.1.2] — 2026-07-28
2
+
3
+ ### Changed
4
+
5
+ - **`Graph.new(input).call` API** — input is now passed to the constructor, not to `call`. This reads more naturally: create a graph with data, then execute it. `Graph.call(input, checkpoint_store:)` class method still available for convenience.
6
+
7
+ ```ruby
8
+ # Before
9
+ HandleCall.new.call(recording: "call.wav")
10
+
11
+ # After
12
+ HandleCall.new({ recording: "call.wav" }).call
13
+ ```
14
+
15
+ ### Tested
16
+
17
+ - 36 tests, 52 assertions, 0 failures
18
+
1
19
  ## [0.1.1] — 2026-07-28
2
20
 
3
21
  ### Fixed
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Ask
4
4
  class Graph
5
- VERSION = "0.1.1"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
data/lib/ask/graph.rb CHANGED
@@ -83,15 +83,16 @@ module Ask
83
83
  # @param checkpoint_store [#set, #get, #delete] optional persistent store
84
84
  # @return [Ask::Graph::Context] the completed context
85
85
  def call(input = nil, checkpoint_store: nil)
86
- new(checkpoint_store: checkpoint_store).call(input)
86
+ new(input, checkpoint_store: checkpoint_store).call
87
87
  end
88
88
  alias run call
89
89
  end
90
90
 
91
- # @param checkpoint_store [#set, #get, #delete, nil] optional persistent store
92
- # Defaults to in-memory store (no durability). Pass a persistent store
93
- # for crash recovery.
94
- def initialize(checkpoint_store: nil)
91
+ # @param input [Object, nil] initial input for the graph execution
92
+ # @param checkpoint_store [#set, #get, #delete, nil] optional persistent store.
93
+ # Defaults to in-memory store. Pass a persistent store for crash recovery.
94
+ def initialize(input = nil, checkpoint_store: nil)
95
+ @input = input
95
96
  store = checkpoint_store || Ask::State::Memory.new
96
97
  @runner = Runner.new(self.class.declarations, checkpoint_store: store)
97
98
  @context = nil
@@ -103,11 +104,10 @@ module Ask
103
104
  # @return [Ask::Graph::Context, nil] the shared context
104
105
  attr_reader :context
105
106
 
106
- # Run the graph with the given input.
107
- # @param input [Object] optional initial input
107
+ # Execute the graph.
108
108
  # @return [Ask::Graph::Context] the completed context
109
- def call(input = nil)
110
- @context = Context.new(self, input)
109
+ def call
110
+ @context = Context.new(self, @input)
111
111
  @runner.run(@context)
112
112
  @context
113
113
  rescue => e
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ask-graph
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaka Ruto