brute 2.0.5 → 2.0.6

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: f1feb1c397c976722644f4f8dd5d90e8ddc3ab372d7aea7085a08baa122b65e7
4
- data.tar.gz: eeaadf2902925f6538b31affacbf997b0c26da5a331c1576b4b393935a4f3444
3
+ metadata.gz: 0ca9915157a21335990328dcbf4b6104cffa72bd0835e93055ec46e8be05aee7
4
+ data.tar.gz: 6e7ef36a7fd32e0351563856d888f832fb4d48fad32444f937fb58c2d45baa4d
5
5
  SHA512:
6
- metadata.gz: 7896dfb66cb867dfc7492933fc65306eedad2d4db367d844233a8dca9e7e5a0419e950547c090f42f670b38eac8cd8d343439743b31354d14911574fe49702b5
7
- data.tar.gz: 4c0f483938302514b0ec111a1b531c1babd3c84d45932069178163d43b9398804a41a6f480588342de3e203bf5abcb29092b28da9793e1f8aee2e246b0a968b0
6
+ metadata.gz: ff22892e28c30deb694b7bbea899e8b14ceb31e068fa74b27b9b462d7778ab52da06f332f743ac6c19324bf962d7ee1401e8146f1714496fc1dcba5179f6e551
7
+ data.tar.gz: 457fbacd0115628b002c6b274ef7c07d47a267c4841107c52c4d983d23a0967012ca68a084b50f833d5421ff013766c2aef07be5e465d8630ca61cc9c06326f5
data/lib/brute/session.rb CHANGED
@@ -10,24 +10,23 @@ module Brute
10
10
  def initialize(path: nil)
11
11
  super()
12
12
  @path = path
13
- FileUtils.mkdir_p(File.dirname(@path)) if @path
14
- end
15
-
16
- # Load a session from a JSONL file. Subsequent appends will persist
17
- # back to the same file automatically.
18
- def self.from_jsonl(path)
19
- new(path: path).tap do |session|
20
- if File.exist?(path)
21
- File.foreach(path).map(&:strip).each do |line|
22
- if line.present?
23
- # Use push to bypass append persistence (avoids re-writing existing lines)
24
- session.push(RubyLLM::Message.new(**JSON.parse(line, symbolize_names: true)))
25
- end
13
+ if @path
14
+ FileUtils.mkdir_p(File.dirname(@path))
15
+ if File.exist?(@path)
16
+ File.foreach(@path) do |line|
17
+ line.strip!
18
+ # Use push to bypass append persistence (avoids re-writing existing lines)
19
+ push(RubyLLM::Message.new(**JSON.parse(line, symbolize_names: true))) if line.present?
26
20
  end
27
21
  end
28
22
  end
29
23
  end
30
24
 
25
+ # @deprecated Use Session.new(path:) instead.
26
+ def self.from_jsonl(path)
27
+ new(path: path)
28
+ end
29
+
31
30
  # Append a message and persist it to disk if a path is set.
32
31
  def <<(msg)
33
32
  super
data/lib/brute/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Brute
4
- VERSION = "2.0.5"
4
+ VERSION = "2.0.6"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brute
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brute Contributors
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 1980-01-01 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: async
@@ -276,7 +276,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  - !ruby/object:Gem::Version
277
277
  version: '0'
278
278
  requirements: []
279
- rubygems_version: 3.7.2
279
+ rubygems_version: 4.0.6
280
280
  specification_version: 4
281
281
  summary: A coding agent built on ruby_llm
282
282
  test_files: []