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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +59 -169
- data/DEMO_SCRIPTS.md +162 -0
- data/Gemfile.lock +1 -1
- data/README.md +116 -53
- data/Rakefile +7 -0
- data/bin/fill +10 -0
- data/bin/prg +50 -1033
- data/demo_screencast.rb +296 -0
- data/experimental_terminal.rb +7 -0
- data/lib/ruby-progress/cli/fill_options.rb +193 -0
- data/lib/ruby-progress/cli/ripple_cli.rb +150 -0
- data/lib/ruby-progress/cli/ripple_options.rb +148 -0
- data/lib/ruby-progress/cli/twirl_cli.rb +173 -0
- data/lib/ruby-progress/cli/twirl_options.rb +136 -0
- data/lib/ruby-progress/cli/twirl_runner.rb +130 -0
- data/lib/ruby-progress/cli/twirl_spinner.rb +78 -0
- data/lib/ruby-progress/cli/worm_cli.rb +75 -0
- data/lib/ruby-progress/cli/worm_options.rb +156 -0
- data/lib/ruby-progress/cli/worm_runner.rb +260 -0
- data/lib/ruby-progress/fill.rb +211 -0
- data/lib/ruby-progress/fill_cli.rb +219 -0
- data/lib/ruby-progress/utils.rb +16 -2
- data/lib/ruby-progress/version.rb +8 -4
- data/lib/ruby-progress/worm.rb +2 -177
- data/lib/ruby-progress.rb +1 -0
- data/quick_demo.rb +134 -0
- data/readme_demo.rb +128 -0
- data/ruby-progress.gemspec +40 -0
- data/scripts/run_matrix_mise.fish +41 -0
- data/test_daemon_interruption.rb +2 -0
- data/test_daemon_orphan.rb +1 -0
- metadata +21 -1
data/readme_demo.rb
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
# README Demo Script - Ruby Progress Gem
|
|
5
|
+
# =====================================
|
|
6
|
+
#
|
|
7
|
+
# ReadmeDemo: demos and examples intended for inclusion in the README
|
|
8
|
+
# and other documentation. Keeps examples compact and easy to run.
|
|
9
|
+
class ReadmeDemo
|
|
10
|
+
def initialize
|
|
11
|
+
@gem_path = File.expand_path('bin/prg', __dir__)
|
|
12
|
+
@lib_path = File.expand_path('lib', __dir__)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def run_all_demos
|
|
16
|
+
puts 'Ruby Progress Gem - README Examples'
|
|
17
|
+
puts '==================================='
|
|
18
|
+
puts
|
|
19
|
+
|
|
20
|
+
basic_examples
|
|
21
|
+
style_examples
|
|
22
|
+
new_features_examples
|
|
23
|
+
advanced_examples
|
|
24
|
+
|
|
25
|
+
puts "\nAll examples completed!"
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def basic_examples
|
|
29
|
+
section('Basic Usage Examples')
|
|
30
|
+
|
|
31
|
+
demo('Basic ripple animation',
|
|
32
|
+
"ripple --command 'sleep 3' --success 'Download complete!'")
|
|
33
|
+
|
|
34
|
+
demo('Basic worm progress bar',
|
|
35
|
+
"worm --length 10 --command 'sleep 4' --success 'Processing finished!'")
|
|
36
|
+
|
|
37
|
+
demo('Basic spinner',
|
|
38
|
+
"twirl --command 'sleep 2' --success 'Task completed!'")
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def style_examples
|
|
42
|
+
section('Style Variations')
|
|
43
|
+
|
|
44
|
+
demo('Ripple pulse style',
|
|
45
|
+
"ripple --style pulse --command 'sleep 3' --success 'Pulsing!'")
|
|
46
|
+
|
|
47
|
+
demo('Worm with emoji style',
|
|
48
|
+
"worm --length 10 --style emoji --command 'sleep 3' --success 'Colorful! 🌈'")
|
|
49
|
+
|
|
50
|
+
demo('Classic spinner',
|
|
51
|
+
"twirl --style classic --command 'sleep 2' --success 'Spinning!'")
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
def new_features_examples
|
|
55
|
+
section('New v1.2.0 Features')
|
|
56
|
+
|
|
57
|
+
demo('Universal --ends flag with brackets',
|
|
58
|
+
"ripple --ends '[]' --command 'sleep 3' --success 'Framed!'")
|
|
59
|
+
|
|
60
|
+
demo('Worm with custom style',
|
|
61
|
+
"worm --length 10 --style custom=▫▪■ --command 'sleep 3' --success 'Custom blocks!'")
|
|
62
|
+
|
|
63
|
+
demo('Forward-only worm direction',
|
|
64
|
+
"worm --length 10 --direction forward --command 'sleep 4' --success 'Always forward!'")
|
|
65
|
+
|
|
66
|
+
demo('Emoji decoration',
|
|
67
|
+
"twirl --ends '🎯🎪' --command 'sleep 2' --success 'Decorated!'")
|
|
68
|
+
|
|
69
|
+
demo('Ultimate combination',
|
|
70
|
+
"worm --length 10 --style custom=🟦🟨🟥 --direction forward --ends '《》' --command 'sleep 4' --success 'All features!'")
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def advanced_examples
|
|
74
|
+
section('Advanced Features')
|
|
75
|
+
|
|
76
|
+
demo('Error handling',
|
|
77
|
+
"worm --length 10 --command 'sleep 2 && exit 1' --error 'Task failed!' --fail-icon")
|
|
78
|
+
|
|
79
|
+
demo('Silent completion',
|
|
80
|
+
"ripple --command 'sleep 2'")
|
|
81
|
+
|
|
82
|
+
demo('Custom success icon',
|
|
83
|
+
"twirl --command 'sleep 2' --success 'Backup done' --icon '✓'")
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
private
|
|
87
|
+
|
|
88
|
+
def section(title)
|
|
89
|
+
puts "\n#{'-' * 50}"
|
|
90
|
+
puts " #{title}"
|
|
91
|
+
puts "#{'-' * 50}\n\n"
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
def demo(description, command)
|
|
95
|
+
puts "#{description}:"
|
|
96
|
+
puts "$ prg #{command}"
|
|
97
|
+
puts
|
|
98
|
+
|
|
99
|
+
full_command = "ruby -I #{@lib_path} #{@gem_path} #{command}"
|
|
100
|
+
system(full_command)
|
|
101
|
+
|
|
102
|
+
puts "\n"
|
|
103
|
+
sleep(1) # Brief pause between demos
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Command line interface
|
|
108
|
+
if __FILE__ == $PROGRAM_NAME
|
|
109
|
+
demo = ReadmeDemo.new
|
|
110
|
+
|
|
111
|
+
if ARGV.empty?
|
|
112
|
+
demo.run_all_demos
|
|
113
|
+
else
|
|
114
|
+
case ARGV[0]
|
|
115
|
+
when 'basic'
|
|
116
|
+
demo.basic_examples
|
|
117
|
+
when 'styles'
|
|
118
|
+
demo.style_examples
|
|
119
|
+
when 'new'
|
|
120
|
+
demo.new_features_examples
|
|
121
|
+
when 'advanced'
|
|
122
|
+
demo.advanced_examples
|
|
123
|
+
else
|
|
124
|
+
puts "Usage: #{$PROGRAM_NAME} [basic|styles|new|advanced]"
|
|
125
|
+
puts " #{$PROGRAM_NAME} # run all demos"
|
|
126
|
+
end
|
|
127
|
+
end
|
|
128
|
+
end
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'lib/ruby-progress/version'
|
|
4
|
+
|
|
5
|
+
Gem::Specification.new do |spec|
|
|
6
|
+
spec.name = 'ruby-progress'
|
|
7
|
+
spec.version = RubyProgress::VERSION
|
|
8
|
+
spec.authors = ['Brett Terpstra']
|
|
9
|
+
spec.email = ['me@brettterpstra.com']
|
|
10
|
+
|
|
11
|
+
spec.summary = 'Animated terminal progress indicators'
|
|
12
|
+
spec.description = 'Animated progress indicators for Ruby: Ripple (text ripple effects), Worm (Unicode wave animations), and Twirl (spinner indicators)'
|
|
13
|
+
spec.homepage = 'https://github.com/ttscoff/ruby-progress'
|
|
14
|
+
spec.license = 'MIT'
|
|
15
|
+
spec.required_ruby_version = '>= 2.5.0'
|
|
16
|
+
|
|
17
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
18
|
+
spec.metadata['source_code_uri'] = spec.homepage
|
|
19
|
+
spec.metadata['changelog_uri'] = "#{spec.homepage}/blob/main/CHANGELOG.md"
|
|
20
|
+
|
|
21
|
+
# Specify which files should be added to the gem when it is released.
|
|
22
|
+
spec.files = Dir.chdir(__dir__) do
|
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
|
24
|
+
(f == __FILE__) || f.match(%r{\A(?:(?:test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
spec.bindir = 'bin'
|
|
28
|
+
spec.executables = %w[prg ripple worm twirl fill]
|
|
29
|
+
spec.require_paths = ['lib']
|
|
30
|
+
|
|
31
|
+
# Runtime dependencies
|
|
32
|
+
# None required - uses only standard library
|
|
33
|
+
|
|
34
|
+
# Development dependencies
|
|
35
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
|
36
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
|
37
|
+
spec.add_development_dependency 'rubocop', '~> 1.21'
|
|
38
|
+
spec.add_development_dependency 'simplecov', '~> 0.21'
|
|
39
|
+
spec.metadata['rubygems_mfa_required'] = 'true'
|
|
40
|
+
end
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env fish
|
|
2
|
+
# Runs the test matrix using mise-managed Ruby installs and writes per-version logs.
|
|
3
|
+
# Safe for fish shell; intended to be run from project root.
|
|
4
|
+
|
|
5
|
+
set -l VERSIONS 2.7.8 3.0.6 3.1.4 3.2.0 3.3.0
|
|
6
|
+
set -l REPO_ROOT (pwd)
|
|
7
|
+
|
|
8
|
+
for v in $VERSIONS
|
|
9
|
+
set -l bin_dir $HOME/.local/share/mise/installs/ruby/$v/bin
|
|
10
|
+
if test -x "$bin_dir/ruby"
|
|
11
|
+
echo "\n=== Ruby $v ==="
|
|
12
|
+
echo "ruby: " (printf "%s" ("$bin_dir/ruby" -v))
|
|
13
|
+
echo "Installing bundler for Ruby $v (if needed)" >&2
|
|
14
|
+
# install bundler quietly; ignore errors from this step so we can try bundle install next
|
|
15
|
+
"$bin_dir/gem" install bundler --no-document >/dev/null 2>&1 || true
|
|
16
|
+
echo "Running bundle install for Ruby $v" >&2
|
|
17
|
+
# Use --quiet to reduce log noise, but keep failures visible
|
|
18
|
+
if test -x "$bin_dir/bundle"
|
|
19
|
+
"$bin_dir/bundle" install --quiet
|
|
20
|
+
else
|
|
21
|
+
# try using bundler directly
|
|
22
|
+
"$bin_dir/ruby" -S gem install bundler --no-document
|
|
23
|
+
"$bin_dir/ruby" -S bundle install --quiet
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
echo "Running rspec for Ruby $v (output -> rspec-$v.log)" >&2
|
|
27
|
+
# Capture exit status per-version; write logs
|
|
28
|
+
# run rspec and tee output to a per-version log
|
|
29
|
+
"$bin_dir/bundle" exec rspec --format documentation 2>&1 | tee rspec-$v.log
|
|
30
|
+
if test $status -ne 0
|
|
31
|
+
echo "rspec failed for Ruby $v (exit $status)" >&2
|
|
32
|
+
# stop the matrix if a version fails
|
|
33
|
+
exit $status
|
|
34
|
+
end
|
|
35
|
+
else
|
|
36
|
+
echo "Ruby $v not found at $bin_dir, skipping"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
echo "Matrix complete. Logs:"
|
|
41
|
+
ls -1 rspec-*.log 2>/dev/null || echo "No logs found"
|
data/test_daemon_interruption.rb
CHANGED
data/test_daemon_orphan.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ruby-progress
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Brett Terpstra
|
|
@@ -70,6 +70,7 @@ description: 'Animated progress indicators for Ruby: Ripple (text ripple effects
|
|
|
70
70
|
email:
|
|
71
71
|
- me@brettterpstra.com
|
|
72
72
|
executables:
|
|
73
|
+
- fill
|
|
73
74
|
- prg
|
|
74
75
|
- ripple
|
|
75
76
|
- twirl
|
|
@@ -83,28 +84,47 @@ files:
|
|
|
83
84
|
- ".rubocop.yml"
|
|
84
85
|
- ".rubocop_todo.yml"
|
|
85
86
|
- CHANGELOG.md
|
|
87
|
+
- DEMO_SCRIPTS.md
|
|
86
88
|
- Gemfile
|
|
87
89
|
- Gemfile.lock
|
|
88
90
|
- LICENSE
|
|
89
91
|
- README.md
|
|
90
92
|
- Rakefile
|
|
93
|
+
- bin/fill
|
|
91
94
|
- bin/prg
|
|
92
95
|
- bin/ripple
|
|
93
96
|
- bin/twirl
|
|
94
97
|
- bin/worm
|
|
95
98
|
- blog-post.md
|
|
96
99
|
- demo_gem.rb
|
|
100
|
+
- demo_screencast.rb
|
|
97
101
|
- demo_worm_infinite.rb
|
|
98
102
|
- examples/bash_daemon_demo.sh
|
|
99
103
|
- examples/daemon_demo.rb
|
|
100
104
|
- examples/utils_demo.rb
|
|
101
105
|
- experimental_terminal.rb
|
|
102
106
|
- lib/ruby-progress.rb
|
|
107
|
+
- lib/ruby-progress/cli/fill_options.rb
|
|
108
|
+
- lib/ruby-progress/cli/ripple_cli.rb
|
|
109
|
+
- lib/ruby-progress/cli/ripple_options.rb
|
|
110
|
+
- lib/ruby-progress/cli/twirl_cli.rb
|
|
111
|
+
- lib/ruby-progress/cli/twirl_options.rb
|
|
112
|
+
- lib/ruby-progress/cli/twirl_runner.rb
|
|
113
|
+
- lib/ruby-progress/cli/twirl_spinner.rb
|
|
114
|
+
- lib/ruby-progress/cli/worm_cli.rb
|
|
115
|
+
- lib/ruby-progress/cli/worm_options.rb
|
|
116
|
+
- lib/ruby-progress/cli/worm_runner.rb
|
|
103
117
|
- lib/ruby-progress/daemon.rb
|
|
118
|
+
- lib/ruby-progress/fill.rb
|
|
119
|
+
- lib/ruby-progress/fill_cli.rb
|
|
104
120
|
- lib/ruby-progress/ripple.rb
|
|
105
121
|
- lib/ruby-progress/utils.rb
|
|
106
122
|
- lib/ruby-progress/version.rb
|
|
107
123
|
- lib/ruby-progress/worm.rb
|
|
124
|
+
- quick_demo.rb
|
|
125
|
+
- readme_demo.rb
|
|
126
|
+
- ruby-progress.gemspec
|
|
127
|
+
- scripts/run_matrix_mise.fish
|
|
108
128
|
- test_daemon_interruption.rb
|
|
109
129
|
- test_daemon_orphan.rb
|
|
110
130
|
- test_worm_flags.rb
|