ruby-progress 1.2.0 β†’ 1.2.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.
data/README.md CHANGED
@@ -25,17 +25,24 @@ prg ripple "Loading..." --style rainbow --speed fast
25
25
  # Use twirl spinner animation
26
26
  prg twirl --message "Working..." --style dots --speed fast
27
27
 
28
- # With command execution
28
+ # Dedicated `fill` shim
29
+ # If you prefer a dedicated binary for the determinate progress bar, a thin `fill` shim is available that delegates to `prg fill`:
30
+
31
+ # Run fill directly (delegates to prg)
32
+ fill --report --percent 50
33
+ ```
34
+
35
+ ### With command execution
29
36
  prg worm --command "sleep 5" --success "Completed!" --error "Failed!" --checkmark
30
37
  prg ripple "Building..." --command "make build" --success "Build complete!" --stdout
31
38
  prg twirl --command "npm install" --message "Installing packages" --style arc
32
39
 
33
- # With start/end character decoration using --ends
40
+ ### With start/end character decoration using --ends
34
41
  prg ripple "Loading data" --ends "[]" --style rainbow
35
42
  prg worm --message "Processing" --ends "()" --style blocks
36
43
  prg twirl --message "Building" --ends "<<>>" --style dots
37
44
 
38
- # Complex --ends patterns with emojis
45
+ ### Complex --ends patterns with emojis
39
46
  prg worm --message "Magic" --ends "🎯πŸŽͺ" --style "custom=🟦🟨πŸŸ₯"
40
47
  ```
41
48
 
@@ -62,28 +69,28 @@ prg worm --message "Magic" --ends "🎯πŸŽͺ" --style "custom=🟦🟨πŸŸ₯"
62
69
  For shell scripts where you need a continuous progress indicator across multiple steps, use daemon mode. You can use named daemons or custom PID files.
63
70
 
64
71
  ```bash
65
- # Start in background (uses default PID file)
72
+ ### Start in background (uses default PID file)
66
73
  prg worm --daemon --message "Working..."
67
74
 
68
- # Start with a custom name (creates /tmp/ruby-progress/NAME.pid)
75
+ ### Start with a custom name (creates /tmp/ruby-progress/NAME.pid)
69
76
  prg worm --daemon-as mytask --message "Processing data..."
70
77
 
71
- # ... run your tasks ...
78
+ ### ... run your tasks ...
72
79
 
73
- # Stop with a success message and checkmark (--stop-success implies --stop)
80
+ ### Stop with a success message and checkmark (--stop-success implies --stop)
74
81
  prg worm --stop-success "All done" --stop-checkmark
75
82
 
76
- # Stop a named daemon (--stop-id implies --stop)
83
+ ### Stop a named daemon (--stop-id implies --stop)
77
84
  prg worm --stop-id mytask --stop-success "Task complete!" --stop-checkmark
78
85
 
79
- # Or stop with an error message and checkmark
86
+ ### Or stop with an error message and checkmark
80
87
  prg worm --stop-error "Failed during step" --stop-checkmark
81
88
 
82
- # Check status at any time
89
+ ### Check status at any time
83
90
  prg worm --status
84
91
  prg worm --status-id mytask
85
92
 
86
- # Use a completely custom PID file path
93
+ ### Use a completely custom PID file path
87
94
  prg worm --daemon --pid-file /tmp/custom-progress.pid
88
95
  prg worm --status --pid-file /tmp/custom-progress.pid
89
96
  prg worm --stop-success "Complete" --pid-file /tmp/custom-progress.pid
@@ -95,14 +102,67 @@ Notes:
95
102
  - `--stop-success` and `--stop-error` are mutually exclusive; whichever you provide determines the success state and icon if `--stop-checkmark` is set.
96
103
  - The indicator clears its line on shutdown and prints the final message to STDOUT.
97
104
  - `--stop-pid` is still supported for backward compatibility, but `--stop [--pid-file FILE]` is preferred.
105
+ o- [Ruby Progress Indicators](#ruby-progress-indicators)
106
+ - [Unified Interface](#unified-interface)
107
+ - [With command execution](#with-command-execution)
108
+ - [With start/end character decoration using --ends](#with-startend-character-decoration-using-ends)
109
+ - [Complex --ends patterns with emojis](#complex-ends-patterns-with-emojis)
110
+ - [Start in background (uses default PID file)](#start-in-background-uses-default-pid-file)
111
+ - [Start with a custom name (creates /tmp/ruby-progress/NAME.pid)](#start-with-a-custom-name-creates-tmpruby-progressnamepid)
112
+ - [... run your tasks ...](#-run-your-tasks-)
113
+ - [Stop with a success message and checkmark (--stop-success implies --stop)](#stop-with-a-success-message-and-checkmark-stop-success-implies-stop)
114
+ - [Stop a named daemon (--stop-id implies --stop)](#stop-a-named-daemon-stop-id-implies-stop)
115
+ - [Or stop with an error message and checkmark](#or-stop-with-an-error-message-and-checkmark)
116
+ - [Check status at any time](#check-status-at-any-time)
117
+ - [Use a completely custom PID file path](#use-a-completely-custom-pid-file-path)
118
+ - [Basic text animation](#basic-text-animation)
119
+ - [With style options](#with-style-options)
120
+ - [Multiple styles combined](#multiple-styles-combined)
121
+ - [Case transformation mode](#case-transformation-mode)
122
+ - [Run a command with progress animation](#run-a-command-with-progress-animation)
123
+ - [Simple progress block](#simple-progress-block)
124
+ - [With options](#with-options)
125
+ - [Basic spinner animation](#basic-spinner-animation)
126
+ - [With command execution](#with-command-execution)
127
+ - [Different spinner styles](#different-spinner-styles)
128
+ - [With success/error handling](#with-successerror-handling)
129
+ - [Daemon mode for background tasks](#daemon-mode-for-background-tasks)
130
+ - [... do other work ...](#-do-other-work-)
131
+ - [Run indefinitely without a command (like ripple)](#run-indefinitely-without-a-command-like-ripple)
132
+ - [Run a command with progress animation](#run-a-command-with-progress-animation)
133
+ - [Customize the animation](#customize-the-animation)
134
+ - [With custom error handling](#with-custom-error-handling)
135
+ - [With checkmarks for visual feedback](#with-checkmarks-for-visual-feedback)
136
+ - [Control animation direction (forward-only or bidirectional)](#control-animation-direction-forward-only-or-bidirectional)
137
+ - [Create custom animations with 3-character patterns](#create-custom-animations-with-3-character-patterns)
138
+ - [Add start/end characters around the animation](#add-startend-characters-around-the-animation)
139
+ - [Capture and display command output](#capture-and-display-command-output)
140
+ - [Combine checkmarks and stdout output](#combine-checkmarks-and-stdout-output)
141
+ - [Start in the background (default PID file: /tmp/ruby-progress/progress.pid)](#start-in-the-background-default-pid-file-tmpruby-progressprogresspid)
142
+ - [... run your tasks ...](#-run-your-tasks-)
143
+ - [Stop using the default PID file](#stop-using-the-default-pid-file)
144
+ - [Use a custom PID file](#use-a-custom-pid-file)
145
+ - [Stop using the matching custom PID file](#stop-using-the-matching-custom-pid-file)
146
+ - [Create and run animation with a block](#create-and-run-animation-with-a-block)
147
+ - [Your work here](#your-work-here)
148
+ - [With custom style and forward direction](#with-custom-style-and-forward-direction)
149
+ - [Or run with a command](#or-run-with-a-command)
150
+ - [ASCII characters](#ascii-characters)
151
+ - [Unicode characters](#unicode-characters)
152
+ - [Emojis (supports multi-byte characters)](#emojis-supports-multi-byte-characters)
153
+ - [Mixed ASCII and emoji](#mixed-ascii-and-emoji)
154
+ - [Cursor control](#cursor-control)
155
+ - [Basic completion message](#basic-completion-message)
156
+ - [With success/failure indication and checkmarks](#with-successfailure-indication-and-checkmarks)
157
+ - [Clear line and display completion (useful for replacing progress indicators)](#clear-line-and-display-completion-useful-for-replacing-progress-indicators)
98
158
 
99
159
  ## Table of Contents
100
160
 
101
161
  - [Ruby Progress Indicators](#ruby-progress-indicators)
102
162
  - [Unified Interface](#unified-interface)
103
- - [Global Options](#global-options)
104
- - [Common Options (available for both subcommands)](#common-options-available-for-both-subcommands)
105
- - [Daemon Mode (Background Progress)](#daemon-mode-background-progress)
163
+ - [With command execution](#with-command-execution)
164
+ - [With start/end character decoration using --ends](#with-startend-character-decoration-using---ends)
165
+ - [Complex --ends patterns with emojis](#complex---ends-patterns-with-emojis)
106
166
  - [Table of Contents](#table-of-contents)
107
167
  - [Ripple](#ripple)
108
168
  - [Ripple Features](#ripple-features)
@@ -127,6 +187,8 @@ Notes:
127
187
  - [Circles](#circles)
128
188
  - [Blocks](#blocks)
129
189
  - [Geometric](#geometric)
190
+ - [Custom Styles](#custom-styles)
191
+ - [Direction Control](#direction-control)
130
192
  - [Requirements](#requirements)
131
193
  - [Installation](#installation)
132
194
  - [As a Gem (Recommended)](#as-a-gem-recommended)
@@ -138,6 +200,7 @@ Notes:
138
200
  - [Contributing](#contributing)
139
201
  - [License](#license)
140
202
 
203
+
141
204
  ---
142
205
 
143
206
  ## Ripple
@@ -159,19 +222,19 @@ Ripple is a sophisticated text animation library that creates ripple effects acr
159
222
  #### Ripple CLI examples
160
223
 
161
224
  ```bash
162
- # Basic text animation
225
+ ### Basic text animation
163
226
  prg ripple "Loading..."
164
227
 
165
- # With style options
228
+ ### With style options
166
229
  prg ripple "Processing Data" --speed fast --style rainbow --direction bidirectional
167
230
 
168
- # Multiple styles combined
231
+ ### Multiple styles combined
169
232
  prg ripple "Loading..." --style rainbow,inverse
170
233
 
171
- # Case transformation mode
234
+ ### Case transformation mode
172
235
  prg ripple "Processing Text" --style caps,inverse
173
236
 
174
- # Run a command with progress animation
237
+ ### Run a command with progress animation
175
238
  prg ripple "Installing packages" --command "sleep 5" --success "Installation complete!" --checkmark
176
239
  ```
177
240
 
@@ -196,12 +259,12 @@ You can also use Ripple as a Ruby library:
196
259
  ```ruby
197
260
  require 'ruby-progress'
198
261
 
199
- # Simple progress block
262
+ ### Simple progress block
200
263
  result = RubyProgress::Ripple.progress("Processing...") do
201
264
  sleep 5 # Your actual work here
202
265
  end
203
266
 
204
- # With options
267
+ ### With options
205
268
  rippler = RubyProgress::Ripple.new("Loading Data", {
206
269
  speed: :fast,
207
270
  format: :bidirectional,
@@ -236,24 +299,24 @@ Twirl is a lightweight spinner animation system providing over 35 different spin
236
299
  #### Command Line
237
300
 
238
301
  ```bash
239
- # Basic spinner animation
302
+ ### Basic spinner animation
240
303
  prg twirl --message "Processing..." --style dots
241
304
 
242
- # With command execution
305
+ ### With command execution
243
306
  prg twirl --command "npm install" --message "Installing" --style arc
244
307
 
245
- # Different spinner styles
308
+ ### Different spinner styles
246
309
  prg twirl --message "Working" --style arrows --speed fast
247
310
  prg twirl --message "Loading" --style blocks --speed slow
248
311
 
249
- # With success/error handling
312
+ ### With success/error handling
250
313
  prg twirl --command "make build" --success "Build complete!" --error "Build failed!" --checkmark
251
314
 
252
- # Daemon mode for background tasks
315
+ ### Daemon mode for background tasks
253
316
  prg twirl --daemon --message "Background processing" --style geometric
254
317
  prg twirl --daemon-as mytask --message "Named task" --style dots
255
318
 
256
- # ... do other work ...
319
+ ### ... do other work ...
257
320
  prg twirl --stop-success "Processing complete!"
258
321
  prg twirl --stop-id mytask --stop-success "Task finished!"
259
322
  ```
@@ -312,39 +375,39 @@ Worm is a clean, Unicode-based progress indicator that creates a ripple effect u
312
375
  #### Command Line
313
376
 
314
377
  ```bash
315
- # Run indefinitely without a command (like ripple)
378
+ ### Run indefinitely without a command (like ripple)
316
379
  prg worm --message "Loading..." --speed fast --style circles
317
380
 
318
- # Run a command with progress animation
381
+ ### Run a command with progress animation
319
382
  prg worm --command "sleep 5" --message "Installing" --success "Done!"
320
383
 
321
- # Customize the animation
384
+ ### Customize the animation
322
385
  prg worm --command "make build" --speed fast --length 5 --style blocks
323
386
 
324
- # With custom error handling
387
+ ### With custom error handling
325
388
  prg worm --command "risky_operation" --error "Operation failed" --style geometric
326
389
 
327
- # With checkmarks for visual feedback
390
+ ### With checkmarks for visual feedback
328
391
  prg worm --command "npm install" --success "Installation complete!" --checkmark
329
392
 
330
- # Control animation direction (forward-only or bidirectional)
393
+ ### Control animation direction (forward-only or bidirectional)
331
394
  prg worm --message "Processing" --direction forward --style circles
332
395
  prg worm --command "sleep 3" --direction bidirectional --style blocks
333
396
 
334
- # Create custom animations with 3-character patterns
397
+ ### Create custom animations with 3-character patterns
335
398
  prg worm --message "Custom style" --style "custom=_-=" --command "sleep 2"
336
399
  prg worm --message "Emoji worm!" --style "custom=🟦🟨πŸŸ₯" --success "Complete!"
337
400
  prg worm --message "Mixed chars" --style "custom=.🟑*" --direction forward
338
401
 
339
- # Add start/end characters around the animation
402
+ ### Add start/end characters around the animation
340
403
  prg worm --message "Bracketed" --ends "[]" --style circles
341
404
  prg worm --message "Parentheses" --ends "()" --style blocks --direction forward
342
405
  prg worm --message "Emoji ends" --ends "🎯πŸŽͺ" --style "custom=🟦🟨πŸŸ₯"
343
406
 
344
- # Capture and display command output
407
+ ### Capture and display command output
345
408
  prg worm --command "git status" --message "Checking status" --stdout
346
409
 
347
- # Combine checkmarks and stdout output
410
+ ### Combine checkmarks and stdout output
348
411
  prg worm --command "echo 'Build output'" --success "Build complete!" --checkmark --stdout
349
412
  ```
350
413
 
@@ -353,18 +416,18 @@ prg worm --command "echo 'Build output'" --success "Build complete!" --checkmark
353
416
  Run the worm indicator as a background daemon and stop it later (useful in shell scripts):
354
417
 
355
418
  ```bash
356
- # Start in the background (default PID file: /tmp/ruby-progress/progress.pid)
419
+ ### Start in the background (default PID file: /tmp/ruby-progress/progress.pid)
357
420
  prg worm --daemon
358
421
 
359
- # ... run your tasks ...
422
+ ### ... run your tasks ...
360
423
 
361
- # Stop using the default PID file
424
+ ### Stop using the default PID file
362
425
  prg worm --stop
363
426
 
364
- # Use a custom PID file
427
+ ### Use a custom PID file
365
428
  prg worm --daemon --pid-file /tmp/custom-worm.pid
366
429
 
367
- # Stop using the matching custom PID file
430
+ ### Stop using the matching custom PID file
368
431
  prg worm --stop --pid-file /tmp/custom-worm.pid
369
432
  ```
370
433
 
@@ -399,7 +462,7 @@ Note: You don’t need `&` when starting the daemon. The command detaches itself
399
462
  ```ruby
400
463
  require 'ruby-progress'
401
464
 
402
- # Create and run animation with a block
465
+ ### Create and run animation with a block
403
466
  worm = RubyProgress::Worm.new(
404
467
  length: 4,
405
468
  message: "Processing",
@@ -416,7 +479,7 @@ result = worm.animate(
416
479
  some_long_running_task
417
480
  end
418
481
 
419
- # With custom style and forward direction
482
+ ### With custom style and forward direction
420
483
  worm = RubyProgress::Worm.new(
421
484
  message: "Custom animation",
422
485
  style: 'custom=πŸ”΄πŸŸ‘πŸŸ’',
@@ -425,7 +488,7 @@ worm = RubyProgress::Worm.new(
425
488
 
426
489
  result = worm.animate { sleep 3 }
427
490
 
428
- # Or run with a command
491
+ ### Or run with a command
429
492
  worm = RubyProgress::Worm.new(command: "bundle install")
430
493
  worm.run_with_command
431
494
  ```
@@ -457,16 +520,16 @@ Worm supports three built-in animation styles plus custom patterns:
457
520
  Create your own animation patterns using the `custom=XXX` format, where `XXX` is a 3-character pattern representing baseline, midline, and peak states:
458
521
 
459
522
  ```bash
460
- # ASCII characters
523
+ ### ASCII characters
461
524
  prg worm --style "custom=_-=" --message "Custom ASCII"
462
525
 
463
- # Unicode characters
526
+ ### Unicode characters
464
527
  prg worm --style "custom=β–«β–ͺβ– " --message "Custom geometric"
465
528
 
466
- # Emojis (supports multi-byte characters)
529
+ ### Emojis (supports multi-byte characters)
467
530
  prg worm --style "custom=🟦🟨πŸŸ₯" --message "Color progression"
468
531
 
469
- # Mixed ASCII and emoji
532
+ ### Mixed ASCII and emoji
470
533
  prg worm --style "custom=.🟑*" --message "Mixed characters"
471
534
  ```
472
535
 
@@ -538,7 +601,7 @@ The gem provides universal utilities in the `RubyProgress::Utils` module for com
538
601
  ```ruby
539
602
  require 'ruby-progress'
540
603
 
541
- # Cursor control
604
+ ### Cursor control
542
605
  RubyProgress::Utils.hide_cursor # Hide terminal cursor
543
606
  RubyProgress::Utils.show_cursor # Show terminal cursor
544
607
  RubyProgress::Utils.clear_line # Clear current line
@@ -547,10 +610,10 @@ RubyProgress::Utils.clear_line # Clear current line
547
610
  ### Completion Messages
548
611
 
549
612
  ```ruby
550
- # Basic completion message
613
+ ### Basic completion message
551
614
  RubyProgress::Utils.display_completion("Task completed!")
552
615
 
553
- # With success/failure indication and checkmarks
616
+ ### With success/failure indication and checkmarks
554
617
  RubyProgress::Utils.display_completion(
555
618
  "Build successful!",
556
619
  success: true,
@@ -564,7 +627,7 @@ RubyProgress::Utils.display_completion(
564
627
  output_stream: :stdout # :stdout, :stderr, or :warn (default)
565
628
  )
566
629
 
567
- # Clear line and display completion (useful for replacing progress indicators)
630
+ ### Clear line and display completion (useful for replacing progress indicators)
568
631
  RubyProgress::Utils.complete_with_clear(
569
632
  "Processing complete!",
570
633
  success: true,
data/Rakefile CHANGED
@@ -7,6 +7,13 @@ require 'rubocop/rake_task'
7
7
  RSpec::Core::RakeTask.new(:spec)
8
8
  RuboCop::RakeTask.new
9
9
 
10
+ # Convenience aliases
11
+ # `rake test` -> runs the :spec task (RSpec)
12
+ task test: :spec
13
+
14
+ # Provide a `rake lint` alias that runs RuboCop (which defines the :rubocop task)
15
+ task lint: :rubocop
16
+
10
17
  task default: [:spec]
11
18
 
12
19
  # Used by markdown tasks
data/bin/fill ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # Thin shim to delegate to the unified prg CLI
5
+ prg = File.expand_path(File.join(__dir__, 'prg'))
6
+ if File.executable?(prg)
7
+ exec prg, 'fill', *ARGV
8
+ else
9
+ exec 'prg', 'fill', *ARGV
10
+ end