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 +4 -4
- data/CHANGES.md +9 -0
- data/lib/ollama_chat/chat.rb +2 -1
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +2 -0
- data/lib/ollama_chat/version.rb +1 -1
- data/lib/ollama_chat/vim.rb +7 -4
- data/ollama_chat.gemspec +2 -2
- data/spec/ollama_chat/message_list_spec.rb +0 -1
- data/spec/ollama_chat/message_output_spec.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16c8e58cb6a7d268d4473262095f974045d683d44225e39861ce363c412f224b
|
|
4
|
+
data.tar.gz: 8205ee4aa5b7eb1c1493d4d3990a122dfbd05c978c2b8b316d21457c92003920
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
data/lib/ollama_chat/chat.rb
CHANGED
|
@@ -340,7 +340,8 @@ class OllamaChat::Chat
|
|
|
340
340
|
:next
|
|
341
341
|
when %r(^/vim(?:\s+(.+))?$)
|
|
342
342
|
if message = messages.last
|
|
343
|
-
|
|
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
|
data/lib/ollama_chat/version.rb
CHANGED
data/lib/ollama_chat/vim.rb
CHANGED
|
@@ -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
|
|
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.
|
|
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.
|
|
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(:
|
|
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
|