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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cb31e7c6931a74314a918fa3f94838bccb89e2c7abd81c04632132998ed22f4b
4
- data.tar.gz: e75bd24632b7c7ef65e1d316802db5a919a7c4e401941e1b080e15bfea208618
3
+ metadata.gz: 7f2ffa19191743f1d9b41bfb72893dba9ca6e1e26836ed4c553a52b1c13f29ca
4
+ data.tar.gz: 83bc423d7f4daf9cda26a69c05858a300957c82cc74071285ee05c4afc734281
5
5
  SHA512:
6
- metadata.gz: 6c722b060b9e8c3e4e2de8cb3eca4656a75cc4eb063cc710350b27529d5b4449f58b75cf0f19cf6842019e0fe261ef0eda6af09e8ed8428458d01d2824315c3c
7
- data.tar.gz: 28c6966b8e3d663935f8cc5ddfe572df73c3d8471bb51168734c98641099c983e59859b44f576d3e92b80ca2277633d9ce7d00ac37cd464c087cf77104942368
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
@@ -200,7 +200,7 @@ module OllamaChat::Parsing
200
200
  | # OR
201
201
  "((?:\.\.|[~.]?)/(?:\\"|\\|[^"\\]+)+)" # Quoted file path with escaped " quotes
202
202
  | # OR
203
- (\S*\/\S+) # File path with at least one forward slash
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)
@@ -1,6 +1,6 @@
1
1
  module OllamaChat
2
2
  # OllamaChat version
3
- VERSION = '0.0.32'
3
+ VERSION = '0.0.33'
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:
data/ollama_chat.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama_chat 0.0.32 ruby lib
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.32".freeze
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).
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.32
4
+ version: 0.0.33
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank