ollama-ruby 1.10.1 → 1.11.0

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: 0a9a5b8be0e11ed259fc68442b68846203b4754e3b2d5f4045b69004d1c81d97
4
- data.tar.gz: 13f0c462aeaeb02cd1e9074b788e09bbe369fe437dae916971c82193447f9287
3
+ metadata.gz: 204e16b85ab8d61e7baee8fcfe42db2ece4b2898180a019419d7847a2cb2711f
4
+ data.tar.gz: 6e7c9135a0047cdd945a6ce2781665c993f808d2c044aaf164c9c71ed1705410
5
5
  SHA512:
6
- metadata.gz: 8a068c2bf713a7a83c595c2a59e5ddd4326ffc322e9662cc6de7fe8251824af107f05903e822afce69902d301ca5570b912581887c4291155d283a6cdbda8237
7
- data.tar.gz: 908470c08366ead0c80444d40d7a736dc2c557fe2dca21ff0b0b313abccef3f50ac4bdd8365a8ddeb93a91cdaee8878362050db2a279938a7e1bb88a88c35433
6
+ metadata.gz: e38ed0cc5e945d5b7bfd3e41d325612d080dabaf544c2457c8270fe836ed223bd536cb58af4dd806fc6e233dc3e694c6d58620d3816721623de03533d19c7d21
7
+ data.tar.gz: c14520ca5f1cd8ecf5317489e71b32575e687b107b5b6c030052333ea95e9fcc608079273703895f597b80a81ea195ffb7bc9899283d2b778e79bc851c9a117d
data/CHANGES.md CHANGED
@@ -1,5 +1,56 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-11-05 v1.11.0
4
+
5
+ - Replaced `tabulo` gem with `terminal-table` **version 3.0** for table
6
+ rendering
7
+ - Updated `Rakefile` and `ollama-ruby.gemspec` to reflect new
8
+ `terminal-table` dependency
9
+ - Migrated table rendering logic from `Tabulo::Table` to `Terminal::Table`
10
+ - Added early return handling for empty model list case
11
+ - Updated YARD documentation guidelines for attribute accessors
12
+ - Changed meta key from `guidelins` to `guidelines`
13
+ - Added specific guidelines for documenting `attr_accessor`, `attr_reader`,
14
+ and `attr_writer` using `@attr`, `@attr_reader`, and `@attr_writer` tags
15
+ - Replaced `@return` tags with `@attr`, `@attr_reader`, and `@attr_writer`
16
+ for attribute accessors
17
+ - Maintained existing YARD documentation practices
18
+
19
+ ## 2025-10-28 v1.10.1
20
+
21
+ - Added new `ollama_ps` executable to the gem
22
+ - Added `bin/ollama_ps` to `s.files` list
23
+ - Added `lib/ollama/commands/ps.rb` to `s.extra_rdoc_files` list
24
+ - Added `ollama_ps` to `s.executables` list in Rakefile
25
+ - Maintained compatibility with existing executables
26
+
27
+ ## 2025-10-28 v1.10.0
28
+
29
+ - Enhanced `ollama_console` script with detailed documentation including
30
+ environment variables `OLLAMA_URL` and `OLLAMA_HOST`, client initialization,
31
+ and IRB session usage
32
+ - Added documentation comments to `ollama_browse` script explaining its purpose
33
+ of fetching and displaying model tag information with file sizes, context
34
+ sizes, and hash information
35
+ - Improved documentation for `ollama_cli` script with feature list covering
36
+ chat sessions, prompt templating, streaming modes, and detailed environment
37
+ variable descriptions including default values and `DEBUG` variable
38
+ explanation
39
+ - Updated `ollama_update` script with comprehensive header documentation
40
+ describing its purpose of updating all Ollama models to latest versions
41
+ - Added `nokogiri` dependency with version **1.0** to both `Rakefile` and
42
+ `ollama-ruby.gemspec`
43
+ - Introduced new `ollama_ps` utility script that displays running Ollama models
44
+ with enhanced information including parameter size, quantization level,
45
+ CPU/GPU allocation, and support for `OLLAMA_URL` or `OLLAMA_HOST` environment
46
+ variables
47
+ - Added `tabulo` **3.0** as runtime dependency to `ollama-ruby.gemspec` and
48
+ included `bin/ollama_ps` and `lib/ollama/commands/ps.rb` in `s.files` array
49
+ - Implemented safe text extraction using `&.text` when processing HTML elements
50
+ and added `hash.strip` for cleaning hash values before printing
51
+ - Updated `Rakefile` to include `tabulo` gem as dependency for the new
52
+ `ollama_ps` script functionality
53
+
3
54
  ## 2025-10-20 v1.9.0
4
55
 
5
56
  - Added `dimensions` parameter to `Ollama::Commands::Embed#initialize`
data/Rakefile CHANGED
@@ -34,7 +34,7 @@ GemHadar do
34
34
  dependency 'term-ansicolor', '~> 1.11'
35
35
  dependency 'kramdown-ansi', '~> 0.0', '>= 0.0.1'
36
36
  dependency 'ostruct', '~> 0.0'
37
- dependency 'tabulo', '~> 3.0'
37
+ dependency 'terminal-table', '~> 3.0'
38
38
  dependency 'nokogiri', '~> 1.0'
39
39
  development_dependency 'all_images', '~> 0.6'
40
40
  development_dependency 'rspec', '~> 3.2'
data/bin/ollama_ps CHANGED
@@ -33,7 +33,7 @@
33
33
 
34
34
  require 'ollama'
35
35
  include Ollama
36
- require 'tabulo'
36
+ require 'terminal-table'
37
37
 
38
38
  # The base_url method returns the Ollama API base URL.
39
39
  #
@@ -110,18 +110,31 @@ def ps
110
110
  ollama = Client.new(base_url:)
111
111
  result = ollama.ps
112
112
  models = result.models
113
+ models.empty? and return
113
114
 
114
- table = Tabulo::Table.new(models, border: :modern) do |t|
115
- t.add_column("NAME", &:name)
116
- t.add_column("ID") { |model| model.digest[0, 12] }
117
- t.add_column("SIZE", align_body: :right) { |model| format_bytes(model.size) }
118
- t.add_column("PROCESSOR") { |model| format_processor(model.size_vram, model.size) }
119
- t.add_column("CONTEXT") { |model| format_bytes(model.context_length) }
120
- t.add_column("PARAMS", align_body: :right) { |model| model.details&.parameter_size || 'n/a' }
121
- t.add_column("QUANT", align_body: :right) { |model| model.details&.quantization_level || 'n/a' }
122
- t.add_column("UNTIL") { |model| format_expiry(model.expires_at) }
115
+ table = Terminal::Table.new
116
+ table.style = {
117
+ all_separators: true,
118
+ border: :unicode_round,
119
+ }
120
+ headings = %w[ NAME ID SIZE PROCESSOR CONTEXT PARAMS QUANT UNTIL ]
121
+ table.headings = headings
122
+ models.each do |model|
123
+ table << [
124
+ model.name,
125
+ model.digest[0, 12],
126
+ format_bytes(model.size),
127
+ format_processor(model.size_vram, model.size),
128
+ format_bytes(model.context_length),
129
+ model.details&.parameter_size || 'n/a',
130
+ model.details&.quantization_level || 'n/a',
131
+ format_expiry(model.expires_at),
132
+ ]
123
133
  end
124
- puts table.pack
134
+ table.align_column(headings.index("SIZE"), :right)
135
+ table.align_column(headings.index("PARAMS"), :right)
136
+ table.align_column(headings.index("QUANT"), :right)
137
+ puts table
125
138
  end
126
139
 
127
140
  ps
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '1.10.1'
3
+ VERSION = '1.11.0'
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.10.1 ruby lib
2
+ # stub: ollama-ruby 1.11.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "1.10.1".freeze
6
+ s.version = "1.11.0".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]
@@ -39,6 +39,6 @@ Gem::Specification.new do |s|
39
39
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
40
40
  s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.0".freeze, ">= 0.0.1".freeze])
41
41
  s.add_runtime_dependency(%q<ostruct>.freeze, ["~> 0.0".freeze])
42
- s.add_runtime_dependency(%q<tabulo>.freeze, ["~> 3.0".freeze])
42
+ s.add_runtime_dependency(%q<terminal-table>.freeze, ["~> 3.0".freeze])
43
43
  s.add_runtime_dependency(%q<nokogiri>.freeze, ["~> 1.0".freeze])
44
44
  end
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.10.1
4
+ version: 1.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -226,7 +226,7 @@ dependencies:
226
226
  - !ruby/object:Gem::Version
227
227
  version: '0.0'
228
228
  - !ruby/object:Gem::Dependency
229
- name: tabulo
229
+ name: terminal-table
230
230
  requirement: !ruby/object:Gem::Requirement
231
231
  requirements:
232
232
  - - "~>"