progressbar 1.8.2 → 1.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +5 -5
  5. data/Rakefile +0 -0
  6. data/lib/progressbar.rb +2 -0
  7. data/lib/ruby-progressbar/base.rb +24 -2
  8. data/lib/ruby-progressbar/calculators/length.rb +14 -3
  9. data/lib/ruby-progressbar/components/time.rb +6 -2
  10. data/lib/ruby-progressbar/format/formatter.rb +1 -1
  11. data/lib/ruby-progressbar/format/molecule.rb +2 -1
  12. data/lib/ruby-progressbar/output.rb +14 -7
  13. data/lib/ruby-progressbar/outputs/null.rb +33 -0
  14. data/lib/ruby-progressbar/progress.rb +4 -0
  15. data/lib/ruby-progressbar/refinements.rb +1 -0
  16. data/lib/ruby-progressbar/refinements/enumerator.rb +25 -0
  17. data/lib/ruby-progressbar/version.rb +1 -1
  18. metadata +31 -70
  19. metadata.gz.sig +0 -0
  20. data/lib/ruby-progressbar/calculators/length_spec.rb +0 -9
  21. data/spec/fixtures/benchmark.rb +0 -28
  22. data/spec/ruby-progressbar/base_spec.rb +0 -949
  23. data/spec/ruby-progressbar/calculators/length_calculator_spec.rb +0 -19
  24. data/spec/ruby-progressbar/calculators/running_average_spec.rb +0 -19
  25. data/spec/ruby-progressbar/components/bar_spec.rb +0 -234
  26. data/spec/ruby-progressbar/components/percentage_spec.rb +0 -9
  27. data/spec/ruby-progressbar/components/rate_spec.rb +0 -9
  28. data/spec/ruby-progressbar/components/throttle_spec.rb +0 -157
  29. data/spec/ruby-progressbar/components/time_spec.rb +0 -307
  30. data/spec/ruby-progressbar/components/title_spec.rb +0 -12
  31. data/spec/ruby-progressbar/format/formatter_spec.rb +0 -9
  32. data/spec/ruby-progressbar/format/molecule_spec.rb +0 -30
  33. data/spec/ruby-progressbar/format/string_spec.rb +0 -9
  34. data/spec/ruby-progressbar/output_spec.rb +0 -7
  35. data/spec/ruby-progressbar/outputs/non_tty_spec.rb +0 -9
  36. data/spec/ruby-progressbar/outputs/tty_spec.rb +0 -9
  37. data/spec/ruby-progressbar/progress_spec.rb +0 -156
  38. data/spec/ruby-progressbar/time_spec.rb +0 -45
  39. data/spec/ruby-progressbar/timer_spec.rb +0 -7
  40. data/spec/spec_helper.rb +0 -6
  41. data/spec/support/time.rb +0 -17
@@ -1,45 +0,0 @@
1
- require 'spec_helper'
2
-
3
- class TimeMockedWithTimecop
4
- def self.now_without_mock_time; end
5
- end
6
-
7
- class TimeMockedWithDelorean
8
- def self.now_without_delorean; end
9
- end
10
-
11
- class TimeMockedWithActiveSupport
12
- def self.__simple_stub__now; end
13
- end
14
-
15
- class UnmockedTime
16
- def self.now; end
17
- end
18
-
19
- class ProgressBar
20
- RSpec.describe Time do
21
- it 'when Time is being mocked by Timecop retrieves the unmocked Timecop time' do
22
- expect(TimeMockedWithTimecop).to receive(:now_without_mock_time).once
23
-
24
- Time.new(TimeMockedWithTimecop).now
25
- end
26
-
27
- it 'when Time is being mocked by Delorean retrieves the unmocked Delorean time' do
28
- expect(TimeMockedWithDelorean).to receive(:now_without_delorean).once
29
-
30
- Time.new(TimeMockedWithDelorean).now
31
- end
32
-
33
- it 'when Time is being mocked by ActiveSupport retrieves the unmocked time' do
34
- expect(TimeMockedWithActiveSupport).to receive(:__simple_stub__now).once
35
-
36
- Time.new(TimeMockedWithActiveSupport).now
37
- end
38
-
39
- it 'when Time is not being mocked will return the actual time' do
40
- expect(UnmockedTime).to receive(:now).once
41
-
42
- Time.new(UnmockedTime).now
43
- end
44
- end
45
- end
@@ -1,7 +0,0 @@
1
- require 'rspectacular'
2
- require 'ruby-progressbar/timer'
3
-
4
- class ProgressBar
5
- RSpec.describe Timer do
6
- end
7
- end
@@ -1,6 +0,0 @@
1
- require 'rspectacular'
2
- require 'warning_filter' if Kernel.respond_to?(:require_relative)
3
-
4
- RSpec.configure do |config|
5
- config.warnings = true
6
- end
@@ -1,17 +0,0 @@
1
- ###
2
- # In our specs, I want to make sure time gets mocked so I can accurately test
3
- # times displayed to the user.
4
- #
5
- class PBTimeTester
6
- def self.now
7
- ::Time.now
8
- end
9
- end
10
-
11
- class ProgressBar
12
- class Time
13
- def initialize(time = ::PBTimeTester)
14
- self.time = time
15
- end
16
- end
17
- end