ollama_chat 0.0.40 → 0.0.41

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: dd56f9c3db76f0f261f6e75863e8c26276d3271cffdc7f1053e6a447922459bb
4
- data.tar.gz: 3d8330fecf97e96fb63a9e6efaff6c34849c98ef0508bcf06385940701f1418d
3
+ metadata.gz: 16c8e58cb6a7d268d4473262095f974045d683d44225e39861ce363c412f224b
4
+ data.tar.gz: 8205ee4aa5b7eb1c1493d4d3990a122dfbd05c978c2b8b316d21457c92003920
5
5
  SHA512:
6
- metadata.gz: a7733d610b5962b9636a4fa2e4e38307923295dde7e11dddd7ae9063469cdbad19aefaec8b4775ab81ca4444a4c79f874c861fc16676d67b501dccff5a673736
7
- data.tar.gz: 2b668abbc41bb56afc4590fff58f54fd66aa927a8ffc2761d3e9bdaff4e3bc20bbf8ec04d9ed7fb2fa47e3e31463e77e6dc6bca69a6f8188f15f691cd76ca986
6
+ metadata.gz: f46f9beaee69da2fa7d3a2801d7f9abf51204018756503b785dcac5afcb54e8c6f5ccd36cc71e4a4aba8a4f2fd159c20c064b7cc1ad41afef685356f93646082
7
+ data.tar.gz: 36ff245dbcbaa5f58297b3db76884eb779076a641bb79eca2997dce674a91832695fdf8ffaa8891f1e20e20af6fc48d045e2c58c5cc71555421319c47ea88d80
data/CHANGES.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-11-20 v0.0.41
4
+
5
+ - Fixed message output specification and removed duplicate expectation
6
+ - Added `clientserver` configuration option to `vim` section in `default_config.yml`
7
+ - Updated `OllamaChat::Vim` to accept `clientserver:` keyword argument in `initialize`
8
+ - Modified `insert` and `col` methods in `vim.rb` to use `--clientserver` flag
9
+ - Passed `clientserver` from `chat.rb` when creating `OllamaChat::Vim` instance
10
+ - Set default `clientserver` value to **socket**
11
+
3
12
  ## 2025-11-20 v0.0.40
4
13
 
5
14
  - Improved Vim server name generation to ensure uniqueness by replacing
@@ -340,7 +340,8 @@ class OllamaChat::Chat
340
340
  :next
341
341
  when %r(^/vim(?:\s+(.+))?$)
342
342
  if message = messages.last
343
- OllamaChat::Vim.new($1).insert message.content
343
+ clientserver = config.vim?&.clientserver
344
+ OllamaChat::Vim.new($1, clientserver:).insert message.content
344
345
  else
345
346
  STDERR.puts "Warning: No message found to insert into Vim"
346
347
  end
@@ -78,3 +78,5 @@ web_search:
78
78
  url: 'https://www.duckduckgo.com/html/?q=%{query}'
79
79
  searxng:
80
80
  url: <%= OllamaChat::EnvConfig::OLLAMA::SEARXNG_URL %>
81
+ vim:
82
+ clientserver: socket
@@ -1,6 +1,6 @@
1
1
  module OllamaChat
2
2
  # OllamaChat version
3
- VERSION = '0.0.40'
3
+ VERSION = '0.0.41'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -17,11 +17,14 @@ class OllamaChat::Vim
17
17
  # @param server_name [String, nil] The name of the Vim server to connect to.
18
18
  # If nil or empty, defaults to a server name derived from the current working
19
19
  # directory using {default_server_name}
20
+ # @param clientserver [String] The clientserver protocol to use, defaults to 'socket'
21
+ #
20
22
  # @return [OllamaChat::Vim] A new Vim instance configured with the specified
21
23
  # server name
22
- def initialize(server_name)
24
+ def initialize(server_name, clientserver: nil)
23
25
  server_name.full? or server_name = self.class.default_server_name
24
- @server_name = server_name
26
+ @server_name = server_name
27
+ @clientserver = clientserver || 'socket'
25
28
  end
26
29
 
27
30
  # The default_server_name method generates a standardized server name
@@ -57,7 +60,7 @@ class OllamaChat::Vim
57
60
  Tempfile.open do |tmp|
58
61
  tmp.write(text)
59
62
  tmp.flush
60
- system %{vim --servername "#@server_name" --remote-send "<ESC>:r #{tmp.path}<CR>"}
63
+ system %{vim --clientserver "#@clientserver" --servername "#@server_name" --remote-send "<ESC>:r #{tmp.path}<CR>"}
61
64
  end
62
65
  end
63
66
 
@@ -68,6 +71,6 @@ class OllamaChat::Vim
68
71
  # the result of `col('.')`, which represents the current column number (1-indexed)
69
72
  # of the cursor position.
70
73
  def col
71
- `vim --servername "#@server_name" --remote-expr "col('.')"`.chomp.to_i
74
+ `vim --clientserver "#@clientserver" --servername "#@server_name" --remote-expr "col('.')"`.chomp.to_i
72
75
  end
73
76
  end
data/ollama_chat.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama_chat 0.0.40 ruby lib
2
+ # stub: ollama_chat 0.0.41 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama_chat".freeze
6
- s.version = "0.0.40".freeze
6
+ s.version = "0.0.41".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -66,7 +66,6 @@ describe OllamaChat::MessageList do
66
66
 
67
67
  it 'can save conversations' do
68
68
  expect(list.save_conversation('tmp/test-conversation.json')).to eq list
69
- expect(list.save_conversation('tmp/test-conversation.json')).to be_nil
70
69
  ensure
71
70
  FileUtils.rm_f 'tmp/test-conversation.json'
72
71
  end
@@ -11,7 +11,7 @@ describe OllamaChat::MessageOutput do
11
11
  expect(STDERR).to receive(:puts).with(/No response available to write to "foo.txt"/)
12
12
  expect(chat.output('foo.txt')).to be_nil
13
13
  chat.instance_variable_get(:@messages).load_conversation(asset('conversation.json'))
14
- expect(chat).to receive(:write_file_unless_exist).and_return true
14
+ expect(chat).to receive(:attempt_to_write_file).and_return true
15
15
  expect(STDOUT).to receive(:puts).with(/Last response was written to \"foo.txt\"./)
16
16
  expect(chat.output('foo.txt')).to eq chat
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ollama_chat
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.40
4
+ version: 0.0.41
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank