utils 0.91.1 → 0.92.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: 445a34dfb046f503673d8d79d19f849bab86cc2921049ab040f1f9871b62ef4f
4
- data.tar.gz: 28837676f6b0c58fd9985cae2c07d7f27cd1c3c972a2cf8d2f9d07808cf78e67
3
+ metadata.gz: e463ff924e67f19010624b289785351548ff5a2936b2313364746db6cda78ab1
4
+ data.tar.gz: 108ecbd19c3181d3ec171c9b299c0c6cbdecce2ca7dc74c6e79b628fd0817d99
5
5
  SHA512:
6
- metadata.gz: c4aac97722bdad61a2c9bdde3a4c7bcc88290c9b93f19ff4ce5a0c7d9dbd674d72257d29632e3902afc2f74dfa36b07462bf255c38c64e786fcb26144206b4ef
7
- data.tar.gz: df5d06a009a41901dd0ec399e70819c62517e7c04381b4cb297388451e48bc94d876f05e3a5207f939f0e481b1e3d2a09f7912ecdf4785e5e8a163122f3ef64e
6
+ metadata.gz: e15ee8452f37913150ec92fef8b34713eacf1fd711f05b103a53d5f95b703dcc66ab6e0e33d0d2adaef2025f9dd9addade2d56b4e146e25190d3f0704f130f5f
7
+ data.tar.gz: b190a70da86e9fa3f79f6d46a6fbe846f06151d201108519712da7f910081d188a3cdb5aa759176e7a70fbcce305bf61e5452693eff31c73abe334c459753b14
@@ -67,8 +67,8 @@ module Utils::IRB::Shell
67
67
  ri(*patterns, doc: 'yri')
68
68
  end
69
69
 
70
- # The ai method interacts with an Ollama chat service to process queries
71
- # and optionally return responses.
70
+ # The ocs method interacts with an Ollama chat service to process queries and
71
+ # optionally return responses.
72
72
  #
73
73
  # This method constructs command-line arguments for the ollama_chat_send
74
74
  # utility based on the provided options, executes the command with the
@@ -85,7 +85,7 @@ module Utils::IRB::Shell
85
85
  #
86
86
  # @return [ String, nil ] the response from the Ollama chat service if
87
87
  # respond is true, otherwise nil
88
- def ai(query, command: false, respond: false, parse: false, dir: ?.)
88
+ def ocs(query, command: false, respond: false, parse: false, dir: ?.)
89
89
  dir = File.expand_path(dir)
90
90
  args = {
91
91
  ?r => respond,
@@ -258,7 +258,7 @@ else
258
258
  # full description or abbreviated version
259
259
  #
260
260
  # @return [ String ] the appropriate description based on the full parameter value
261
- def description(example, full: ENV['VERBOSE'].to_i == 1)
261
+ def description(example, full: true)
262
262
  if full
263
263
  example.example.full_description
264
264
  else
@@ -296,9 +296,22 @@ else
296
296
  failed: ?❌,
297
297
  pending: ?⏩
298
298
  )
299
- args = [ status_emoji[status], location(example), run_time(example), description(example) ]
300
- uncolored = "%s %s # %3.3fs %s" % args
301
- uncolored = uncolored[0, Tins::Terminal.columns]
299
+ description = self.description(example)
300
+ uncolored = nil
301
+ cols = Tins::Terminal.columns - 1
302
+ redone = false
303
+ 1.times do
304
+ args = [ status_emoji[status], location(example), run_time(example), description ]
305
+ uncolored = "%s %s # %3.3fs %s" % args
306
+ if !redone && uncolored.size > cols
307
+ description = self.description(example, full: false)
308
+ redone = true
309
+ redo
310
+ else
311
+ break
312
+ end
313
+ end
314
+ uncolored = uncolored[0, cols]
302
315
  case status
303
316
  when :passed
304
317
  success_color(uncolored)
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.91.1'
3
+ VERSION = '0.92.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/utils.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.91.1 ruby lib
2
+ # stub: utils 0.92.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.91.1".freeze
6
+ s.version = "0.92.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]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.91.1
4
+ version: 0.92.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank