ruby-progress 1.3.2 → 1.3.4

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: 5c5a7ddc53059cb7f6d2b7bd1c066653058e1dbb281f4c23aa04229ce360a594
4
- data.tar.gz: 0446a713142b93f16b9fe3e102c8a3c0db3194db17da25de7f1f7f31e5090907
3
+ metadata.gz: b46930eb2d8991d939a50094820ddfd0821203a8ee1b393bbb3a1269d8c2032f
4
+ data.tar.gz: ae70d2f66ff64d6816b177a0e145d7c6ae8f6d1ee98f71cfb7198a9784493c36
5
5
  SHA512:
6
- metadata.gz: 3cda8e32c95b8bd03d6c8549de1b3f4fc488f868cb028a554ddc44654428978bfd1db4178a1cb0a0a71c9a0c8ea46a1cc8da844c4026ef9b84ed45c1b43f4691
7
- data.tar.gz: 39c31e85f87ea2201cbf3267fefedff1f4946f6bef9b1ee6178b8e1b5ecf8569a8391c20519582a1077bd6d352d229b01997ceedb358eeb049cf484c895028ed
6
+ metadata.gz: 3323def54c36c02851a2b8da4c7daca769038631ad18610f89f1e6c390449785946f61cd70a53eebc96d93b0e8da2713c228bb4078df36d8b9e3a69a6c4c4d96
7
+ data.tar.gz: 66fb49464bfe312d53110de3cceb38c8e3c64f12c7b6e1790bde8da547ee6fb726d15c77458db6409dd72efebb4982b3ac7bec97197457f3162fe4527ece7d12
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2025-10-13 12:49:46 UTC using RuboCop version 1.75.7.
3
+ # on 2025-10-14 13:03:02 UTC using RuboCop version 1.75.7.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -22,10 +22,11 @@ Layout/TrailingEmptyLines:
22
22
  Exclude:
23
23
  - 'test_worm_flags.rb'
24
24
 
25
- # Offense count: 2
25
+ # Offense count: 5
26
26
  # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
27
27
  Lint/DuplicateBranch:
28
28
  Exclude:
29
+ - 'lib/ruby-progress/output_capture.rb'
29
30
  - 'lib/ruby-progress/utils.rb'
30
31
  - 'lib/ruby-progress/worm.rb'
31
32
 
@@ -56,38 +57,43 @@ Lint/UselessAssignment:
56
57
  - 'demo_gem.rb'
57
58
  - 'spec/cli_integration_spec.rb'
58
59
 
59
- # Offense count: 52
60
+ # Offense count: 50
60
61
  # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
61
62
  Metrics/AbcSize:
62
- Max: 122
63
+ Max: 121
63
64
 
64
- # Offense count: 49
65
+ # Offense count: 52
65
66
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
66
67
  # AllowedMethods: refine
67
68
  Metrics/BlockLength:
68
69
  Max: 111
69
70
 
70
- # Offense count: 4
71
+ # Offense count: 5
71
72
  # Configuration parameters: CountComments, CountAsOne.
72
73
  Metrics/ClassLength:
73
- Max: 268
74
+ Max: 200
74
75
 
75
- # Offense count: 30
76
+ # Offense count: 33
76
77
  # Configuration parameters: AllowedMethods, AllowedPatterns.
77
78
  Metrics/CyclomaticComplexity:
78
79
  Max: 26
79
80
 
80
- # Offense count: 68
81
+ # Offense count: 70
81
82
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
82
83
  Metrics/MethodLength:
83
- Max: 156
84
+ Max: 140
84
85
 
85
- # Offense count: 9
86
+ # Offense count: 10
86
87
  # Configuration parameters: CountComments, CountAsOne.
87
88
  Metrics/ModuleLength:
88
- Max: 285
89
+ Max: 287
90
+
91
+ # Offense count: 1
92
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
93
+ Metrics/ParameterLists:
94
+ Max: 6
89
95
 
90
- # Offense count: 31
96
+ # Offense count: 32
91
97
  # Configuration parameters: AllowedMethods, AllowedPatterns.
92
98
  Metrics/PerceivedComplexity:
93
99
  Max: 27
@@ -174,7 +180,7 @@ Style/StringLiterals:
174
180
  Exclude:
175
181
  - 'test_worm_flags.rb'
176
182
 
177
- # Offense count: 39
183
+ # Offense count: 46
178
184
  # This cop supports safe autocorrection (--autocorrect).
179
185
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
180
186
  # URISchemes: http, https
data/CHANGELOG.md CHANGED
@@ -27,6 +27,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
27
27
 
28
28
  - Merge commit: 99d9c39 (squash-merge of feature/output-handling)
29
29
 
30
+ ## Unreleased
31
+
32
+ ### Fixed
33
+
34
+ - Output capture: ensure `--output-lines N` is honored when reserving terminal rows for captured output; coerce the `lines` option to an integer and stabilize the reserve/redraw logic so live captured output does not overwrite the prompt or animation.
35
+
36
+ ### Changed
37
+
38
+ - Prepared for next patch release.
39
+
40
+ ## 1.3.3 - 2025-10-14
41
+
42
+ ### Fixed
43
+
44
+ - Output capture: ensure `--output-lines N` is honored when reserving terminal rows for captured output; coerce the `lines` option to an integer and stabilize the reserve/redraw logic so live captured output does not overwrite the prompt or animation.
45
+
46
+ ### Changed
47
+
48
+ - Removed one-off init trace writes and cleaned debug logging. Bumped main gem `VERSION` to 1.3.3 during intermediate fixes.
49
+
30
50
  ## 1.3.2 - 2025-10-13
31
51
 
32
52
  ### Added
@@ -38,147 +58,93 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
38
58
  - Added `--stop-id NAME` shorthand for targeting named daemons (implies `--stop` and normalizes the name to the canonical PID filename). This is a small convenience used by the demo and scripts.
39
59
  - Demo: updated `demo_screencast.rb` to call the local `bin/prg` when stopping the demo daemon to avoid conflicts with system-installed versions.
40
60
 
41
- ### Changed
61
+ # CHANGELOG
42
62
 
43
- - Bumped `FILL_VERSION` (patch) to reflect the new CLI behavior.
63
+ All notable changes to this project will be documented in this file.
44
64
 
65
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
45
67
 
46
- ## 1.2.3 - 2025-10-11
68
+ ## Unreleased
47
69
 
48
- ### Added
70
+ ### Fixed
49
71
 
50
- - Dedicated `fill` shim: added `bin/fill` that delegates to `prg fill`.
72
+ - Output capture: ensure `--output-lines N` is honored when reserving terminal rows for captured output; coerce the `lines` option to an integer and stabilize the reserve/redraw logic so live captured output does not overwrite the prompt or animation.
51
73
 
52
74
  ### Changed
53
75
 
54
- - Version bumps: prg 1.2.2 → 1.2.3, fill 1.0.0 → 1.0.1
76
+ - Prepared for next patch release.
55
77
 
56
- ## 1.2.2 - 2025-10-11
78
+ ## 1.3.4 - 2025-10-14
57
79
 
58
- ### Improved
80
+ ### Fixed
59
81
 
60
- - Demo script enhancements: updated quick demo with better visual examples.
82
+ - Ensure non-live (`--stdout`) capture does not stream output to the terminal during animation; captured output is now emitted at completion only.
83
+ - Stabilized PTY-based output capture redraw/reserve logic and cursor save/restore fallback.
61
84
 
62
- ### Technical
85
+ ### Changed
63
86
 
64
- - Version alignment: synchronized demo script version display with actual gem version.
87
+ - Bumped main gem `VERSION` to 1.3.4.
88
+ - Cleaned up one-off debug/init traces written during development.
65
89
 
66
- ## 1.2.4 - 2025-10-12
90
+ ## 1.3.3 - 2025-10-14
67
91
 
68
- ### Added
92
+ ### Fixed
69
93
 
70
- - Small bug fixes and test stability improvements:
71
- - Ensured SimpleCov finalization runs reliably across Ruby versions during tests.
72
- - Minor CLI help text clarifications and version constant alignment.
94
+ - Output capture: ensure `--output-lines N` is honored when reserving terminal rows for captured output; coerce the `lines` option to an integer and stabilize the reserve/redraw logic so live captured output does not overwrite the prompt or animation.
73
95
 
74
96
  ### Changed
75
97
 
76
- - Bumped gem version and synchronized component version constants where applicable.
77
- - Messages now display cleanly at the beginning of a new line
78
- - Affects all three commands: ripple, worm, and twirl
79
- - Resolves issue where completion messages appeared mid-line after animation ended
80
- - Improved professional appearance of CLI output
98
+ - Removed one-off init trace writes and cleaned debug logging.
81
99
 
82
- Technical
100
+ ## 1.3.2 - 2025-10-13
83
101
 
84
- - **Enhanced display_completion method**: Added proper line clearing and cursor positioning
85
- - Uses `re[2K` sequence followed by clean message display
86
- - Updated test expectations to match new output format
87
- - Maintains backward compatibility with existing functionality
102
+ ### Added
88
103
 
89
- ## 1.2.0 - 2025-10-11
104
+ - `fill` subcommand: added `-c, --command COMMAND` so the determinate progress bar can run and capture command output like the other subcommands. This includes `--output-lines` and `--output-position` support for reserving terminal rows during capture.
90
105
 
91
- ### Added
106
+ ### Changed
92
107
 
93
- - **--ends flag for all commands**: New universal option to add start/end characters around animations
94
- - Accepts even-length strings split in half for start and end characters
95
- - Works across all three commands: ripple, worm, and twirl
96
- - Examples: `--ends "[]"` → `[animation]`, `--ends "<<>>"` → `<<animation>>`
97
- - Multi-byte character support for emojis: `--ends "🎯🎪"` → `🎯animation🎪`
98
- - Graceful fallback for invalid input (odd-length strings)
99
-
100
- - **Comprehensive test coverage for new features**: Added extensive test suites
101
- - Direction control tests: Forward-only vs bidirectional animation behavior
102
- - Custom style tests: ASCII, Unicode, emoji, and mixed character pattern validation
103
- - CLI integration tests: End-to-end testing for all new command-line options
104
- - Ends functionality tests: Multi-byte character handling, error cases, help documentation
105
- - Total: 58 new test examples covering all edge cases
106
-
107
- - **Worm direction control**: Fine-grained animation movement control
108
- - `--direction forward` (or `-d f`): Animation moves only forward, resets at end
109
- - `--direction bidirectional` (or `-d b`): Default back-and-forth movement
110
- - Compatible with all worm styles including custom patterns
111
-
112
- - **Worm custom styles**: User-defined 3-character animation patterns
113
- - Format: `--style custom=abc` where `abc` defines baseline, midline, peak characters
114
- - ASCII support: `--style custom=_-=` → `___-=___`
115
- - Unicode support: `--style custom=▫▪■` → geometric patterns
116
- - Emoji support: `--style custom=🟦🟨🟥` → colorful animations
117
- - Mixed characters: `--style custom=.🟡*` → combined ASCII and emoji
118
- - Proper multi-byte character counting for accurate 3-character validation
119
- - **Ripple style flags**: `--spinner`, `--rainbow`, `--inverse`, and `--caps` flags deprecated in favor of unified `--style` system (backward
120
- compatibility maintained)
108
+ - Added `--stop-id NAME` shorthand for targeting named daemons (implies `--stop` and normalizes the name to the canonical PID filename). This is a small convenience used by the demo and scripts.
109
+ - Demo: updated `demo_screencast.rb` to call the local `bin/prg` when stopping the demo daemon to avoid conflicts with system-installed versions.
121
110
 
122
- ### Fixed
111
+ ## 1.2.4 - 2025-10-12
123
112
 
124
- - **OptionParser conflicts**: Resolved parsing issues with optional arguments that could consume following flags
125
- - **Daemon workflow**: Streamlined daemon start/stop workflow eliminating need for redundant flag combinations
113
+ ### Added
126
114
 
127
- ## 1.0.1 - 2025-01-01
115
+ - Small bug fixes and test stability improvements; ensured SimpleCov finalization runs reliably across Ruby versions during tests and minor CLI help clarifications.
128
116
 
129
- ## 1.1.0 - 2025-10-09
117
+ ## 1.2.3 - 2025-10-11
130
118
 
131
119
  ### Added
132
120
 
133
- - Shared daemon helpers module `RubyProgress::Daemon` for default PID file, control message file, status, and stop logic
134
- - Unified daemon flags across ripple and worm: `--daemon`, `--status`, `--stop`, `--pid-file`, `--stop-success`, `--stop-error`,
135
- `--stop-checkmark`
136
- - Ripple: daemon parity with worm, including clean shutdown on SIGUSR1/TERM/HUP/INT
121
+ - Dedicated `fill` shim: added `bin/fill` that delegates to `prg fill`.
137
122
 
138
- ### Changed
123
+ ## 1.2.2 - 2025-10-11
139
124
 
140
- - `bin/prg` now delegates status/stop/default PID handling to `RubyProgress::Daemon`
141
- - README updated with new daemon usage examples and flag descriptions
125
+ ### Improved
142
126
 
143
- Deprecated
127
+ - Demo script enhancements: updated quick demo with better visual examples.
144
128
 
145
- - `--stop-pid` remains available but is deprecated in favor of `--stop [--pid-file FILE]`
129
+ ## 1.2.0 - 2025-10-11
146
130
 
147
131
  ### Added
148
132
 
149
- - Packaged as proper Ruby gem with library structure
150
- - Added RSpec test suite with comprehensive coverage
151
- - Added Rake tasks for version management and packaging
152
- - Added --checkmark and --stdout flags to Worm (ported from Ripple)
153
- - Added infinite mode to Worm (runs indefinitely without command like Ripple)
154
- - **Added unified `prg` binary with subcommands for both `ripple` and `worm`**
155
- - **Enhanced command-line interface with consistent flag support across both tools**
156
- - **Added `RubyProgress::Utils` module with universal terminal control utilities**
157
- - **Centralized cursor control, line clearing, and completion message functionality**
158
- - **Added daemon mode for background progress indicators in bash scripts**
159
- - **Implemented signal-based control (SIGUSR1) for clean daemon shutdown**
160
-
161
- ### Changed
133
+ - `--ends` flag for all commands and lots of smaller UX and testing improvements.
162
134
 
163
- - Moved classes into RubyProgress module
164
- - Separated logic into lib/ruby-progress/ structure
165
- - Created proper bin/ executables for ripple and worm
166
- - Updated README with gem installation and usage instructions
135
+ ## 1.1.0 - 2025-10-09
167
136
 
168
- ### Fixed
137
+ ### Added
169
138
 
170
- - Fixed duplicate error messages in Worm error handling
171
- - Improved signal handling and cursor management
139
+ - Shared daemon helpers module `RubyProgress::Daemon` and unified daemon flags across ripple and worm.
172
140
 
173
141
  ## 1.0.0 - 2025-10-09
174
142
 
175
143
  ### Added
176
144
 
177
- - Initial release with two progress indicators:
178
- - Ripple: Text ripple animation with 30+ spinner styles, rainbow effects, and command execution
179
- - Worm: Unicode wave animation with multiple styles and configurable options
180
- - Command-line interfaces for both tools
181
- - Support for custom speeds, messages, and styling options
182
- - Integration with system commands and process monitoring
145
+ - Initial release with two progress indicators (Ripple and Worm) and basic CLI tooling.
146
+
147
+
148
+ ## 1.0.1 - 2025-01-01
183
149
 
184
150
 
data/Gemfile CHANGED
@@ -10,4 +10,6 @@ group :development, :test do
10
10
  gem 'rspec', '~> 3.0'
11
11
  gem 'rubocop', '~> 1.21'
12
12
  gem 'simplecov', '~> 0.21', require: false
13
+ gem 'tty-cursor', '~> 0.7'
14
+ gem 'tty-screen', '~> 0.8'
13
15
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-progress (1.3.2)
4
+ ruby-progress (1.3.4)
5
+ tty-cursor (~> 0.7)
6
+ tty-screen (~> 0.8)
5
7
 
6
8
  GEM
7
9
  remote: https://rubygems.org/
@@ -55,6 +57,8 @@ GEM
55
57
  simplecov_json_formatter (~> 0.1)
56
58
  simplecov-html (0.13.1)
57
59
  simplecov_json_formatter (0.1.4)
60
+ tty-cursor (0.7.1)
61
+ tty-screen (0.8.2)
58
62
  unicode-display_width (3.1.4)
59
63
  unicode-emoji (~> 4.0, >= 4.0.4)
60
64
  unicode-emoji (4.0.4)
@@ -69,6 +73,8 @@ DEPENDENCIES
69
73
  rubocop (~> 1.21)
70
74
  ruby-progress!
71
75
  simplecov (~> 0.21)
76
+ tty-cursor (~> 0.7)
77
+ tty-screen (~> 0.8)
72
78
 
73
79
  BUNDLED WITH
74
80
  2.6.8