ollama_chat 0.0.32 → 0.0.33
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/parsing.rb +2 -1
- data/lib/ollama_chat/source_fetching.rb +1 -1
- data/lib/ollama_chat/version.rb +1 -1
- data/ollama_chat.gemspec +2 -2
- data/spec/ollama_chat/parsing_spec.rb +16 -0
- 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: 7f2ffa19191743f1d9b41bfb72893dba9ca6e1e26836ed4c553a52b1c13f29ca
|
4
|
+
data.tar.gz: 83bc423d7f4daf9cda26a69c05858a300957c82cc74071285ee05c4afc734281
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9064c4a0b0ada0f57b2fca76c1665296f60607ec284a93f9e172aa83e6c36876a025caaec37dc84aa95ca1ad00e29a19bd93e93046bd8b07d21d54c31cfa5d7e
|
7
|
+
data.tar.gz: 37f74dfca1c4bee0946f56136d00b098303b69fe735bd84f9e3a6d1bb3f6ff59c4d1f03be9de7b451714b4909ece0a769cf9931c46b7c89d87bf0c3b53ebc98e
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 2025-09-15 v0.0.33
|
4
|
+
|
5
|
+
- Enhanced `CONTENT_REGEXP` to support escaped spaces in file paths using
|
6
|
+
`(?:\\\ |\\|[^\\ ]+)`
|
7
|
+
- Modified `SourceFetching` module to properly unescape spaces with `gsub('\ ',
|
8
|
+
' ')`
|
9
|
+
- Added new test case `can parse file path with escaped spaces` to verify
|
10
|
+
functionality
|
11
|
+
|
3
12
|
## 2025-09-15 v0.0.32
|
4
13
|
|
5
14
|
- Fixed file path parsing for escaped spaces and URI handling
|
data/lib/ollama_chat/parsing.rb
CHANGED
@@ -200,7 +200,7 @@ module OllamaChat::Parsing
|
|
200
200
|
| # OR
|
201
201
|
"((?:\.\.|[~.]?)/(?:\\"|\\|[^"\\]+)+)" # Quoted file path with escaped " quotes
|
202
202
|
| # OR
|
203
|
-
(
|
203
|
+
((?:\.\.|[~.]?)/(?:\\\ |\\|[^\\ ]+)+) # File path with escaped spaces
|
204
204
|
}x
|
205
205
|
private_constant :CONTENT_REGEXP
|
206
206
|
|
@@ -237,6 +237,7 @@ module OllamaChat::Parsing
|
|
237
237
|
check_exist = true
|
238
238
|
source = file
|
239
239
|
when file
|
240
|
+
file = file.gsub('\ ', ' ')
|
240
241
|
file =~ %r(\A[~./]) or file.prepend('./')
|
241
242
|
check_exist = true
|
242
243
|
source = file
|
@@ -76,7 +76,7 @@ module OllamaChat::SourceFetching
|
|
76
76
|
filename = File.expand_path(filename)
|
77
77
|
check_exist && !File.exist?(filename) and return
|
78
78
|
fetch_source_as_filename(filename, &block)
|
79
|
-
when %r{\A((?:\.\.|[~.]?)/(?:\\ |\\|[^\\]+)
|
79
|
+
when %r{\A((?:\.\.|[~.]?)/(?:\\ |\\|[^\\]+)+)}
|
80
80
|
filename = $1
|
81
81
|
filename = filename.gsub('\ ', ' ')
|
82
82
|
filename = File.expand_path(filename)
|
data/lib/ollama_chat/version.rb
CHANGED
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.33 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.33".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]
|
@@ -222,6 +222,22 @@ EOT
|
|
222
222
|
FileUtils.rm_f file_path
|
223
223
|
end
|
224
224
|
|
225
|
+
it 'can parse file path with escaped spaces' do
|
226
|
+
file_path = Pathname.pwd.join('spec/assets/example with .html')
|
227
|
+
FileUtils.cp 'spec/assets/example_with_quote.html', file_path
|
228
|
+
quoted_file_path = file_path.to_s.gsub(' ', '\\ ')
|
229
|
+
content, = chat.parse_content(%{see #{quoted_file_path}}, [])
|
230
|
+
expect(content).to include(<<~EOT)
|
231
|
+
Imported "#{file_path}":
|
232
|
+
|
233
|
+
# My First Heading
|
234
|
+
|
235
|
+
My first paragraph.
|
236
|
+
EOT
|
237
|
+
ensure
|
238
|
+
FileUtils.rm_f file_path
|
239
|
+
end
|
240
|
+
|
225
241
|
it 'can add images' do
|
226
242
|
images = []
|
227
243
|
expect(chat).to receive(:add_image).
|