ruby-progress 1.1.4 → 1.1.9

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: 599c6e45e09421994859e63461afbe8291cc1e0580ea04f5ec6cce11ce24af6c
4
- data.tar.gz: '08cd819f0e15c121ae19af452a12aa666c68ecf1a63f448c657e8f09499a9b23'
3
+ metadata.gz: 4de0dfea35a1a0f412f7a23cee8dfb160d892299f97b5767ca35b4c49c1b9b03
4
+ data.tar.gz: e05a3a36f172ac991df40fc4505dfc279b713df97e903d4f2a89722de1cf1351
5
5
  SHA512:
6
- metadata.gz: 934d646d83e178445ca8d4f6c0deac2df5e7a4f3c24c6397f871ee6c2d6af1d01a15d28ddf5fc35b24f9c072a22da05a5133edb6256117647fbd662ad971b75c
7
- data.tar.gz: b703ffa90548a16e8e71b35ec6f12550937aab9be5f46d3f7a4e1754d64fb7dac75104128bf5db4d95cc911b9285a383d20897d2d313c2a5d77d981e70f0c71b
6
+ metadata.gz: 04d7b2506163351012ca4bd30eb4d6e1da55a80b4097bce58e0b8233520a6504798ceefa99d98e745a529808027fead28135d139153767d964bae0405c2fb0b2
7
+ data.tar.gz: 3f8165ca4dcb8facf61a91508776e92afd53e99a1b2e013b0735870392dc0bff1abae61d94a60c26e4e58b602813bc1a5f670c9a1b10f0de7cc0dcac6aa41c77
data/.rubocop.yml ADDED
@@ -0,0 +1,5 @@
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ AllCops:
4
+ NewCops: enable
5
+ SuggestExtensions: false
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,96 @@ 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.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
25
+
26
+ ### Added
27
+
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`
34
+
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%)
49
+
50
+ ## [1.1.7] - 2025-10-10
51
+
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
65
+
66
+ ### Improved
67
+
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
89
+
90
+ ### Technical
91
+
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
+
8
98
  ## [1.1.4] - 2025-10-09
9
99
 
10
100
  ### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-progress (1.1.4)
4
+ ruby-progress (1.1.9)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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: %i[spec rubocop]
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/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
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/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
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