From a120f4dd806c7b5b3fadae7224e965e3097e6839 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Mon, 6 Mar 2023 21:47:33 +0000 Subject: [PATCH] brew vendor-gems: commit updates. --- .../Homebrew/vendor/bundle/bundler/setup.rb | 2 +- .../calculators/smoothed_average.rb | 9 --- .../lib/ruby-progressbar/refinements.rb | 1 - .../refinements/enumerator.rb | 23 ------ .../lib/ruby-progressbar/version.rb | 3 - .../lib/ruby-progressbar.rb | 0 .../lib/ruby-progressbar/base.rb | 43 ++++++++++- .../ruby-progressbar/calculators/length.rb | 0 .../lib/ruby-progressbar/components/bar.rb | 0 .../ruby-progressbar/components/percentage.rb | 0 .../lib/ruby-progressbar/components/rate.rb | 0 .../lib/ruby-progressbar/components/time.rb | 12 ++-- .../lib/ruby-progressbar/components/title.rb | 0 .../errors/invalid_progress_error.rb | 0 .../lib/ruby-progressbar/format/formatter.rb | 0 .../lib/ruby-progressbar/format/molecule.rb | 0 .../lib/ruby-progressbar/format/string.rb | 0 .../lib/ruby-progressbar/output.rb | 0 .../lib/ruby-progressbar/outputs/non_tty.rb | 0 .../lib/ruby-progressbar/outputs/null.rb | 0 .../lib/ruby-progressbar/outputs/tty.rb | 0 .../lib/ruby-progressbar/progress.rb | 38 +++------- .../lib/ruby-progressbar/projector.rb | 14 ++++ .../projectors/smoothed_average.rb | 71 +++++++++++++++++++ .../lib/ruby-progressbar/refinements.rb | 1 + .../refinements/progress_enumerator.rb | 28 ++++++++ .../lib/ruby-progressbar/throttle.rb | 0 .../lib/ruby-progressbar/time.rb | 0 .../lib/ruby-progressbar/timer.rb | 0 .../lib/ruby-progressbar/version.rb | 3 + 30 files changed, 174 insertions(+), 74 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/calculators/smoothed_average.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements/enumerator.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/version.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/base.rb (74%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/calculators/length.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/components/bar.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/components/percentage.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/components/rate.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/components/time.rb (87%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/components/title.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/errors/invalid_progress_error.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/format/formatter.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/format/molecule.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/format/string.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/output.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/outputs/non_tty.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/outputs/null.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/outputs/tty.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/progress.rb (59%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projector.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projectors/smoothed_average.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements.rb create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements/progress_enumerator.rb rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/throttle.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/time.rb (100%) rename Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/{ruby-progressbar-1.12.0 => ruby-progressbar-1.13.0}/lib/ruby-progressbar/timer.rb (100%) create mode 100644 Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/version.rb diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 41804f3ce0..8ec7acfcd5 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -101,7 +101,7 @@ $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec-sorbet-1.9.1/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rspec_junit_formatter-0.6.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-ast-1.27.0/lib") -$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.12.0/lib") +$:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/ruby-progressbar-1.13.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/unicode-display_width-2.4.2/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-1.47.0/lib") $:.unshift File.expand_path("#{__dir__}/../#{RUBY_ENGINE}/#{Gem.ruby_api_version}/gems/rubocop-capybara-2.17.1/lib") diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/calculators/smoothed_average.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/calculators/smoothed_average.rb deleted file mode 100644 index 5e74a1759e..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/calculators/smoothed_average.rb +++ /dev/null @@ -1,9 +0,0 @@ -class ProgressBar -module Calculators -class SmoothedAverage - def self.calculate(current_average, new_value_to_average, rate) - (new_value_to_average * (1.0 - rate)) + (current_average * rate) - end -end -end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements.rb deleted file mode 100644 index 4fc0d04300..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements.rb +++ /dev/null @@ -1 +0,0 @@ -require 'ruby-progressbar/refinements/enumerator' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements/enumerator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements/enumerator.rb deleted file mode 100644 index 70dae62800..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/refinements/enumerator.rb +++ /dev/null @@ -1,23 +0,0 @@ -class ProgressBar -module Refinements -module Enumerator -refine ::Enumerator do - def with_progressbar(options = {}, &block) - chain = ::Enumerator.new do |yielder| - progress_bar = ProgressBar.create(options.merge(:starting_at => 0, :total => size)) - - each do |*args| - yielder.yield(*args).tap do - progress_bar.increment - end - end - end - - return chain unless block - - chain.each(&block) - end -end -end -end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/version.rb deleted file mode 100644 index a9b47f0081..0000000000 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/version.rb +++ /dev/null @@ -1,3 +0,0 @@ -class ProgressBar - VERSION = '1.12.0'.freeze -end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/base.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/base.rb similarity index 74% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/base.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/base.rb index a2fdf920a4..0fab585e94 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/base.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/base.rb @@ -10,12 +10,29 @@ require 'ruby-progressbar/format/string' require 'ruby-progressbar/outputs/non_tty' require 'ruby-progressbar/outputs/tty' require 'ruby-progressbar/progress' +require 'ruby-progressbar/projector' require 'ruby-progressbar/timer' class ProgressBar class Base extend Forwardable + # rubocop:disable Layout/HeredocIndentation + SMOOTHING_DEPRECATION_WARNING = <<-HEREDOC.tr("\n", ' ') +WARNING: Passing the 'smoothing' option is deprecated and will be removed +in version 2.0. Please pass { projector: { type: 'smoothing', strength: 0.x }}. +For more information on why this change is happening, visit +https://github.com/jfelchner/ruby-progressbar/wiki/Upgrading + HEREDOC + + RUNNING_AVERAGE_RATE_DEPRECATION_WARNING = <<-HEREDOC.tr("\n", ' ') +WARNING: Passing the 'running_average_rate' option is deprecated and will be removed +in version 2.0. Please pass { projector: { type: 'smoothing', strength: 0.x }}. +For more information on why this change is happening, visit +https://github.com/jfelchner/ruby-progressbar/wiki/Upgrading + HEREDOC + # rubocop:enable Layout/HeredocIndentation + def_delegators :output, :clear, :log, @@ -26,15 +43,34 @@ class Base :total def initialize(options = {}) # rubocop:disable Metrics/AbcSize + options[:projector] ||= {} + self.autostart = options.fetch(:autostart, true) self.autofinish = options.fetch(:autofinish, true) self.finished = false self.timer = Timer.new(options) + projector_opts = if options[:projector].any? + options[:projector] + elsif options[:smoothing] + warn SMOOTHING_DEPRECATION_WARNING + + { :strength => options[:smoothing] } + elsif options[:running_average_rate] + warn RUNNING_AVERAGE_RATE_DEPRECATION_WARNING + + { :strength => options[:smoothing] } + else + {} + end + self.projector = Projector. + from_type(options[:projector][:type]). + new(projector_opts) self.progressable = Progress.new(options) - options = options.merge(:progress => progressable, - :timer => timer) + options = options.merge(:progress => progressable, + :projector => projector, + :timer => timer) self.title_component = Components::Title.new(options) self.bar_component = Components::Bar.new(options) @@ -79,6 +115,7 @@ class Base output.with_refresh do self.finished = false progressable.reset + projector.reset timer.reset end end @@ -174,6 +211,7 @@ class Base protected attr_accessor :output, + :projector, :timer, :progressable, :title_component, @@ -188,6 +226,7 @@ class Base def update_progress(*args) output.with_refresh do progressable.__send__(*args) + projector.__send__(*args) timer.stop if finished? end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/calculators/length.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/calculators/length.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/calculators/length.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/calculators/length.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/bar.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/bar.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/bar.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/bar.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/percentage.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/percentage.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/percentage.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/percentage.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/rate.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/rate.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/rate.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/rate.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/time.rb similarity index 87% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/time.rb index 98751f5798..9eb0652d12 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/time.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/time.rb @@ -19,8 +19,9 @@ class Time }.freeze def initialize(options = {}) - self.timer = options[:timer] - self.progress = options[:progress] + self.timer = options[:timer] + self.progress = options[:progress] + self.projector = options[:projector] end def estimated_with_label(out_of_bounds_time_format = nil) @@ -57,7 +58,8 @@ class Time protected attr_accessor :timer, - :progress + :progress, + :projector private @@ -90,9 +92,9 @@ class Time end def estimated_seconds_remaining - return if progress.unknown? || progress.none? || timer.stopped? || timer.reset? + return if progress.unknown? || projector.none? || progress.none? || timer.stopped? || timer.reset? - (timer.elapsed_seconds * ((progress.total / progress.running_average) - 1)).round + (timer.elapsed_seconds * ((progress.total / projector.projection) - 1)).round end end end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/title.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/title.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/components/title.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/components/title.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/errors/invalid_progress_error.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/errors/invalid_progress_error.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/errors/invalid_progress_error.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/errors/invalid_progress_error.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/format/formatter.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/format/formatter.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/formatter.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/format/molecule.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/molecule.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/format/molecule.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/molecule.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/format/string.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/string.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/format/string.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/format/string.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/output.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/output.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/output.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/output.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/outputs/non_tty.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/outputs/non_tty.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/outputs/non_tty.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/outputs/non_tty.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/outputs/null.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/outputs/null.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/outputs/null.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/outputs/null.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/outputs/tty.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/outputs/tty.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/outputs/tty.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/outputs/tty.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/progress.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/progress.rb similarity index 59% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/progress.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/progress.rb index 9162af3c46..ac350903c5 100644 --- a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/progress.rb +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/progress.rb @@ -1,40 +1,22 @@ require 'ruby-progressbar/errors/invalid_progress_error' -require 'ruby-progressbar/calculators/smoothed_average' class ProgressBar class Progress - DEFAULT_TOTAL = 100 - DEFAULT_BEGINNING_POSITION = 0 - DEFAULT_RUNNING_AVERAGE_RATE = 0.1 - DEFAULT_RUNNING_AVERAGE_CALCULATOR = ProgressBar::Calculators::SmoothedAverage - - RUNNING_AVERAGE_CALCULATOR_MAP = { - 'smoothing' => ProgressBar::Calculators::SmoothedAverage - }.freeze + DEFAULT_TOTAL = 100 + DEFAULT_BEGINNING_POSITION = 0 attr_reader :total, :progress - - attr_accessor :starting_position, - :running_average, - :running_average_calculator, - :running_average_rate + attr_accessor :starting_position def initialize(options = {}) - self.total = options.fetch(:total, DEFAULT_TOTAL) - self.running_average_rate = options[:smoothing] || - options[:running_average_rate] || - DEFAULT_RUNNING_AVERAGE_RATE - self.running_average_calculator = RUNNING_AVERAGE_CALCULATOR_MAP. - fetch(options[:running_average_calculator], - DEFAULT_RUNNING_AVERAGE_CALCULATOR) + self.total = options.fetch(:total, DEFAULT_TOTAL) - start :at => DEFAULT_BEGINNING_POSITION + start(:at => DEFAULT_BEGINNING_POSITION) end def start(options = {}) - self.running_average = 0 - self.progress = \ + self.progress = \ self.starting_position = options[:at] || progress end @@ -67,7 +49,7 @@ class Progress end def reset - start :at => starting_position + start(:at => starting_position) end def progress=(new_progress) @@ -77,10 +59,6 @@ class Progress end @progress = new_progress - - self.running_average = running_average_calculator.calculate(running_average, - absolute, - running_average_rate) end def total=(new_total) @@ -105,7 +83,7 @@ class Progress end def none? - running_average.zero? || progress.zero? + progress.zero? end def unknown? diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projector.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projector.rb new file mode 100644 index 0000000000..d1759c437f --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projector.rb @@ -0,0 +1,14 @@ +require 'ruby-progressbar/projectors/smoothed_average' + +class ProgressBar +class Projector + DEFAULT_PROJECTOR = ProgressBar::Projectors::SmoothedAverage + NAME_TO_PROJECTOR_MAP = { + 'smoothed' => ProgressBar::Projectors::SmoothedAverage + }.freeze + + def self.from_type(name) + NAME_TO_PROJECTOR_MAP.fetch(name, DEFAULT_PROJECTOR) + end +end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projectors/smoothed_average.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projectors/smoothed_average.rb new file mode 100644 index 0000000000..0a8b3c1ac4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/projectors/smoothed_average.rb @@ -0,0 +1,71 @@ +class ProgressBar +module Projectors +class SmoothedAverage + DEFAULT_STRENGTH = 0.1 + DEFAULT_BEGINNING_POSITION = 0 + + attr_accessor :samples, + :strength + attr_reader :projection + + def initialize(options = {}) + self.samples = [] + self.projection = 0.0 + self.strength = options[:strength] || DEFAULT_STRENGTH + + start(:at => DEFAULT_BEGINNING_POSITION) + end + + def start(options = {}) + self.projection = 0.0 + self.progress = samples[0] = (options[:at] || progress) + end + + def decrement + self.progress -= 1 + end + + def increment + self.progress += 1 + end + + def progress + samples[1] + end + + def total=(_new_total); end + + def reset + start(:at => samples[0]) + end + + def progress=(new_progress) + samples[1] = new_progress + self.projection = \ + self.class.calculate( + @projection, + absolute, + strength + ) + end + + def none? + projection.zero? + end + + def self.calculate(current_projection, new_value, rate) + (new_value * (1.0 - rate)) + (current_projection * rate) + end + + protected + + attr_writer :projection + + private + + def absolute + samples[1] - samples[0] + end +end +end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements.rb new file mode 100644 index 0000000000..02b41231cf --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements.rb @@ -0,0 +1 @@ +require 'ruby-progressbar/refinements/progress_enumerator' diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements/progress_enumerator.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements/progress_enumerator.rb new file mode 100644 index 0000000000..fec51f2eb4 --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/refinements/progress_enumerator.rb @@ -0,0 +1,28 @@ +class ProgressBar +module Refinements +module Enumerator + ARITY_ERROR_MESSAGE = 'Only two arguments allowed to be passed to ' \ + 'with_progressbar (item, progress_bar)'.freeze + + refine ::Enumerator do + def with_progressbar(options = {}, &block) + progress_bar = ProgressBar.create(options.merge(:starting_at => 0, :total => size)) + + each do |item| + progress_bar.increment + + next unless block + + yielded_args = [] + yielded_args << item if block.arity > 0 + yielded_args << progress_bar if block.arity > 1 + + fail ::ArgumentError, ARITY_ERROR_MESSAGE if block.arity > 2 + + yield(*yielded_args) + end + end + end +end +end +end diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/throttle.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/throttle.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/throttle.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/throttle.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/time.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/time.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/time.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/timer.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/timer.rb similarity index 100% rename from Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.12.0/lib/ruby-progressbar/timer.rb rename to Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/timer.rb diff --git a/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/version.rb b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/version.rb new file mode 100644 index 0000000000..d799bebfcf --- /dev/null +++ b/Library/Homebrew/vendor/bundle/ruby/2.6.0/gems/ruby-progressbar-1.13.0/lib/ruby-progressbar/version.rb @@ -0,0 +1,3 @@ +class ProgressBar + VERSION = '1.13.0'.freeze +end