ruby-progress 1.1.4 → 1.1.8
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/.rubocop.yml +5 -0
- data/.rubocop_todo.yml +201 -0
- data/CHANGELOG.md +74 -0
- data/Gemfile.lock +1 -1
- data/Rakefile +3 -8
- data/bin/prg +361 -101
- data/blog-post.md +174 -0
- data/examples/daemon_demo.rb +1 -1
- data/experimental_terminal.rb +55 -0
- data/lib/ruby-progress/daemon.rb +2 -2
- data/lib/ruby-progress/ripple.rb +11 -40
- data/lib/ruby-progress/utils.rb +15 -3
- data/lib/ruby-progress/version.rb +4 -1
- data/lib/ruby-progress/worm.rb +116 -23
- data/test_daemon_interruption.rb +26 -0
- data/test_daemon_orphan.rb +13 -0
- metadata +8 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b9c54f1a667742fffe32c16ac5d84b26e2e0c9c4ed34492913f61ffb084a44d
|
4
|
+
data.tar.gz: fbf1a1dc3293b68e3ac63e0cc1084bc27a5a99241d56df8843a87ce5f79c59db
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b88f06001f49dac80b6aa735b252ba0760fc123a7b28a5609ef7f7c570f0db43e07a3a104efb4f3a513befa3b7e3113b556847a4b095a4521586587d3d87c7
|
7
|
+
data.tar.gz: 90188577fa0935924cc01ba3e1520a3625fab2c80975cf105413f631e8e5ef8623a160aadd5fb6d03194f88c884be6b4599269296163b4ba4ca66edd0f585d9f
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,201 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2025-10-09 14:47:16 UTC using RuboCop version 1.75.7.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 4
|
10
|
+
# Configuration parameters: EnforcedStyle, AllowedGems, Include.
|
11
|
+
# SupportedStyles: Gemfile, gems.rb, gemspec
|
12
|
+
# Include: **/*.gemspec, **/Gemfile, **/gems.rb
|
13
|
+
Gemspec/DevelopmentDependencies:
|
14
|
+
Exclude:
|
15
|
+
- 'ruby-progress.gemspec'
|
16
|
+
|
17
|
+
# Offense count: 1
|
18
|
+
# This cop supports safe autocorrection (--autocorrect).
|
19
|
+
# Configuration parameters: EnforcedStyle.
|
20
|
+
# SupportedStyles: final_newline, final_blank_line
|
21
|
+
Layout/TrailingEmptyLines:
|
22
|
+
Exclude:
|
23
|
+
- 'test_worm_flags.rb'
|
24
|
+
|
25
|
+
# Offense count: 4
|
26
|
+
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch.
|
27
|
+
Lint/DuplicateBranch:
|
28
|
+
Exclude:
|
29
|
+
- 'bin/prg'
|
30
|
+
- 'lib/ruby-progress/utils.rb'
|
31
|
+
- 'lib/ruby-progress/worm.rb'
|
32
|
+
|
33
|
+
# Offense count: 2
|
34
|
+
# Configuration parameters: AllowComments, AllowEmptyLambdas.
|
35
|
+
Lint/EmptyBlock:
|
36
|
+
Exclude:
|
37
|
+
- 'spec/worm_integration_spec.rb'
|
38
|
+
|
39
|
+
# Offense count: 2
|
40
|
+
# This cop supports safe autocorrection (--autocorrect).
|
41
|
+
Lint/ScriptPermission:
|
42
|
+
Exclude:
|
43
|
+
- 'demo_gem.rb'
|
44
|
+
- 'demo_worm_infinite.rb'
|
45
|
+
|
46
|
+
# Offense count: 1
|
47
|
+
Lint/SelfAssignment:
|
48
|
+
Exclude:
|
49
|
+
- 'lib/ruby-progress/ripple.rb'
|
50
|
+
|
51
|
+
# Offense count: 1
|
52
|
+
# This cop supports safe autocorrection (--autocorrect).
|
53
|
+
# Configuration parameters: AutoCorrect, AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods, NotImplementedExceptions.
|
54
|
+
# NotImplementedExceptions: NotImplementedError
|
55
|
+
Lint/UnusedMethodArgument:
|
56
|
+
Exclude:
|
57
|
+
- 'lib/ruby-progress/worm.rb'
|
58
|
+
|
59
|
+
# Offense count: 23
|
60
|
+
# This cop supports safe autocorrection (--autocorrect).
|
61
|
+
# Configuration parameters: AutoCorrect.
|
62
|
+
Lint/UselessAssignment:
|
63
|
+
Exclude:
|
64
|
+
- 'demo_gem.rb'
|
65
|
+
- 'lib/ruby-progress/worm.rb'
|
66
|
+
- 'spec/cli_integration_spec.rb'
|
67
|
+
|
68
|
+
# Offense count: 20
|
69
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
|
70
|
+
Metrics/AbcSize:
|
71
|
+
Max: 114
|
72
|
+
|
73
|
+
# Offense count: 17
|
74
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
75
|
+
# AllowedMethods: refine
|
76
|
+
Metrics/BlockLength:
|
77
|
+
Max: 109
|
78
|
+
|
79
|
+
# Offense count: 2
|
80
|
+
# Configuration parameters: CountComments, CountAsOne.
|
81
|
+
Metrics/ClassLength:
|
82
|
+
Max: 254
|
83
|
+
|
84
|
+
# Offense count: 12
|
85
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
86
|
+
Metrics/CyclomaticComplexity:
|
87
|
+
Max: 19
|
88
|
+
|
89
|
+
# Offense count: 31
|
90
|
+
# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
|
91
|
+
Metrics/MethodLength:
|
92
|
+
Max: 131
|
93
|
+
|
94
|
+
# Offense count: 3
|
95
|
+
# Configuration parameters: CountComments, CountAsOne.
|
96
|
+
Metrics/ModuleLength:
|
97
|
+
Max: 206
|
98
|
+
|
99
|
+
# Offense count: 10
|
100
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns.
|
101
|
+
Metrics/PerceivedComplexity:
|
102
|
+
Max: 20
|
103
|
+
|
104
|
+
# Offense count: 1
|
105
|
+
# Configuration parameters: ExpectMatchingDefinition, CheckDefinitionPathHierarchy, CheckDefinitionPathHierarchyRoots, Regex, IgnoreExecutableScripts, AllowedAcronyms.
|
106
|
+
# CheckDefinitionPathHierarchyRoots: lib, spec, test, src
|
107
|
+
# AllowedAcronyms: CLI, DSL, ACL, API, ASCII, CPU, CSS, DNS, EOF, GUID, HTML, HTTP, HTTPS, ID, IP, JSON, LHS, QPS, RAM, RHS, RPC, SLA, SMTP, SQL, SSH, TCP, TLS, TTL, UDP, UI, UID, UUID, URI, URL, UTF8, VM, XML, XMPP, XSRF, XSS
|
108
|
+
Naming/FileName:
|
109
|
+
Exclude:
|
110
|
+
- 'Rakefile.rb'
|
111
|
+
- 'lib/ruby-progress.rb'
|
112
|
+
|
113
|
+
# Offense count: 17
|
114
|
+
# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
|
115
|
+
# SupportedStyles: snake_case, normalcase, non_integer
|
116
|
+
# AllowedIdentifiers: TLS1_1, TLS1_2, capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
|
117
|
+
Naming/VariableNumber:
|
118
|
+
Exclude:
|
119
|
+
- 'lib/ruby-progress/ripple.rb'
|
120
|
+
|
121
|
+
# Offense count: 2
|
122
|
+
# Configuration parameters: AllowedConstants.
|
123
|
+
Style/Documentation:
|
124
|
+
Exclude:
|
125
|
+
- 'spec/**/*'
|
126
|
+
- 'test/**/*'
|
127
|
+
- 'lib/ruby-progress.rb'
|
128
|
+
- 'lib/ruby-progress/daemon.rb'
|
129
|
+
|
130
|
+
# Offense count: 4
|
131
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
132
|
+
# Configuration parameters: EnforcedStyle.
|
133
|
+
# SupportedStyles: allowed_in_returns, forbidden
|
134
|
+
Style/DoubleNegation:
|
135
|
+
Exclude:
|
136
|
+
- 'bin/prg'
|
137
|
+
- 'lib/ruby-progress/worm.rb'
|
138
|
+
|
139
|
+
# Offense count: 1
|
140
|
+
# This cop supports safe autocorrection (--autocorrect).
|
141
|
+
# Configuration parameters: AutoCorrect, EnforcedStyle, AllowComments.
|
142
|
+
# SupportedStyles: empty, nil, both
|
143
|
+
Style/EmptyElse:
|
144
|
+
Exclude:
|
145
|
+
- 'lib/ruby-progress/ripple.rb'
|
146
|
+
|
147
|
+
# Offense count: 1
|
148
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
149
|
+
# Configuration parameters: EnforcedStyle.
|
150
|
+
# SupportedStyles: always, always_true, never
|
151
|
+
Style/FrozenStringLiteralComment:
|
152
|
+
Exclude:
|
153
|
+
- '**/*.arb'
|
154
|
+
- 'test_worm_flags.rb'
|
155
|
+
|
156
|
+
# Offense count: 1
|
157
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
158
|
+
# Configuration parameters: AllowedReceivers.
|
159
|
+
# AllowedReceivers: Thread.current
|
160
|
+
Style/HashEachMethods:
|
161
|
+
Exclude:
|
162
|
+
- 'lib/ruby-progress/ripple.rb'
|
163
|
+
|
164
|
+
# Offense count: 1
|
165
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
166
|
+
Style/InfiniteLoop:
|
167
|
+
Exclude:
|
168
|
+
- 'lib/ruby-progress/ripple.rb'
|
169
|
+
|
170
|
+
# Offense count: 2
|
171
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
172
|
+
# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns.
|
173
|
+
# SupportedStyles: predicate, comparison
|
174
|
+
Style/NumericPredicate:
|
175
|
+
Exclude:
|
176
|
+
- 'spec/**/*'
|
177
|
+
- 'bin/prg'
|
178
|
+
- 'lib/ruby-progress/ripple.rb'
|
179
|
+
|
180
|
+
# Offense count: 1
|
181
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
182
|
+
# Configuration parameters: RequireEnglish, EnforcedStyle.
|
183
|
+
# SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
|
184
|
+
Style/SpecialGlobalVars:
|
185
|
+
Exclude:
|
186
|
+
- 'lib/ruby-progress/ripple.rb'
|
187
|
+
|
188
|
+
# Offense count: 6
|
189
|
+
# This cop supports safe autocorrection (--autocorrect).
|
190
|
+
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
|
191
|
+
# SupportedStyles: single_quotes, double_quotes
|
192
|
+
Style/StringLiterals:
|
193
|
+
Exclude:
|
194
|
+
- 'test_worm_flags.rb'
|
195
|
+
|
196
|
+
# Offense count: 3
|
197
|
+
# This cop supports safe autocorrection (--autocorrect).
|
198
|
+
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
|
199
|
+
# URISchemes: http, https
|
200
|
+
Layout/LineLength:
|
201
|
+
Max: 154
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,80 @@ 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.8] - 2025-10-10
|
9
|
+
|
10
|
+
### Added
|
11
|
+
|
12
|
+
- **Intelligent fuzzy matching for twirl styles**: Enhanced twirl style selector with sophisticated pattern matching
|
13
|
+
- Exact matches: Direct style name matching (case-insensitive)
|
14
|
+
- Prefix matches: `ar` matches `arc` instead of `arrow` (shortest match priority)
|
15
|
+
- Character-by-character fuzzy matches: `cls` matches `classic` (sequential character matching)
|
16
|
+
- Substring fallback: Comprehensive matching for partial inputs
|
17
|
+
- Works dynamically against all available indicator styles in `RubyProgress::INDICATORS`
|
18
|
+
|
19
|
+
### Improved
|
20
|
+
|
21
|
+
- **Worm message spacing**: Enhanced visual formatting for worm animations
|
22
|
+
- Automatic space insertion between `--message` text and animation
|
23
|
+
- Clean formatting: `"Loading data ●··●·"` instead of `"Loading data●··●·"`
|
24
|
+
- No extra spacing when no message is provided
|
25
|
+
- Consistent behavior across all worm animation methods (standard, daemon, aggressive clearing)
|
26
|
+
|
27
|
+
### Technical
|
28
|
+
|
29
|
+
- **Enhanced test coverage**: Added comprehensive fuzzy matching test suite for twirl styles
|
30
|
+
- 13 test cases covering exact, prefix, fuzzy, and edge case scenarios
|
31
|
+
- Validation of shortest match priority and character-order matching
|
32
|
+
- Integration with existing comprehensive test coverage (maintained at 70.47%)
|
33
|
+
|
34
|
+
## [1.1.7] - 2025-10-10
|
35
|
+
|
36
|
+
### Added
|
37
|
+
|
38
|
+
- **Visual style previews**: Added `--show-styles` flag to all subcommands showing visual previews of animation styles
|
39
|
+
- Global `prg --show-styles` displays all styles for all subcommands with visual examples
|
40
|
+
- Subcommand-specific `prg <subcommand> --show-styles` shows only relevant styles
|
41
|
+
- Ripple styles show "Progress" text with actual color/effect rendering
|
42
|
+
- Worm styles display wave patterns like `··●⬤●··` for circles style
|
43
|
+
- Twirl styles show spinner character sequences like `◜ ◠ ◝ ◞ ◡ ◟` for arc style
|
44
|
+
- **Process management**: Added `--stop-all` flag for comprehensive process control
|
45
|
+
- Global `prg --stop-all` stops all prg processes across all subcommands
|
46
|
+
- Subcommand-specific `prg <subcommand> --stop-all` stops only processes for that animation type
|
47
|
+
- Smart process detection excludes current process to prevent self-termination
|
48
|
+
- Graceful termination using TERM signal for proper cleanup
|
49
|
+
|
50
|
+
### Improved
|
51
|
+
|
52
|
+
- **Error handling**: Replaced verbose Ruby stack traces with clean, user-friendly error messages
|
53
|
+
- Invalid command-line options now show simple "Invalid option: --flag-name" messages
|
54
|
+
- Each error includes appropriate usage information and help guidance
|
55
|
+
- Consistent error format across all subcommands (ripple, worm, twirl)
|
56
|
+
- **Style discovery**: Enhanced distinction between `--list-styles` (simple name lists) and `--show-styles` (visual previews)
|
57
|
+
- **Silent process management**: All `--stop` and `--stop-all` commands now operate silently
|
58
|
+
- No status messages or confirmation output for cleaner automation
|
59
|
+
- Exit code 0 when processes found and stopped successfully
|
60
|
+
- Exit code 1 when no processes found to stop
|
61
|
+
- **Terminal output separation**: Moved all animations to stderr for proper stream handling
|
62
|
+
- Animations and progress indicators use stderr (status information)
|
63
|
+
- Application output remains on stdout (program data)
|
64
|
+
- Fixes daemon mode output interruption issues
|
65
|
+
- **Enhanced process cleanup**: Improved daemon process termination reliability
|
66
|
+
- Uses TERM signal first for graceful shutdown, followed by KILL if needed
|
67
|
+
- Comprehensive process detection and cleanup across all subcommands
|
68
|
+
- Better handling of orphaned processes
|
69
|
+
- **Version display**: Enhanced `--version` output to show individual subcommand versions
|
70
|
+
- Main version: `prg version 1.1.7`
|
71
|
+
- Component versions: `ripple (v1.0.5)`, `worm (v1.0.2)`, `twirl (v1.0.0)`
|
72
|
+
- Enables tracking of individual component changes
|
73
|
+
|
74
|
+
### Technical
|
75
|
+
|
76
|
+
- **Test coverage**: Significantly improved test coverage from ~60% to 74.53%
|
77
|
+
- Added comprehensive error handling tests
|
78
|
+
- Enhanced daemon lifecycle testing
|
79
|
+
- Improved edge case coverage for all animation types
|
80
|
+
- Added version constant validation tests
|
81
|
+
|
8
82
|
## [1.1.4] - 2025-10-09
|
9
83
|
|
10
84
|
### Fixed
|
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -7,7 +7,7 @@ require 'rubocop/rake_task'
|
|
7
7
|
RSpec::Core::RakeTask.new(:spec)
|
8
8
|
RuboCop::RakeTask.new
|
9
9
|
|
10
|
-
task default:
|
10
|
+
task default: [:spec]
|
11
11
|
|
12
12
|
# Used by markdown tasks
|
13
13
|
MARKDOWN_GLOB = ['**/*.md'].freeze
|
@@ -34,7 +34,6 @@ task :bump_major do
|
|
34
34
|
bump_version(:major)
|
35
35
|
end
|
36
36
|
|
37
|
-
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
38
37
|
def bump_version(type)
|
39
38
|
require_relative 'lib/ruby-progress/version'
|
40
39
|
version_parts = RubyProgress::VERSION.split('.').map(&:to_i)
|
@@ -61,8 +60,6 @@ def bump_version(type)
|
|
61
60
|
|
62
61
|
puts "Version bumped from #{RubyProgress::VERSION} to #{new_version}"
|
63
62
|
end
|
64
|
-
# rubocop:enable Metrics/MethodLength, Metrics/AbcSize
|
65
|
-
|
66
63
|
# Package management
|
67
64
|
desc 'Clean up generated files'
|
68
65
|
task :clobber do
|
@@ -89,7 +86,6 @@ task :test_binaries do
|
|
89
86
|
end
|
90
87
|
|
91
88
|
# Markdown lint/fix tasks (no external deps)
|
92
|
-
# rubocop:disable Metrics/BlockLength
|
93
89
|
namespace :markdown do
|
94
90
|
def markdown_files
|
95
91
|
Dir.glob(MARKDOWN_GLOB).reject do |p|
|
@@ -105,7 +101,7 @@ namespace :markdown do
|
|
105
101
|
!!(line =~ /^\s*```|^\s*~~~/)
|
106
102
|
end
|
107
103
|
|
108
|
-
# rubocop:disable Metrics/
|
104
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
109
105
|
def format_markdown(content)
|
110
106
|
lines = content.split("\n", -1)
|
111
107
|
out = []
|
@@ -164,7 +160,7 @@ namespace :markdown do
|
|
164
160
|
out << '' if (last = out.last) && !last.empty?
|
165
161
|
out.join("\n")
|
166
162
|
end
|
167
|
-
# rubocop:enable Metrics/
|
163
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
|
168
164
|
|
169
165
|
desc 'Lint markdown (reports files that would be changed)'
|
170
166
|
task :lint do
|
@@ -202,4 +198,3 @@ namespace :markdown do
|
|
202
198
|
end
|
203
199
|
end
|
204
200
|
end
|
205
|
-
# rubocop:enable Metrics/BlockLength
|