infobar 0.14.0 → 0.15.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: beec20adb697be698aa12ed3f834604867867e6fe75c8dcc4ad078ec74846f2e
4
- data.tar.gz: 06a4590b0743fd05b408dee31f336c137f8386b3f6bd0d68996749f449ad6ff7
3
+ metadata.gz: 78cbcd08f0a2d2ddd1094df459bf3ca54bf3daab8ce3414263f51df214292d16
4
+ data.tar.gz: 477e29d5f2e1fe56a422083c6efceb770eee9b570594c9ad6ba33f54104240ee
5
5
  SHA512:
6
- metadata.gz: 1a162cbf417cda56c28fa60aecc64868142bf538045b7383192ec8cc78c2eb98f766ec8da3a9d216eca8da82e81dd2fe8d5a3efd054b5947ddc6f19f32268797
7
- data.tar.gz: 73babe25cdd25aa3c84ba53441a8948a2da82b2c1abc209d2644d338eb41c90197a0b1916822aa7e18afbf41e24844d137055a3176e67088d8cff89eacab79b6
6
+ metadata.gz: 6d3f41bbf6ae87c63fc4183d229f12ce505f58bcd72eb7f6ba568a521d23ef48561929c19ded01d4154c5b38c5e11d9c3cb4052b609893c61eb746839b5824dd
7
+ data.tar.gz: af5a5669ff6057a85a76f9ecf07be72cc384359de19ea4b034d398c0bd2175e49d79d8c9b95ebd364c3c0a0202721ae8a6e098159f677f07a7451f62fe20ee16
data/CHANGES.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-11-16 v0.15.0
4
+
5
+ ### Fixes
6
+
7
+ - `Display#newline` now resets `@position_saved` to `false`, preventing the
8
+ next `Display#update` from restoring to a stale bar-line position after a
9
+ newline commit.
10
+
11
+ ### Testing
12
+
13
+ - Updated spec expectations in `display_spec.rb` to include the trailing
14
+ `restore_position` escape sequence.
15
+ - Added singleton state isolation (`display.reset`) and the missing
16
+ `restore_position` expectation in `config_spec.rb`.
17
+
3
18
  ## 2026-11-15 v0.14.0
4
19
 
5
20
  ### Features
data/infobar.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: infobar 0.14.0 ruby lib
2
+ # stub: infobar 0.15.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "infobar".freeze
6
- s.version = "0.14.0".freeze
6
+ s.version = "0.15.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]
@@ -236,6 +236,7 @@ class Infobar::Display
236
236
  # @return [Infobar::Display] self
237
237
  def newline
238
238
  output << $/
239
+ @position_saved = false
239
240
  self
240
241
  end
241
242
 
@@ -5,7 +5,7 @@
5
5
  # by hand; it is rewritten on every `rake version` invocation.
6
6
  class Infobar
7
7
  # The current version of the Infobar gem as a String.
8
- VERSION = '0.14.0'
8
+ VERSION = '0.15.0'
9
9
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
10
10
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
11
11
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
@@ -19,11 +19,13 @@ describe 'Infobar config' do
19
19
 
20
20
  it 'configures default infobar' do
21
21
  Infobar(total: 23)
22
+ infobar.display.reset
22
23
  expect(infobar.display.output).to receive(:<<).with("\e[s")
23
24
  expect(infobar.display.output).to receive(:<<).with(
24
25
  "\e[38;5;22m\e[48;5;40m\e[0m\e[0m"
25
26
  )
26
27
  expect(infobar.display.output).to receive(:<<).with(%r(Progress 0/23.*⣽))
28
+ expect(infobar.display.output).to receive(:<<).with("\e[u")
27
29
  infobar.update
28
30
  expect(infobar).to be_show
29
31
  end
@@ -21,7 +21,7 @@ describe Infobar::Display do
21
21
  it 'can be updated' do
22
22
  display.update message: 'test', counter: counter
23
23
  expect(output.tap(&:rewind).read).to eq\
24
- "\e[s\e[38;5;22m\e[48;5;40m░░░░░░░░░░░░░░░░░░te\e[0m\e[0m\e[38;5;40m\e[48;5;22mst \e[0m\e[0m"
24
+ "\e[s\e[38;5;22m\e[48;5;40m░░░░░░░░░░░░░░░░░░te\e[0m\e[0m\e[38;5;40m\e[48;5;22mst \e[0m\e[0m\e[u"
25
25
  end
26
26
 
27
27
  it 'update saves position first' do
@@ -69,7 +69,7 @@ describe Infobar::Display do
69
69
  display.style = test_style
70
70
  display.update message: 'test', counter: counter
71
71
  expect(output.tap(&:rewind).read).to eq\
72
- "\e[s\e[38;5;1m\e[48;5;9mXXXXXXXXXXXXXXXXXXte\e[0m\e[0m\e[38;5;0m\e[48;5;8mstOOOOOOOOOOOOOOOOOO\e[0m\e[0m"
72
+ "\e[s\e[38;5;1m\e[48;5;9mXXXXXXXXXXXXXXXXXXte\e[0m\e[0m\e[38;5;0m\e[48;5;8mstOOOOOOOOOOOOOOOOOO\e[0m\e[0m\e[u"
73
73
  expect(display.style).to eq(test_style)
74
74
  end
75
75
 
@@ -95,7 +95,7 @@ describe Infobar::Display do
95
95
  ).at_least(:once)
96
96
  display.update message: 'test', counter: counter
97
97
  expect(output.tap(&:rewind).read).to eq\
98
- "\e[s\e[38;5;1m\e[48;5;9mXXXXXXXXXXXXXXXXX\e[0m\e[0m\e[38;5;0m\e[48;5;10m*test******\e[0m\e[0m\e[38;5;40m\e[48;5;22m \e[0m\e[0m"
98
+ "\e[s\e[38;5;1m\e[48;5;9mXXXXXXXXXXXXXXXXX\e[0m\e[0m\e[38;5;0m\e[48;5;10m*test******\e[0m\e[0m\e[38;5;40m\e[48;5;22m \e[0m\e[0m\e[u"
99
99
  end
100
100
 
101
101
  it 'can output newline' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: infobar
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank