ruby-progress 1.1.9 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4de0dfea35a1a0f412f7a23cee8dfb160d892299f97b5767ca35b4c49c1b9b03
4
- data.tar.gz: e05a3a36f172ac991df40fc4505dfc279b713df97e903d4f2a89722de1cf1351
3
+ metadata.gz: 446ecad2fd85e194293130a638b9e986270c5849ad5cd8a65733b5c2f01198df
4
+ data.tar.gz: 35686adf5664171676333a89d48f3f296dcc03751636eea49711a3885ea86d4d
5
5
  SHA512:
6
- metadata.gz: 04d7b2506163351012ca4bd30eb4d6e1da55a80b4097bce58e0b8233520a6504798ceefa99d98e745a529808027fead28135d139153767d964bae0405c2fb0b2
7
- data.tar.gz: 3f8165ca4dcb8facf61a91508776e92afd53e99a1b2e013b0735870392dc0bff1abae61d94a60c26e4e58b602813bc1a5f670c9a1b10f0de7cc0dcac6aa41c77
6
+ metadata.gz: d5cd10f336fae3e523e00c70bc9939f6b4162b1b9473424e1c481b0aa9f077b5f0e08037bb53f96f23f5d07a38a0ac5c72947daf90d545127736f002db692c77
7
+ data.tar.gz: 86f820e4b75c810e45801f1a214d219f7103e386e4c53bd733eb22a231a3162900b0b011c566f2d134b0a78e06947d33ddf1e2f9fea5c8a35552f56bc4b1f7e0
data/CHANGELOG.md CHANGED
@@ -1,157 +1,101 @@
1
- # Changelog
1
+
2
+ # CHANGELOG
2
3
 
3
4
  All notable changes to this project will be documented in this file.
4
5
 
5
6
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
7
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
8
 
8
- ## [1.1.9] - 2025-10-10
9
-
10
- ### Fixed
11
-
12
- - **Worm animation line clearing**: Resolved issue where completion messages appeared alongside animation characters
13
- - Fixed stream mismatch where animations used stderr but completion messages used stdout
14
- - Implemented atomic operation combining line clearing and message output on stderr
15
- - Ensured clean line clearing for all scenarios (success, error, no completion message)
16
- - Updated tests to match new stderr-based completion message output
17
- - Clean output format: animation disappears completely before completion message appears
18
-
19
- ### Technical
20
-
21
- - **Stream consistency**: All worm animation output (including completion messages) now uses stderr consistently
22
- - **Enhanced completion message display**: Single atomic stderr operation prevents race conditions between line clearing and message display
23
-
24
- ## [1.1.8] - 2025-10-10
9
+ ## 1.2.3 - 2025-10-11
25
10
 
26
11
  ### Added
27
12
 
28
- - **Intelligent fuzzy matching for twirl styles**: Enhanced twirl style selector with sophisticated pattern matching
29
- - Exact matches: Direct style name matching (case-insensitive)
30
- - Prefix matches: `ar` matches `arc` instead of `arrow` (shortest match priority)
31
- - Character-by-character fuzzy matches: `cls` matches `classic` (sequential character matching)
32
- - Substring fallback: Comprehensive matching for partial inputs
33
- - Works dynamically against all available indicator styles in `RubyProgress::INDICATORS`
13
+ - Dedicated `fill` shim: added `bin/fill` that delegates to `prg fill`.
34
14
 
35
- ### Improved
36
-
37
- - **Worm message spacing**: Enhanced visual formatting for worm animations
38
- - Automatic space insertion between `--message` text and animation
39
- - Clean formatting: `"Loading data ●··●·"` instead of `"Loading data●··●·"`
40
- - No extra spacing when no message is provided
41
- - Consistent behavior across all worm animation methods (standard, daemon, aggressive clearing)
42
-
43
- ### Technical
44
-
45
- - **Enhanced test coverage**: Added comprehensive fuzzy matching test suite for twirl styles
46
- - 13 test cases covering exact, prefix, fuzzy, and edge case scenarios
47
- - Validation of shortest match priority and character-order matching
48
- - Integration with existing comprehensive test coverage (maintained at 70.47%)
15
+ ### Changed
49
16
 
50
- ## [1.1.7] - 2025-10-10
17
+ - Version bumps: prg 1.2.2 → 1.2.3, fill 1.0.0 → 1.0.1
51
18
 
52
- ### Added
53
-
54
- - **Visual style previews**: Added `--show-styles` flag to all subcommands showing visual previews of animation styles
55
- - Global `prg --show-styles` displays all styles for all subcommands with visual examples
56
- - Subcommand-specific `prg <subcommand> --show-styles` shows only relevant styles
57
- - Ripple styles show "Progress" text with actual color/effect rendering
58
- - Worm styles display wave patterns like `··●⬤●··` for circles style
59
- - Twirl styles show spinner character sequences like `◜ ◠ ◝ ◞ ◡ ◟` for arc style
60
- - **Process management**: Added `--stop-all` flag for comprehensive process control
61
- - Global `prg --stop-all` stops all prg processes across all subcommands
62
- - Subcommand-specific `prg <subcommand> --stop-all` stops only processes for that animation type
63
- - Smart process detection excludes current process to prevent self-termination
64
- - Graceful termination using TERM signal for proper cleanup
19
+ ## 1.2.2 - 2025-10-11
65
20
 
66
21
  ### Improved
67
22
 
68
- - **Error handling**: Replaced verbose Ruby stack traces with clean, user-friendly error messages
69
- - Invalid command-line options now show simple "Invalid option: --flag-name" messages
70
- - Each error includes appropriate usage information and help guidance
71
- - Consistent error format across all subcommands (ripple, worm, twirl)
72
- - **Style discovery**: Enhanced distinction between `--list-styles` (simple name lists) and `--show-styles` (visual previews)
73
- - **Silent process management**: All `--stop` and `--stop-all` commands now operate silently
74
- - No status messages or confirmation output for cleaner automation
75
- - Exit code 0 when processes found and stopped successfully
76
- - Exit code 1 when no processes found to stop
77
- - **Terminal output separation**: Moved all animations to stderr for proper stream handling
78
- - Animations and progress indicators use stderr (status information)
79
- - Application output remains on stdout (program data)
80
- - Fixes daemon mode output interruption issues
81
- - **Enhanced process cleanup**: Improved daemon process termination reliability
82
- - Uses TERM signal first for graceful shutdown, followed by KILL if needed
83
- - Comprehensive process detection and cleanup across all subcommands
84
- - Better handling of orphaned processes
85
- - **Version display**: Enhanced `--version` output to show individual subcommand versions
86
- - Main version: `prg version 1.1.7`
87
- - Component versions: `ripple (v1.0.5)`, `worm (v1.0.2)`, `twirl (v1.0.0)`
88
- - Enables tracking of individual component changes
23
+ - Demo script enhancements: updated quick demo with better visual examples.
89
24
 
90
25
  ### Technical
91
26
 
92
- - **Test coverage**: Significantly improved test coverage from ~60% to 74.53%
93
- - Added comprehensive error handling tests
94
- - Enhanced daemon lifecycle testing
95
- - Improved edge case coverage for all animation types
96
- - Added version constant validation tests
97
-
98
- ## [1.1.4] - 2025-10-09
99
-
100
- ### Fixed
27
+ - Version alignment: synchronized demo script version display with actual gem version.
101
28
 
102
- - **Worm default message behavior**: Removed default "Processing" message from worm subcommand when no `--message` is provided for consistent behavior across all progress indicators
103
- - **Development environment**: Fixed `bin/prg` to use local library files instead of installed gem versions during development
29
+ ## 1.2.4 - 2025-10-12
104
30
 
105
- ## [1.1.3] - 2025-10-09
31
+ ### Added
106
32
 
107
- ### Fixed
33
+ - Small bug fixes and test stability improvements:
34
+ - Ensured SimpleCov finalization runs reliably across Ruby versions during tests.
35
+ - Minor CLI help text clarifications and version constant alignment.
108
36
 
109
- - **Twirl spinner animation**: Fixed spinner freezing during command execution by ensuring continuous animation loop
110
- - **Default message behavior**: Removed default "Processing" message when no `--message` is provided - now shows only spinner
111
- - **Daemon termination output**: Removed verbose "Stop signal sent to process" message for cleaner daemon workflows
37
+ ### Changed
112
38
 
113
- ## [1.1.2] - 2025-10-09
39
+ - Bumped gem version and synchronized component version constants where applicable.
40
+ - Messages now display cleanly at the beginning of a new line
41
+ - Affects all three commands: ripple, worm, and twirl
42
+ - Resolves issue where completion messages appeared mid-line after animation ended
43
+ - Improved professional appearance of CLI output
114
44
 
115
- ### Fixed
45
+ Technical
116
46
 
117
- - **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
47
+ - **Enhanced display_completion method**: Added proper line clearing and cursor positioning
48
+ - Uses `re[2K` sequence followed by clean message display
49
+ - Updated test expectations to match new output format
50
+ - Maintains backward compatibility with existing functionality
118
51
 
