tty-progressbar 0.14.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +98 -21
- data/LICENSE.txt +1 -1
- data/README.md +511 -119
- data/lib/tty-progressbar.rb +2 -2
- data/lib/tty/progressbar.rb +216 -87
- data/lib/tty/progressbar/configuration.rb +124 -16
- data/lib/tty/progressbar/converter.rb +16 -19
- data/lib/tty/progressbar/formats.rb +120 -0
- data/lib/tty/progressbar/formatter.rb +33 -38
- data/lib/tty/progressbar/formatter/bar.rb +87 -29
- data/lib/tty/progressbar/formatter/byte_rate.rb +6 -20
- data/lib/tty/progressbar/formatter/current.rb +4 -19
- data/lib/tty/progressbar/formatter/current_byte.rb +9 -17
- data/lib/tty/progressbar/formatter/elapsed.rb +9 -18
- data/lib/tty/progressbar/formatter/estimated.rb +14 -18
- data/lib/tty/progressbar/formatter/estimated_time.rb +37 -0
- data/lib/tty/progressbar/formatter/mean_byte.rb +6 -20
- data/lib/tty/progressbar/formatter/mean_rate.rb +6 -20
- data/lib/tty/progressbar/formatter/percent.rb +10 -16
- data/lib/tty/progressbar/formatter/rate.rb +5 -19
- data/lib/tty/progressbar/formatter/total.rb +10 -16
- data/lib/tty/progressbar/formatter/total_byte.rb +14 -18
- data/lib/tty/progressbar/formatters.rb +53 -0
- data/lib/tty/progressbar/meter.rb +2 -2
- data/lib/tty/progressbar/multi.rb +69 -23
- data/lib/tty/progressbar/pipeline.rb +13 -6
- data/lib/tty/progressbar/timer.rb +89 -0
- data/lib/tty/progressbar/version.rb +3 -1
- metadata +65 -151
- data/.codeclimate.yml +0 -11
- data/.gitignore +0 -14
- data/.rspec +0 -3
- data/.travis.yml +0 -25
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -14
- data/Rakefile +0 -8
- data/appveyor.yml +0 -21
- data/examples/color.rb +0 -18
- data/examples/failure.rb +0 -12
- data/examples/iterator.rb +0 -5
- data/examples/lazy.rb +0 -6
- data/examples/multi/main_bar.rb +0 -13
- data/examples/multi/simple.rb +0 -13
- data/examples/simple.rb +0 -7
- data/examples/slow_process.rb +0 -29
- data/examples/speed.rb +0 -11
- data/examples/threaded.rb +0 -14
- data/examples/tokens.rb +0 -12
- data/spec/spec_helper.rb +0 -50
- data/spec/unit/advance_spec.rb +0 -25
- data/spec/unit/clear_spec.rb +0 -17
- data/spec/unit/complete_spec.rb +0 -16
- data/spec/unit/converter/to_bytes_spec.rb +0 -47
- data/spec/unit/converter/to_seconds_spec.rb +0 -15
- data/spec/unit/converter/to_time_spec.rb +0 -19
- data/spec/unit/custom_formatter_spec.rb +0 -26
- data/spec/unit/custom_token_spec.rb +0 -14
- data/spec/unit/events_spec.rb +0 -33
- data/spec/unit/finish_spec.rb +0 -15
- data/spec/unit/formatter/bar_spec.rb +0 -16
- data/spec/unit/formatter/byte_rate_spec.rb +0 -32
- data/spec/unit/formatter/current_byte_spec.rb +0 -16
- data/spec/unit/formatter/current_spec.rb +0 -14
- data/spec/unit/formatter/elapsed_spec.rb +0 -58
- data/spec/unit/formatter/estimated_spec.rb +0 -27
- data/spec/unit/formatter/mean_byte_spec.rb +0 -32
- data/spec/unit/formatter/mean_rate_spec.rb +0 -31
- data/spec/unit/formatter/percent_spec.rb +0 -16
- data/spec/unit/formatter/rate_spec.rb +0 -31
- data/spec/unit/formatter/total_byte_spec.rb +0 -16
- data/spec/unit/formatter/total_spec.rb +0 -16
- data/spec/unit/frequency_spec.rb +0 -27
- data/spec/unit/head_spec.rb +0 -32
- data/spec/unit/hide_cursor_spec.rb +0 -27
- data/spec/unit/inspect_spec.rb +0 -11
- data/spec/unit/iterate_spec.rb +0 -79
- data/spec/unit/log_spec.rb +0 -29
- data/spec/unit/meter_spec.rb +0 -70
- data/spec/unit/multi/advance_spec.rb +0 -123
- data/spec/unit/multi/events_spec.rb +0 -115
- data/spec/unit/multi/finish_spec.rb +0 -41
- data/spec/unit/multi/line_inset_spec.rb +0 -65
- data/spec/unit/multi/register_spec.rb +0 -35
- data/spec/unit/multi/stop_spec.rb +0 -15
- data/spec/unit/new_spec.rb +0 -66
- data/spec/unit/pipeline_spec.rb +0 -19
- data/spec/unit/ratio_spec.rb +0 -31
- data/spec/unit/reset_spec.rb +0 -31
- data/spec/unit/resize_spec.rb +0 -35
- data/spec/unit/set_current_spec.rb +0 -43
- data/spec/unit/start_spec.rb +0 -14
- data/spec/unit/stop_spec.rb +0 -19
- data/spec/unit/update_spec.rb +0 -22
- data/spec/unit/width_spec.rb +0 -21
- data/tasks/console.rake +0 -9
- data/tasks/coverage.rake +0 -9
- data/tasks/spec.rake +0 -27
- data/tty-progressbar.gemspec +0 -30
data/spec/unit/width_spec.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
RSpec.describe TTY::ProgressBar, '#width' do
|
2
|
-
let(:output) { StringIO.new('', 'w+') }
|
3
|
-
|
4
|
-
it "handles width exceeding terminal width" do
|
5
|
-
progress = TTY::ProgressBar.new "[:bar]" do |config|
|
6
|
-
config.output = output
|
7
|
-
config.total = 5
|
8
|
-
config.width = 1024
|
9
|
-
end
|
10
|
-
allow(TTY::Screen).to receive(:width).and_return(20)
|
11
|
-
5.times { progress.advance }
|
12
|
-
output.rewind
|
13
|
-
expect(output.read).to eq([
|
14
|
-
"\e[1G[==== ]",
|
15
|
-
"\e[1G[======= ]",
|
16
|
-
"\e[1G[=========== ]",
|
17
|
-
"\e[1G[============== ]",
|
18
|
-
"\e[1G[==================]\n"
|
19
|
-
].join)
|
20
|
-
end
|
21
|
-
end
|
data/tasks/console.rake
DELETED
data/tasks/coverage.rake
DELETED
data/tasks/spec.rake
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
begin
|
2
|
-
require 'rspec/core/rake_task'
|
3
|
-
|
4
|
-
desc 'Run all specs'
|
5
|
-
RSpec::Core::RakeTask.new(:spec) do |task|
|
6
|
-
task.pattern = 'spec/{unit,integration}{,/*/**}/*_spec.rb'
|
7
|
-
end
|
8
|
-
|
9
|
-
namespace :spec do
|
10
|
-
desc 'Run unit specs'
|
11
|
-
RSpec::Core::RakeTask.new(:unit) do |task|
|
12
|
-
task.pattern = 'spec/unit{,/*/**}/*_spec.rb'
|
13
|
-
end
|
14
|
-
|
15
|
-
desc 'Run integration specs'
|
16
|
-
RSpec::Core::RakeTask.new(:integration) do |task|
|
17
|
-
task.pattern = 'spec/integration{,/*/**}/*_spec.rb'
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
rescue LoadError
|
22
|
-
%w[spec spec:unit spec:integration].each do |name|
|
23
|
-
task name do
|
24
|
-
$stderr.puts "In order to run #{name}, do `gem install rspec`"
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
data/tty-progressbar.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'tty/progressbar/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "tty-progressbar"
|
8
|
-
spec.version = TTY::ProgressBar::VERSION
|
9
|
-
spec.authors = ["Piotr Murach"]
|
10
|
-
spec.email = [""]
|
11
|
-
spec.summary = %q{A flexible progress bars drawing in terminal emulators.}
|
12
|
-
spec.description = %q{A flexible progress bars drawing in terminal emulators.}
|
13
|
-
spec.homepage = "https://piotrmurach.github.io/tty/"
|
14
|
-
spec.license = "MIT"
|
15
|
-
|
16
|
-
spec.files = `git ls-files -z`.split("\x0")
|
17
|
-
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
-
spec.require_paths = ["lib"]
|
20
|
-
|
21
|
-
spec.required_ruby_version = '>= 2.0.0'
|
22
|
-
|
23
|
-
spec.add_dependency "tty-cursor", '~> 0.5.0'
|
24
|
-
spec.add_dependency "tty-screen", '~> 0.6.4'
|
25
|
-
|
26
|
-
spec.add_development_dependency 'bundler', '>= 1.5.0', '< 2.0'
|
27
|
-
spec.add_development_dependency 'rspec', '~> 3.1'
|
28
|
-
spec.add_development_dependency 'timecop', '~> 0.9.1'
|
29
|
-
spec.add_development_dependency 'rake'
|
30
|
-
end
|