ollama-ruby 1.19.0 → 1.19.2

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: dcb4d954bc66b999983fbb02192c600d1ee1f5e052ae7808e5d287268cc54eb3
4
- data.tar.gz: 3c7a867320432d99f091b11c3955a3ca9f2b66888340effae91bf34f21768e8c
3
+ metadata.gz: 9c79c75dcf2f3530d26ade8051ff7c541dd3559a1ad39cb53b1c139ddece5001
4
+ data.tar.gz: 652b5d050acde1837ac8a23731b7467f77c3dcae4aa8b34ce15b3dda094d73c4
5
5
  SHA512:
6
- metadata.gz: f0d81e6b9df50f005efed07afc8dfc82fad1f072a293276526ff35f075bfc6c06d526e49a0a15d340ed84d1b470a27ee62ecd4754a776ceacc8890f7a6cc08c6
7
- data.tar.gz: a9f0c6c8cf62f75dea4f92a02f1c40b1f7b92034b69e83ba34a6282fd01df6126c14f2abd14987bd4d996023314675ede5cbbec8ca04b106d53807c971f710a4
6
+ metadata.gz: e754534c172336251aac7ac822c2abc7deaa0058fe85e832c39b11eccd2088498e48ab7e14760140c01f40fd04b99e3c375e193a80e234a6877fb4c3984e6543
7
+ data.tar.gz: 21bac2a43656d7cc4abed8a4a44a7b8bbeb225e96977503d2f7aef72fb19522a4fd0316afcf123a18128fe93c4b55f5691a5fda21c790213f6d66afe3e4eec54
data/CHANGES.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-03-08 v1.19.2
4
+
5
+ - Improve polling loop safety in `ollama_ps`.
6
+ - Add a robust rescue block: `rescue => e; warn "Caught #{e.class}: #{e}";
7
+ sleep duration`.
8
+
9
+ ## 2026-03-04 v1.19.1
10
+
11
+ - Fix ps command to fetch models inside loop
12
+
3
13
  ## 2026-03-04 v1.19.0
4
14
 
5
15
  - Added API key handling to the Ollama client: introduced a private `api_key`
data/bin/ollama_ps CHANGED
@@ -35,7 +35,7 @@ require 'ollama'
35
35
  include Ollama
36
36
  require 'terminal-table'
37
37
  require 'term/ansicolor'
38
- require 'tins'
38
+ require 'tins/xt'
39
39
  include Tins::GO
40
40
 
41
41
  # The usage method displays the command-line usage information for the
@@ -194,19 +194,24 @@ opts = go 'f:i:h'
194
194
 
195
195
  opts[?h] and usage
196
196
 
197
- models = fetch_ps_models or exit
198
-
199
197
  case opts[?f]
200
198
  when 'json'
199
+ models = fetch_ps_models or exit
201
200
  puts JSON.pretty_generate(interpret_models(models))
202
201
  when 'yaml'
202
+ models = fetch_ps_models or exit
203
203
  YAML.dump(interpret_models(models), STDOUT)
204
204
  else
205
- n = opts[?i].to_i
205
+ duration = opts[?i].to_i.clamp(0..)
206
206
  begin
207
- print Term::ANSIColor.clear_screen, Term::ANSIColor.move_home if n > 0
208
- ps_table(interpret_models(models))
209
- n == 0 and break
210
- sleep n
211
- end while n
207
+ print Term::ANSIColor.clear_screen, Term::ANSIColor.move_home if duration > 0
208
+ if models = fetch_ps_models.full?
209
+ ps_table(interpret_models(models))
210
+ end
211
+ duration == 0 and break
212
+ sleep duration
213
+ rescue => e
214
+ warn "Caught #{e.class}: #{e}"
215
+ sleep duration
216
+ end while duration
212
217
  end
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '1.19.0'
3
+ VERSION = '1.19.2'
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-ruby.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama-ruby 1.19.0 ruby lib
2
+ # stub: ollama-ruby 1.19.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "1.19.0".freeze
6
+ s.version = "1.19.2".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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ollama-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.19.0
4
+ version: 1.19.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank