ruby-progress 1.0.1 → 1.1.2
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 +4 -4
- data/.editorconfig +14 -0
- data/.markdownlint.json +9 -0
- data/CHANGELOG.md +63 -1
- data/Gemfile.lock +1 -1
- data/README.md +200 -45
- data/Rakefile +121 -0
- data/bin/prg +584 -65
- data/bin/ripple +6 -143
- data/bin/twirl +10 -0
- data/bin/worm +6 -76
- data/examples/bash_daemon_demo.sh +67 -0
- data/examples/daemon_demo.rb +67 -0
- data/examples/utils_demo.rb +21 -20
- data/lib/ruby-progress/daemon.rb +60 -0
- data/lib/ruby-progress/utils.rb +2 -2
- data/lib/ruby-progress/version.rb +1 -1
- data/lib/ruby-progress/worm.rb +78 -6
- data/lib/ruby-progress.rb +1 -0
- data/ruby-progress.gemspec +2 -2
- data/worm.rb +1 -0
- metadata +11 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49879f3480e89d03b3f7448dc582514f20e0637fc9e2c0252c9c0782eecbbd05
|
4
|
+
data.tar.gz: aa099474b01118ef950d1e9c4dd50059f0f0acf8d9bb8a256e72d9e9e257fc37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3665c5d3f73d04d9fc890d4360165a177c4d26fd5bc01765dc49ab654c60b6a069b3364fbfc87e2226038d2af92c226dc1d89b739a98464dbdaf9d93b5903025
|
7
|
+
data.tar.gz: f4335241b770d265cd400eb535a6d65be9d0097d391524604ab7d84307ab5fccc49a8a2874acf9f51ac33f074f556fcfaa51a7c11e215045d08e3f873f7d09f1
|
data/.editorconfig
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
# EditorConfig helps maintain consistent coding styles
|
2
|
+
root = true
|
3
|
+
|
4
|
+
[*]
|
5
|
+
end_of_line = lf
|
6
|
+
insert_final_newline = true
|
7
|
+
charset = utf-8
|
8
|
+
trim_trailing_whitespace = true
|
9
|
+
|
10
|
+
[*.md]
|
11
|
+
# Keep Markdown tidy
|
12
|
+
trim_trailing_whitespace = true
|
13
|
+
# Avoid excessive vertical spacing while requiring clear blocks
|
14
|
+
# (linting will enforce blanks around headings/lists)
|
data/.markdownlint.json
ADDED
data/CHANGELOG.md
CHANGED
@@ -5,9 +5,61 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## [1.1.2] - 2025-10-09
|
9
|
+
|
10
|
+
### Fixed
|
11
|
+
|
12
|
+
- **Critical gem execution issue**: Fixed installed gem binaries not executing due to `__FILE__ == $PROGRAM_NAME` check failing when paths differ between gem binary location and RubyGems wrapper script
|
13
|
+
|
14
|
+
## [1.1.1] - 2025-10-09
|
15
|
+
|
16
|
+
### Added
|
17
|
+
|
18
|
+
- **New Twirl subcommand**: Extracted spinner functionality into dedicated `prg twirl` subcommand with 35+ spinner styles
|
19
|
+
- **Enhanced daemon management**: Added `--daemon-as NAME` for named daemon instances creating `/tmp/ruby-progress/NAME.pid`
|
20
|
+
- **Simplified daemon control**: Added `--stop-id NAME` and `--status-id NAME` for controlling named daemons
|
21
|
+
- **Automatic flag implications**: `--stop-success`, `--stop-error`, and `--stop-id` now automatically imply `--stop`
|
22
|
+
- **Global style listing**: Added `prg --list-styles` to show all available styles across all subcommands
|
23
|
+
- **Unified style system**: Replaced ripple's `--rainbow` and `--inverse` flags with `--style` argument supporting `--style rainbow,inverse`
|
24
|
+
- **Integrated case transformation**: Converted `--caps` flag to `--style caps` for consistent style system, supports combinations like `--style caps,inverse`
|
25
|
+
|
26
|
+
### Changed
|
27
|
+
|
28
|
+
- **Refactored CLI architecture**: Three-subcommand structure (ripple, worm, twirl) with consistent daemon management
|
29
|
+
- **Improved option parsing**: Eliminated OptionParser ambiguities by using explicit `--stop-id`/`--status-id` instead of optional arguments
|
30
|
+
- **Updated documentation**: Comprehensive README updates with new examples and cleaner daemon workflow syntax
|
31
|
+
- **Enhanced gemspec**: Updated description from "Two different animated progress indicators" to "Animated progress indicators"
|
32
|
+
|
33
|
+
### Deprecated
|
34
|
+
|
35
|
+
- **Ripple style flags**: `--spinner`, `--rainbow`, `--inverse`, and `--caps` flags deprecated in favor of unified `--style` system (backward compatibility maintained)
|
36
|
+
|
37
|
+
### Fixed
|
38
|
+
|
39
|
+
- **OptionParser conflicts**: Resolved parsing issues with optional arguments that could consume following flags
|
40
|
+
- **Daemon workflow**: Streamlined daemon start/stop workflow eliminating need for redundant flag combinations
|
41
|
+
|
8
42
|
## [1.0.1] - 2025-01-01
|
9
43
|
|
44
|
+
## [1.1.0] - 2025-10-09
|
45
|
+
|
10
46
|
### Added
|
47
|
+
|
48
|
+
- Shared daemon helpers module `RubyProgress::Daemon` for default PID file, control message file, status, and stop logic
|
49
|
+
- Unified daemon flags across ripple and worm: `--daemon`, `--status`, `--stop`, `--pid-file`, `--stop-success`, `--stop-error`, `--stop-checkmark`
|
50
|
+
- Ripple: daemon parity with worm, including clean shutdown on SIGUSR1/TERM/HUP/INT
|
51
|
+
|
52
|
+
### Changed
|
53
|
+
|
54
|
+
- `bin/prg` now delegates status/stop/default PID handling to `RubyProgress::Daemon`
|
55
|
+
- README updated with new daemon usage examples and flag descriptions
|
56
|
+
|
57
|
+
### Deprecated
|
58
|
+
|
59
|
+
- `--stop-pid` remains available but is deprecated in favor of `--stop [--pid-file FILE]`
|
60
|
+
|
61
|
+
### Added
|
62
|
+
|
11
63
|
- Packaged as proper Ruby gem with library structure
|
12
64
|
- Added RSpec test suite with comprehensive coverage
|
13
65
|
- Added Rake tasks for version management and packaging
|
@@ -17,23 +69,33 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
17
69
|
- **Enhanced command-line interface with consistent flag support across both tools**
|
18
70
|
- **Added `RubyProgress::Utils` module with universal terminal control utilities**
|
19
71
|
- **Centralized cursor control, line clearing, and completion message functionality**
|
72
|
+
- **Added daemon mode for background progress indicators in bash scripts**
|
73
|
+
- **Implemented signal-based control (SIGUSR1) for clean daemon shutdown**
|
20
74
|
|
21
75
|
### Changed
|
76
|
+
|
22
77
|
- Moved classes into RubyProgress module
|
23
78
|
- Separated logic into lib/ruby-progress/ structure
|
24
79
|
- Created proper bin/ executables for ripple and worm
|
25
80
|
- Updated README with gem installation and usage instructions
|
26
81
|
|
27
82
|
### Fixed
|
83
|
+
|
28
84
|
- Fixed duplicate error messages in Worm error handling
|
29
85
|
- Improved signal handling and cursor management
|
30
86
|
|
31
87
|
## [1.0.0] - 2025-10-09
|
32
88
|
|
33
89
|
### Added
|
90
|
+
|
34
91
|
- Initial release with two progress indicators:
|
35
92
|
- Ripple: Text ripple animation with 30+ spinner styles, rainbow effects, and command execution
|
36
93
|
- Worm: Unicode wave animation with multiple styles and configurable options
|
37
94
|
- Command-line interfaces for both tools
|
38
95
|
- Support for custom speeds, messages, and styling options
|
39
|
-
- Integration with system commands and process monitoring
|
96
|
+
- Integration with system commands and process monitoring
|
97
|
+
|
98
|
+
[1.1.1]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.1.1
|
99
|
+
[1.1.0]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.1.0
|
100
|
+
[1.0.1]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.0.1
|
101
|
+
[1.0.0]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.0.0
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -6,11 +6,11 @@
|
|
6
6
|
[](https://www.ruby-lang.org/)
|
7
7
|
[](#)
|
8
8
|
|
9
|
-
This repository contains
|
9
|
+
This repository contains three different Ruby progress indicator projects: **Ripple**, **Worm**, and **Twirl**. All provide animated terminal progress indicators with different visual styles and features.
|
10
10
|
|
11
11
|
## Unified Interface
|
12
12
|
|
13
|
-
The gem provides a unified `prg` command that supports
|
13
|
+
The gem provides a unified `prg` command that supports all progress indicators through subcommands:
|
14
14
|
|
15
15
|
```bash
|
16
16
|
# Install the gem
|
@@ -19,45 +19,99 @@ gem install ruby-progress
|
|
19
19
|
# Use worm-style animation
|
20
20
|
prg worm --message "Processing data" --style blocks --checkmark
|
21
21
|
|
22
|
-
# Use ripple-style animation
|
23
|
-
prg ripple "Loading..." --rainbow --speed fast
|
22
|
+
# Use ripple-style animation
|
23
|
+
prg ripple "Loading..." --style rainbow --speed fast
|
24
|
+
|
25
|
+
# Use twirl spinner animation
|
26
|
+
prg twirl --message "Working..." --style dots --speed fast
|
24
27
|
|
25
28
|
# With command execution
|
26
29
|
prg worm --command "sleep 5" --success "Completed!" --error "Failed!" --checkmark
|
27
30
|
prg ripple "Building..." --command "make build" --success "Build complete!" --stdout
|
31
|
+
prg twirl --command "npm install" --message "Installing packages" --style arc
|
28
32
|
```
|
29
33
|
|
30
34
|
### Global Options
|
35
|
+
|
31
36
|
- `prg --help` - Show main help
|
32
37
|
- `prg --version` - Show version info
|
38
|
+
- `prg --list-styles` - Show all available styles for all subcommands
|
33
39
|
- `prg <subcommand> --help` - Show specific subcommand help
|
34
40
|
|
35
41
|
### Common Options (available for both subcommands)
|
42
|
+
|
36
43
|
- `--speed SPEED` - Animation speed (fast/medium/slow or f/m/s)
|
37
44
|
- `--message MESSAGE` - Message to display
|
38
45
|
- `--command COMMAND` - Command to execute during animation
|
39
46
|
- `--success MESSAGE` - Success message after completion
|
40
47
|
- `--error MESSAGE` - Error message on failure
|
41
|
-
- `--checkmark` - Show checkmarks (✅ success, 🛑 failure)
|
48
|
+
- `--checkmark` - Show checkmarks (✅ success, 🛑 failure)
|
42
49
|
- `--stdout` - Output command results to STDOUT
|
43
50
|
|
51
|
+
### Daemon Mode (Background Progress)
|
52
|
+
|
53
|
+
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.
|
54
|
+
|
55
|
+
```bash
|
56
|
+
# Start in background (uses default PID file)
|
57
|
+
prg worm --daemon --message "Working..."
|
58
|
+
|
59
|
+
# Start with a custom name (creates /tmp/ruby-progress/NAME.pid)
|
60
|
+
prg worm --daemon-as mytask --message "Processing data..."
|
61
|
+
|
62
|
+
# ... run your tasks ...
|
63
|
+
|
64
|
+
# Stop with a success message and checkmark (--stop-success implies --stop)
|
65
|
+
prg worm --stop-success "All done" --stop-checkmark
|
66
|
+
|
67
|
+
# Stop a named daemon (--stop-id implies --stop)
|
68
|
+
prg worm --stop-id mytask --stop-success "Task complete!" --stop-checkmark
|
69
|
+
|
70
|
+
# Or stop with an error message and checkmark
|
71
|
+
prg worm --stop-error "Failed during step" --stop-checkmark
|
72
|
+
|
73
|
+
# Check status at any time
|
74
|
+
prg worm --status
|
75
|
+
prg worm --status-id mytask
|
76
|
+
|
77
|
+
# Use a completely custom PID file path
|
78
|
+
prg worm --daemon --pid-file /tmp/custom-progress.pid
|
79
|
+
prg worm --status --pid-file /tmp/custom-progress.pid
|
80
|
+
prg worm --stop-success "Complete" --pid-file /tmp/custom-progress.pid
|
81
|
+
```
|
82
|
+
|
83
|
+
Notes:
|
84
|
+
|
85
|
+
- The CLI detaches itself (double-fork); do not append `&`. This prevents shell job notifications like “job … has ended.” The command returns immediately.
|
86
|
+
- `--stop-success` and `--stop-error` are mutually exclusive; whichever you provide determines the success state and icon if `--stop-checkmark` is set.
|
87
|
+
- The indicator clears its line on shutdown and prints the final message to STDOUT.
|
88
|
+
- `--stop-pid` is still supported for backward compatibility, but `--stop [--pid-file FILE]` is preferred.
|
89
|
+
|
44
90
|
## Table of Contents
|
45
91
|
|
46
92
|
- [Ruby Progress Indicators](#ruby-progress-indicators)
|
47
93
|
- [Unified Interface](#unified-interface)
|
48
94
|
- [Global Options](#global-options)
|
49
95
|
- [Common Options (available for both subcommands)](#common-options-available-for-both-subcommands)
|
96
|
+
- [Daemon Mode (Background Progress)](#daemon-mode-background-progress)
|
97
|
+
- [Table of Contents](#table-of-contents)
|
50
98
|
- [Ripple](#ripple)
|
51
99
|
- [Ripple Features](#ripple-features)
|
52
100
|
- [Ripple Usage](#ripple-usage)
|
53
|
-
- [
|
101
|
+
- [Ripple CLI examples](#ripple-cli-examples)
|
54
102
|
- [Ripple Command Line Options](#ripple-command-line-options)
|
55
103
|
- [Ripple Library Usage](#ripple-library-usage)
|
56
|
-
|
104
|
+
- [Twirl](#twirl)
|
105
|
+
- [Twirl Features](#twirl-features)
|
106
|
+
- [Twirl Usage](#twirl-usage)
|
107
|
+
- [Command Line](#command-line)
|
108
|
+
- [Twirl Command Line Options](#twirl-command-line-options)
|
109
|
+
- [Available Spinner Styles](#available-spinner-styles)
|
57
110
|
- [Worm](#worm)
|
58
111
|
- [Worm Features](#worm-features)
|
59
112
|
- [Worm Usage](#worm-usage)
|
60
113
|
- [Command Line](#command-line-1)
|
114
|
+
- [Daemon mode (background indicator)](#daemon-mode-background-indicator)
|
61
115
|
- [Worm Command Line Options](#worm-command-line-options)
|
62
116
|
- [Worm Library Usage](#worm-library-usage)
|
63
117
|
- [Animation Styles](#animation-styles)
|
@@ -66,6 +120,12 @@ prg ripple "Building..." --command "make build" --success "Build complete!" --st
|
|
66
120
|
- [Geometric](#geometric)
|
67
121
|
- [Requirements](#requirements)
|
68
122
|
- [Installation](#installation)
|
123
|
+
- [As a Gem (Recommended)](#as-a-gem-recommended)
|
124
|
+
- [From Source](#from-source)
|
125
|
+
- [Development](#development)
|
126
|
+
- [Universal Utilities](#universal-utilities)
|
127
|
+
- [Terminal Control](#terminal-control)
|
128
|
+
- [Completion Messages](#completion-messages)
|
69
129
|
- [Contributing](#contributing)
|
70
130
|
- [License](#license)
|
71
131
|
|
@@ -73,50 +133,52 @@ prg ripple "Building..." --command "make build" --success "Build complete!" --st
|
|
73
133
|
|
74
134
|
## Ripple
|
75
135
|
|
76
|
-
Ripple is a sophisticated text animation library that creates ripple effects across text strings in the terminal. It supports various animation modes including bidirectional movement, rainbow colors
|
136
|
+
Ripple is a sophisticated text animation library that creates ripple effects across text strings in the terminal. It supports various animation modes including bidirectional movement, and rainbow colors.
|
77
137
|
|
78
138
|
### Ripple Features
|
79
139
|
|
80
140
|
- **Text ripple animations** with customizable speed and direction
|
81
|
-
- **
|
82
|
-
- **30+ built-in spinner styles** (dots, arrows, blocks, etc.)
|
141
|
+
- **Style system** supporting rainbow colors and inverse highlighting
|
83
142
|
- **Multiple animation formats**: forward-only, bidirectional
|
84
143
|
- **Command execution** with animated progress display
|
85
144
|
- **Custom success/failure messages** with optional checkmarks
|
86
145
|
- **Case transformation modes** (uppercase/lowercase rippling)
|
87
|
-
- **
|
146
|
+
- **Composable styles** using comma-separated values
|
88
147
|
|
89
148
|
### Ripple Usage
|
90
149
|
|
91
|
-
####
|
150
|
+
#### Ripple CLI examples
|
92
151
|
|
93
152
|
```bash
|
94
153
|
# Basic text animation
|
95
|
-
|
154
|
+
prg ripple "Loading..."
|
96
155
|
|
97
|
-
# With options
|
98
|
-
|
156
|
+
# With style options
|
157
|
+
prg ripple "Processing Data" --speed fast --style rainbow --direction bidirectional
|
99
158
|
|
100
|
-
#
|
101
|
-
|
159
|
+
# Multiple styles combined
|
160
|
+
prg ripple "Loading..." --style rainbow,inverse
|
161
|
+
|
162
|
+
# Case transformation mode
|
163
|
+
prg ripple "Processing Text" --style caps,inverse
|
102
164
|
|
103
|
-
#
|
104
|
-
|
165
|
+
# Run a command with progress animation
|
166
|
+
prg ripple "Installing packages" --command "sleep 5" --success "Installation complete!" --checkmark
|
105
167
|
```
|
106
168
|
|
107
169
|
#### Ripple Command Line Options
|
108
170
|
|
109
|
-
| Option | Description
|
110
|
-
| ----------------------- |
|
111
|
-
| `-s, --speed SPEED` | Animation speed (1-10, fast/medium/slow, or f/m/s)
|
112
|
-
| `-
|
113
|
-
| `-m, --message MESSAGE` | Message to display before animation
|
114
|
-
| `--style
|
115
|
-
| `-c, --command COMMAND` | Command to run (optional - runs indefinitely without command)
|
116
|
-
| `--success TEXT` | Text to display on successful completion
|
117
|
-
| `--error TEXT` | Text to display on error
|
118
|
-
| `--checkmark` | Show checkmarks (✅ for success, 🛑 for failure)
|
119
|
-
| `--stdout` | Output captured command result to STDOUT
|
171
|
+
| Option | Description |
|
172
|
+
| ----------------------- | --------------------------------------------------------------- |
|
173
|
+
| `-s, --speed SPEED` | Animation speed (1-10, fast/medium/slow, or f/m/s) |
|
174
|
+
| `-d, --direction DIR` | Animation direction (forward/bidirectional or f/b) |
|
175
|
+
| `-m, --message MESSAGE` | Message to display before animation |
|
176
|
+
| `--style STYLES` | Visual styles (rainbow, inverse, caps - can be comma-separated) |
|
177
|
+
| `-c, --command COMMAND` | Command to run (optional - runs indefinitely without command) |
|
178
|
+
| `--success TEXT` | Text to display on successful completion |
|
179
|
+
| `--error TEXT` | Text to display on error |
|
180
|
+
| `--checkmark` | Show checkmarks (✅ for success, 🛑 for failure) |
|
181
|
+
| `--stdout` | Output captured command result to STDOUT |
|
120
182
|
|
121
183
|
### Ripple Library Usage
|
122
184
|
|
@@ -145,19 +207,80 @@ end
|
|
145
207
|
RubyProgress::Ripple.show_cursor
|
146
208
|
```
|
147
209
|
|
148
|
-
|
210
|
+
---
|
211
|
+
|
212
|
+
## Twirl
|
213
|
+
|
214
|
+
Twirl is a lightweight spinner animation system providing over 35 different spinner styles for terminal progress indication. It's perfect for showing indefinite progress during command execution.
|
149
215
|
|
150
|
-
|
216
|
+
### Twirl Features
|
151
217
|
|
152
|
-
- **
|
153
|
-
- **
|
154
|
-
- **
|
155
|
-
- **
|
156
|
-
- **
|
157
|
-
- **
|
218
|
+
- **35+ spinner styles** including dots, arrows, blocks, and geometric patterns
|
219
|
+
- **Flexible speed control** (1-10 scale or named speeds)
|
220
|
+
- **Command execution** with animated progress display
|
221
|
+
- **Daemon mode** for background progress indication
|
222
|
+
- **Custom success/failure messages** with optional checkmarks
|
223
|
+
- **Signal handling** for graceful shutdown and status updates
|
224
|
+
|
225
|
+
### Twirl Usage
|
226
|
+
|
227
|
+
#### Command Line
|
228
|
+
|
229
|
+
```bash
|
230
|
+
# Basic spinner animation
|
231
|
+
prg twirl --message "Processing..." --style dots
|
232
|
+
|
233
|
+
# With command execution
|
234
|
+
prg twirl --command "npm install" --message "Installing" --style arc
|
235
|
+
|
236
|
+
# Different spinner styles
|
237
|
+
prg twirl --message "Working" --style arrows --speed fast
|
238
|
+
prg twirl --message "Loading" --style blocks --speed slow
|
239
|
+
|
240
|
+
# With success/error handling
|
241
|
+
prg twirl --command "make build" --success "Build complete!" --error "Build failed!" --checkmark
|
242
|
+
|
243
|
+
# Daemon mode for background tasks
|
244
|
+
prg twirl --daemon --message "Background processing" --style geometric
|
245
|
+
prg twirl --daemon-as mytask --message "Named task" --style dots
|
246
|
+
|
247
|
+
# ... do other work ...
|
248
|
+
prg twirl --stop-success "Processing complete!"
|
249
|
+
prg twirl --stop-id mytask --stop-success "Task finished!"
|
250
|
+
```
|
251
|
+
|
252
|
+
#### Twirl Command Line Options
|
253
|
+
|
254
|
+
| Option | Description |
|
255
|
+
| ----------------------- | ------------------------------------------------------------- |
|
256
|
+
| `-s, --speed SPEED` | Animation speed (1-10, fast/medium/slow, or f/m/s) |
|
257
|
+
| `-m, --message MESSAGE` | Message to display before spinner |
|
258
|
+
| `--style STYLE` | Spinner style (see --list-styles for all options) |
|
259
|
+
| `-c, --command COMMAND` | Command to run (optional - runs indefinitely without command) |
|
260
|
+
| `--success TEXT` | Text to display on successful completion |
|
261
|
+
| `--error TEXT` | Text to display on error |
|
262
|
+
| `--checkmark` | Show checkmarks (✅ for success, 🛑 for failure) |
|
263
|
+
| `--stdout` | Output captured command result to STDOUT |
|
264
|
+
| `--daemon` | Run in background daemon mode |
|
265
|
+
| `--daemon-as NAME` | Run in daemon mode with custom name |
|
266
|
+
| `--stop` | Stop a running daemon |
|
267
|
+
| `--stop-id NAME` | Stop daemon by name (implies --stop) |
|
268
|
+
| `--status` | Check daemon status |
|
269
|
+
| `--status-id NAME` | Check daemon status by name |
|
270
|
+
|
271
|
+
### Available Spinner Styles
|
272
|
+
|
273
|
+
Twirl includes over 35 different spinner animations:
|
274
|
+
|
275
|
+
- **Dots**: `dots`, `dots_2`, `dots_3`, `dots_pulse`, `dots_scrolling`
|
276
|
+
- **Arrows**: `arrow`, `arrow_pulse`, `arrows`, `arrows_2`
|
277
|
+
- **Blocks**: `blocks`, `blocks_2`, `toggle`, `toggle_2`
|
278
|
+
- **Lines**: `line`, `line_2`, `pipe`, `vertical_bar`
|
279
|
+
- **Geometric**: `arc`, `circle`, `triangle`, `square_corners`
|
280
|
+
- **Classic**: `classic`, `bounce`, `push`, `flip`
|
158
281
|
- **And many more!**
|
159
282
|
|
160
|
-
Use
|
283
|
+
Use `prg --list-styles` to see all available spinner options.
|
161
284
|
|
162
285
|
---
|
163
286
|
|
@@ -202,6 +325,30 @@ Worm is a clean, Unicode-based progress indicator that creates a ripple effect u
|
|
202
325
|
./worm.rb --command "echo 'Build output'" --success "Build complete!" --checkmark --stdout
|
203
326
|
```
|
204
327
|
|
328
|
+
#### Daemon mode (background indicator)
|
329
|
+
|
330
|
+
Run the worm indicator as a background daemon and stop it later (useful in shell scripts):
|
331
|
+
|
332
|
+
```bash
|
333
|
+
# Start in the background (default PID file: /tmp/ruby-progress/progress.pid)
|
334
|
+
prg worm --daemon
|
335
|
+
|
336
|
+
# ... run your tasks ...
|
337
|
+
|
338
|
+
# Stop using the default PID file
|
339
|
+
prg worm --stop
|
340
|
+
|
341
|
+
# Use a custom PID file
|
342
|
+
prg worm --daemon --pid-file /tmp/custom-worm.pid
|
343
|
+
|
344
|
+
# Stop using the matching custom PID file
|
345
|
+
prg worm --stop --pid-file /tmp/custom-worm.pid
|
346
|
+
```
|
347
|
+
|
348
|
+
Stopping clears the progress line for clean output. You can also provide a success message and checkmark while stopping by sending SIGUSR1; the CLI handles cleanup automatically.
|
349
|
+
|
350
|
+
Note: You don’t need `&` when starting the daemon. The command detaches itself and returns right away, which also avoids “job … has ended” messages from your shell.
|
351
|
+
|
205
352
|
#### Worm Command Line Options
|
206
353
|
|
207
354
|
| Option | Description |
|
@@ -245,16 +392,19 @@ worm.run_with_command
|
|
245
392
|
Worm supports three built-in animation styles:
|
246
393
|
|
247
394
|
#### Circles
|
395
|
+
|
248
396
|
- Baseline: `·` (middle dot)
|
249
397
|
- Midline: `●` (black circle)
|
250
398
|
- Peak: `⬤` (large circle)
|
251
399
|
|
252
400
|
#### Blocks
|
401
|
+
|
253
402
|
- Baseline: `▁` (lower eighth block)
|
254
403
|
- Midline: `▄` (lower half block)
|
255
404
|
- Peak: `█` (full block)
|
256
405
|
|
257
406
|
#### Geometric
|
407
|
+
|
258
408
|
- Baseline: `▪` (small black square)
|
259
409
|
- Midline: `▫` (small white square)
|
260
410
|
- Peak: `■` (large black square)
|
@@ -264,6 +414,7 @@ Worm supports three built-in animation styles:
|
|
264
414
|
## Requirements
|
265
415
|
|
266
416
|
Both projects require:
|
417
|
+
|
267
418
|
- Ruby 2.5 or higher
|
268
419
|
- Terminal with Unicode support (for Worm)
|
269
420
|
- ANSI color support (for Ripple rainbow effects)
|
@@ -280,6 +431,7 @@ gem install ruby-progress
|
|
280
431
|
|
281
432
|
1. Clone this repository
|
282
433
|
2. Build and install:
|
434
|
+
|
283
435
|
```bash
|
284
436
|
bundle install
|
285
437
|
bundle exec rake build
|
@@ -290,10 +442,13 @@ gem install ruby-progress
|
|
290
442
|
|
291
443
|
1. Clone the repository
|
292
444
|
2. Install dependencies:
|
445
|
+
|
293
446
|
```bash
|
294
447
|
bundle install
|
295
448
|
```
|
449
|
+
|
296
450
|
3. Run tests:
|
451
|
+
|
297
452
|
```bash
|
298
453
|
bundle exec rspec
|
299
454
|
```
|
@@ -321,14 +476,14 @@ RubyProgress::Utils.display_completion("Task completed!")
|
|
321
476
|
|
322
477
|
# With success/failure indication and checkmarks
|
323
478
|
RubyProgress::Utils.display_completion(
|
324
|
-
"Build successful!",
|
325
|
-
success: true,
|
479
|
+
"Build successful!",
|
480
|
+
success: true,
|
326
481
|
show_checkmark: true
|
327
482
|
)
|
328
483
|
|
329
484
|
RubyProgress::Utils.display_completion(
|
330
|
-
"Build failed!",
|
331
|
-
success: false,
|
485
|
+
"Build failed!",
|
486
|
+
success: false,
|
332
487
|
show_checkmark: true,
|
333
488
|
output_stream: :stdout # :stdout, :stderr, or :warn (default)
|
334
489
|
)
|
@@ -342,7 +497,7 @@ RubyProgress::Utils.complete_with_clear(
|
|
342
497
|
)
|
343
498
|
```
|
344
499
|
|
345
|
-
These utilities are used internally by
|
500
|
+
These utilities are used internally by Ripple, Worm, and Twirl classes and are available for use in your own applications.
|
346
501
|
|
347
502
|
## Contributing
|
348
503
|
|
@@ -350,4 +505,4 @@ Feel free to submit issues and pull requests to improve either project!
|
|
350
505
|
|
351
506
|
## License
|
352
507
|
|
353
|
-
Both projects are provided as-is for educational and practical use.
|
508
|
+
Both projects are provided as-is for educational and practical use.
|