119
- ## [1.1.1] - 2025-10-09
52
+ ## 1.2.0 - 2025-10-11
120
53
 
121
54
  ### Added
122
55
 
123
- - **New Twirl subcommand**: Extracted spinner functionality into dedicated `prg twirl` subcommand with 35+ spinner styles
124
- - **Enhanced daemon management**: Added `--daemon-as NAME` for named daemon instances creating `/tmp/ruby-progress/NAME.pid`
125
- - **Simplified daemon control**: Added `--stop-id NAME` and `--status-id NAME` for controlling named daemons
126
- - **Automatic flag implications**: `--stop-success`, `--stop-error`, and `--stop-id` now automatically imply `--stop`
127
- - **Global style listing**: Added `prg --list-styles` to show all available styles across all subcommands
128
- - **Unified style system**: Replaced ripple's `--rainbow` and `--inverse` flags with `--style` argument supporting `--style rainbow,inverse`
129
- - **Integrated case transformation**: Converted `--caps` flag to `--style caps` for consistent style system, supports combinations like `--style caps,inverse`
130
-
131
- ### Changed
132
-
133
- - **Refactored CLI architecture**: Three-subcommand structure (ripple, worm, twirl) with consistent daemon management
134
- - **Improved option parsing**: Eliminated OptionParser ambiguities by using explicit `--stop-id`/`--status-id` instead of optional arguments
135
- - **Updated documentation**: Comprehensive README updates with new examples and cleaner daemon workflow syntax
136
- - **Enhanced gemspec**: Updated description from "Two different animated progress indicators" to "Animated progress indicators"
137
-
138
- ### Deprecated
139
-
140
- - **Ripple style flags**: `--spinner`, `--rainbow`, `--inverse`, and `--caps` flags deprecated in favor of unified `--style` system (backward compatibility maintained)
56
+ - **--ends flag for all commands**: New universal option to add start/end characters around animations
57
+ - Accepts even-length strings split in half for start and end characters
58
+ - Works across all three commands: ripple, worm, and twirl
59
+ - Examples: `--ends "[]"` → `[animation]`, `--ends "<<>>"` `<<animation>>`
60
+ - Multi-byte character support for emojis: `--ends "🎯🎪"` `🎯animation🎪`
61
+ - Graceful fallback for invalid input (odd-length strings)
62
+
63
+ - **Comprehensive test coverage for new features**: Added extensive test suites
64
+ - Direction control tests: Forward-only vs bidirectional animation behavior
65
+ - Custom style tests: ASCII, Unicode, emoji, and mixed character pattern validation
66
+ - CLI integration tests: End-to-end testing for all new command-line options
67
+ - Ends functionality tests: Multi-byte character handling, error cases, help documentation
68
+ - Total: 58 new test examples covering all edge cases
69
+
70
+ - **Worm direction control**: Fine-grained animation movement control
71
+ - `--direction forward` (or `-d f`): Animation moves only forward, resets at end
72
+ - `--direction bidirectional` (or `-d b`): Default back-and-forth movement
73
+ - Compatible with all worm styles including custom patterns
74
+
75
+ - **Worm custom styles**: User-defined 3-character animation patterns
76
+ - Format: `--style custom=abc` where `abc` defines baseline, midline, peak characters
77
+ - ASCII support: `--style custom=_-=` → `___-=___`
78
+ - Unicode support: `--style custom=▫▪■` → geometric patterns
79
+ - Emoji support: `--style custom=🟦🟨🟥` → colorful animations
80
+ - Mixed characters: `--style custom=.🟡*` → combined ASCII and emoji
81
+ - Proper multi-byte character counting for accurate 3-character validation
82
+ - **Ripple style flags**: `--spinner`, `--rainbow`, `--inverse`, and `--caps` flags deprecated in favor of unified `--style` system (backward
83
+ compatibility maintained)
141
84
 
142
85
  ### Fixed
143
86
 
144
87
  - **OptionParser conflicts**: Resolved parsing issues with optional arguments that could consume following flags
145
88
  - **Daemon workflow**: Streamlined daemon start/stop workflow eliminating need for redundant flag combinations
146
89
 
147
- ## [1.0.1] - 2025-01-01
90
+ ## 1.0.1 - 2025-01-01
148
91
 
149
- ## [1.1.0] - 2025-10-09
92
+ ## 1.1.0 - 2025-10-09
150
93
 
151
94
  ### Added
152
95
 
153
96
  - Shared daemon helpers module `RubyProgress::Daemon` for default PID file, control message file, status, and stop logic
154
- - Unified daemon flags across ripple and worm: `--daemon`, `--status`, `--stop`, `--pid-file`, `--stop-success`, `--stop-error`, `--stop-checkmark`
97
+ - Unified daemon flags across ripple and worm: `--daemon`, `--status`, `--stop`, `--pid-file`, `--stop-success`, `--stop-error`,
98
+ `--stop-checkmark`
155
99
  - Ripple: daemon parity with worm, including clean shutdown on SIGUSR1/TERM/HUP/INT
156
100
 
157
101
  ### Changed
@@ -159,7 +103,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
159
103
  - `bin/prg` now delegates status/stop/default PID handling to `RubyProgress::Daemon`
160
104
  - README updated with new daemon usage examples and flag descriptions
161
105
 
162
- ### Deprecated
106
+ Deprecated
163
107
 
164
108
  - `--stop-pid` remains available but is deprecated in favor of `--stop [--pid-file FILE]`
165
109
 
@@ -189,18 +133,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
189
133
  - Fixed duplicate error messages in Worm error handling
190
134
  - Improved signal handling and cursor management
191
135
 
192
- ## [1.0.0] - 2025-10-09
136
+ ## 1.0.0 - 2025-10-09
193
137
 
194
138
  ### Added
195
139
 
196
140
  - Initial release with two progress indicators:
197
- - Ripple: Text ripple animation with 30+ spinner styles, rainbow effects, and command execution
198
- - Worm: Unicode wave animation with multiple styles and configurable options
141
+ - Ripple: Text ripple animation with 30+ spinner styles, rainbow effects, and command execution
142
+ - Worm: Unicode wave animation with multiple styles and configurable options
199
143
  - Command-line interfaces for both tools
200
144
  - Support for custom speeds, messages, and styling options
201
145
  - Integration with system commands and process monitoring
202
146
 
203
- [1.1.1]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.1.1
204
- [1.1.0]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.1.0
205
- [1.0.1]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.0.1
206
- [1.0.0]: https://github.com/ttscoff/ruby-progress/releases/tag/v1.0.0
147
+
data/DEMO_SCRIPTS.md ADDED
@@ -0,0 +1,162 @@
1
+ # Ruby Progress Gem - Demo Scripts
2
+
3
+ This directory contains three demo scripts designed to showcase the ruby-progress gem's features for different purposes.
4
+
5
+ ## Demo Scripts Overview
6
+
7
+ ### 1. `demo_screencast.rb` - Full Feature Demo
8
+ **Purpose**: Comprehensive screencast demonstration with narration pauses
9
+ **Duration**: ~10-15 minutes
10
+ **Best for**: Complete feature showcase, video recordings, presentations
11
+
12
+ **Features demonstrated**:
13
+ - All three commands (ripple, worm, twirl)
14
+ - Built-in styles and variations
15
+ - Universal --ends flag (NEW in v1.2.0)
16
+ - Worm direction control (NEW in v1.2.0)
17
+ - Custom worm styles (NEW in v1.2.0)
18
+ - Error handling and success messages
19
+ - Feature combinations
20
+
21
+ **Usage**:
22
+ ```bash
23
+ ./demo_screencast.rb
24
+ # or
25
+ ruby demo_screencast.rb
26
+ ```
27
+
28
+ ### 2. `quick_demo.rb` - Essential Features
29
+ **Purpose**: Quick demonstration of key features
30
+ **Duration**: ~3-5 minutes
31
+ **Best for**: Quick testing, feature highlights, social media clips
32
+
33
+ **Features demonstrated**:
34
+ - Universal --ends flag examples
35
+ - Custom worm styles with emoji
36
+ - Direction control
37
+ - Error handling
38
+ - Feature combinations
39
+
40
+ **Usage**:
41
+ ```bash
42
+ ./quick_demo.rb
43
+ # or
44
+ ruby quick_demo.rb
45
+ ```
46
+
47
+ ### 3. `readme_demo.rb` - Documentation Examples
48
+ **Purpose**: Clean examples perfect for README and documentation
49
+ **Duration**: Variable (can run sections independently)
50
+ **Best for**: Creating documentation examples, README updates, tutorials
51
+
52
+ **Features demonstrated**:
53
+ - Basic usage examples
54
+ - Style variations
55
+ - New v1.2.0 features
56
+ - Advanced features
57
+
58
+ **Usage**:
59
+ ```bash
60
+ # Run all examples
61
+ ./readme_demo.rb
62
+
63
+ # Run specific sections
64
+ ./readme_demo.rb basic # Basic usage only
65
+ ./readme_demo.rb styles # Style variations only
66
+ ./readme_demo.rb new # New v1.2.0 features only
67
+ ./readme_demo.rb advanced # Advanced features only
68
+ ```
69
+
70
+ ## Customization Tips
71
+
72
+ ### Adjusting Sleep Times
73
+ All scripts use `--command 'sleep X'` to simulate work. You can adjust timing by modifying the sleep values:
74
+
75
+ - **Ripple**: 3-4 seconds shows the expanding animation well
76
+ - **Worm**: 4-6 seconds demonstrates the full progress bar cycle
77
+ - **Twirl**: 2-3 seconds is sufficient for spinner animations
78
+
79
+ ### Adding Your Own Examples
80
+ To add new examples, follow this pattern:
81
+
82
+ ```ruby
83
+ def your_demo_method
84
+ puts "Description of what this demonstrates:"
85
+ run_cmd("command --option 'value' --command 'sleep X' --success 'Message!'")
86
+ puts "\n"
87
+ end
88
+ ```
89
+
90
+ ### Modifying Pauses
91
+ In `demo_screencast.rb`, you can adjust pause durations:
92
+
93
+ ```ruby
94
+ pause_for_narration(seconds) # For narration breaks
95
+ pause_between_demos(seconds) # Between demonstrations
96
+ ```
97
+
98
+ ## Example Commands Demonstrated
99
+
100
+ ### Universal --ends Flag
101
+ ```bash
102
+ prg ripple 'Loading...' --ends '[]' --command 'sleep 3' --success 'Complete!'
103
+ prg worm --length 10 --ends '<<>>' --command 'sleep 4' --success 'Finished!'
104
+ prg twirl --ends '🎯🎪' --command 'sleep 2' --success 'Done!'
105
+ ```
106
+
107
+ ### Custom Worm Styles
108
+ ```bash
109
+ prg worm --length 10 --style custom=_-= --command 'sleep 4' --success 'ASCII style!'
110
+ prg worm --length 10 --style custom=▫▪■ --command 'sleep 4' --success 'Unicode blocks!'
111
+ prg worm --length 10 --style custom=🟦🟨🟥 --command 'sleep 4' --success 'Emoji colors!'
112
+ ```
113
+
114
+ ### Direction Control
115
+ ```bash
116
+ prg worm --length 10 --direction forward --command 'sleep 5' --success 'Forward only!'
117
+ prg worm --length 10 --direction bidirectional --command 'sleep 5' --success 'Back and forth!'
118
+ ```
119
+
120
+ ### Feature Combinations
121
+ ```bash
122
+ prg worm --length 10 --style custom=.🟡* --direction forward --ends '【】' --command 'sleep 4' --success 'All features!'
123
+ ```
124
+
125
+ ## Recording Tips
126
+
127
+ ### For Screencasts
128
+ 1. Use `demo_screencast.rb` for full feature coverage
129
+ 2. Terminal window should be at least 80 characters wide
130
+ 3. Consider using a terminal recorder like `asciinema`
131
+ 4. The script includes natural pause points for narration
132
+
133
+ ### For Quick Demos
134
+ 1. Use `quick_demo.rb` for fast demonstrations
135
+ 2. Perfect for social media clips or quick feature highlights
136
+ 3. Focuses on the most visually impressive features
137
+
138
+ ### For Documentation
139
+ 1. Use `readme_demo.rb` to generate clean command-line examples
140
+ 2. Output can be copied directly into documentation
141
+ 3. Sectioned approach allows focused demonstrations
142
+
143
+ ## Troubleshooting
144
+
145
+ ### Common Issues
146
+ - **"Please provide text to animate"**: Some commands require a message argument
147
+ - **"Invalid option"**: Check option names (some flags changed between versions)
148
+ - **Animation not visible**: Ensure terminal supports the characters being used
149
+
150
+ ### Solutions
151
+ - Always include a message for ripple: `prg ripple 'Loading...'`
152
+ - Check `prg --help` for current option names
153
+ - Test with basic ASCII characters first, then add Unicode/emoji
154
+
155
+ ## Script Dependencies
156
+
157
+ All scripts require:
158
+ - Ruby (tested with Ruby 3.4.4)
159
+ - The ruby-progress gem (installed locally or via `gem install ruby-progress`)
160
+ - Terminal with Unicode support (for emoji examples)
161
+
162
+ The scripts automatically detect the gem location and use the local development version if run from the gem directory.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-progress (1.1.9)
4
+ ruby-progress (1.2.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/