From cc088dbce03bb423d1fca3cb0badbb0f8f5dc96f Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Mon, 15 Jul 2024 16:31:21 -0400 Subject: [PATCH] Remove `Whirly` and show concurrent downloads. --- Library/Homebrew/Gemfile | 1 - Library/Homebrew/Gemfile.lock | 3 - Library/Homebrew/cmd/fetch.rb | 117 +- Library/Homebrew/utils/tty.rb | 29 +- .../3.3.0/gems/whirly-0.3.0/MIT-LICENSE.txt | 20 - .../gems/whirly-0.3.0/data/cli-spinners.json | 1415 ----------------- .../data/whirly-static-spinners.json | 274 ---- .../3.3.0/gems/whirly-0.3.0/lib/whirly.rb | 263 --- .../gems/whirly-0.3.0/lib/whirly/spinners.rb | 7 - .../whirly-0.3.0/lib/whirly/spinners/cli.rb | 7 - .../lib/whirly/spinners/whirly.rb | 15 - .../gems/whirly-0.3.0/lib/whirly/version.rb | 5 - 12 files changed, 128 insertions(+), 2028 deletions(-) delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/MIT-LICENSE.txt delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/cli-spinners.json delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/whirly-static-spinners.json delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/cli.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/whirly.rb delete mode 100644 Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/version.rb diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index 4bd8cfd1b628a7..22af8d702ec052 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -81,4 +81,3 @@ gem "plist" gem "ruby-macho" gem "sorbet-runtime" gem "warning" -gem "whirly" diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index f45e1440ce9b3c..20f089af10d2a1 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -142,8 +142,6 @@ GEM unicode-display_width (2.5.0) vernier (1.1.1) warning (1.4.0) - whirly (0.3.0) - unicode-display_width (>= 1.1) yard (0.9.36) yard-sorbet (0.9.0) sorbet-runtime @@ -193,7 +191,6 @@ DEPENDENCIES tapioca vernier warning - whirly yard yard-sorbet diff --git a/Library/Homebrew/cmd/fetch.rb b/Library/Homebrew/cmd/fetch.rb index 2808c1c9810ac7..b0f1e88d11a8c7 100644 --- a/Library/Homebrew/cmd/fetch.rb +++ b/Library/Homebrew/cmd/fetch.rb @@ -80,10 +80,36 @@ def download_queue end end + class Spinner + FRAMES = [ + "◜", + "◠", + "◝", + "◞", + "◡", + "◟", + ].freeze + + sig { void } + def initialize + @start = Time.now + @i = 0 + end + + sig { returns(String) } + def to_s + now = Time.now + if @start + 0.1 < now + @start = now + @i = (@i + 1) % FRAMES.count + end + + FRAMES.fetch(@i) + end + end + sig { override.void } def run - require "whirly" - Formulary.enable_factory_cache! bucket = if args.deps? @@ -194,24 +220,83 @@ def run end end - downloads.each do |downloadable, promise| - message = "#{downloadable.download_type.capitalize} #{downloadable.name}" - if concurrency > 1 - Whirly.start spinner: "arc", status: message - else - puts message + if concurrency == 1 + downloads.each_value do |promise| + promise.wait! + rescue ChecksumMismatchError => e + opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" + Homebrew.failed = true if downloadable.is_a?(Resource::Patch) end + else + + spinner = Spinner.new + + remaining_downloads = downloads.dup + + previous_pending_line_count = 0 + + begin + print Tty.hide_cursor + + output_message = lambda do |downloadable, promise| + status = case promise.state + when :fulfilled + "#{Tty.green}✔︎#{Tty.reset}" + when :rejected + "#{Tty.red}✘#{Tty.reset}" + when :pending + spinner + else + raise promise.state + end - promise.wait! + message = "#{downloadable.download_type.capitalize} #{downloadable.name}" + puts "#{status} #{message}" - Whirly.configure stop: "#{Tty.green}✔︎#{Tty.reset}" - Whirly.stop if args.concurrency - rescue ChecksumMismatchError => e - Whirly.configure stop: "#{Tty.red}✘#{Tty.reset}" - Whirly.stop if args.concurrency + if promise.rejected? && (e = promise.reason).is_a?(ChecksumMismatchError) + opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" + Homebrew.failed = true if downloadable.is_a?(Resource::Patch) + next 2 + end + + 1 + end + + until remaining_downloads.empty? + begin + finished_downloads = {} + + finished_states = [:fulfilled, :rejected] + remaining_downloads.each do |downloadable, promise| + break unless finished_states.include?(promise.state) + + finished_downloads[downloadable] = remaining_downloads.delete(downloadable) + end + + finished_downloads.each do |downloadable, promise| + previous_pending_line_count -= 1 + output_message.call(downloadable, promise) + end + + previous_pending_line_count = 0 + remaining_downloads.each do |downloadable, promise| + break if previous_pending_line_count >= (Tty.height - 1) + + previous_pending_line_count += output_message.call(downloadable, promise) + end - opoo "#{downloadable.download_type.capitalize} reports different checksum: #{e.expected}" - Homebrew.failed = true if downloadable.is_a?(Resource::Patch) + if previous_pending_line_count.positive? + $stdout.print "\033[#{previous_pending_line_count}A" + $stdout.flush + end + rescue Interrupt + print "\n" * previous_pending_line_count + raise + end + end + ensure + print Tty.show_cursor + end end download_queue.shutdown diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index 6c9f0d53dcecae..de549766b8a505 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -51,11 +51,36 @@ def strip_ansi(string) string.gsub(/\033\[\d+(;\d+)*m/, "") end + sig { returns(String) } + def hide_cursor + "\033[?25l" + end + + sig { returns(String) } + def show_cursor + "\033[?25h" + end + + sig { returns(T.nilable([Integer, Integer])) } + def size + `/bin/stty size 2>/dev/null`.split&.map(&:to_i) + end + + sig { returns(Integer) } + def height + @height ||= begin + height, = size + height, = `/usr/bin/tput lines 2>/dev/null`.split if height.zero? + height ||= 40 + height.to_i + end + end + sig { returns(Integer) } def width @width ||= begin - _, width = `/bin/stty size 2>/dev/null`.split - width, = `/usr/bin/tput cols 2>/dev/null`.split if width.to_i.zero? + _, width = size + width, = `/usr/bin/tput cols 2>/dev/null`.split if width.zero? width ||= 80 width.to_i end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/MIT-LICENSE.txt b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/MIT-LICENSE.txt deleted file mode 100644 index bfe58e510bd1e3..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/MIT-LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2016 Jan Lelis, https://janlelis.com - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/cli-spinners.json b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/cli-spinners.json deleted file mode 100644 index 89b0edba1c4831..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/cli-spinners.json +++ /dev/null @@ -1,1415 +0,0 @@ -{ - "dots": { - "interval": 80, - "frames": [ - "⠋", - "⠙", - "⠹", - "⠸", - "⠼", - "⠴", - "⠦", - "⠧", - "⠇", - "⠏" - ] - }, - "dots2": { - "interval": 80, - "frames": [ - "⣾", - "⣽", - "⣻", - "⢿", - "⡿", - "⣟", - "⣯", - "⣷" - ] - }, - "dots3": { - "interval": 80, - "frames": [ - "⠋", - "⠙", - "⠚", - "⠞", - "⠖", - "⠦", - "⠴", - "⠲", - "⠳", - "⠓" - ] - }, - "dots4": { - "interval": 80, - "frames": [ - "⠄", - "⠆", - "⠇", - "⠋", - "⠙", - "⠸", - "⠰", - "⠠", - "⠰", - "⠸", - "⠙", - "⠋", - "⠇", - "⠆" - ] - }, - "dots5": { - "interval": 80, - "frames": [ - "⠋", - "⠙", - "⠚", - "⠒", - "⠂", - "⠂", - "⠒", - "⠲", - "⠴", - "⠦", - "⠖", - "⠒", - "⠐", - "⠐", - "⠒", - "⠓", - "⠋" - ] - }, - "dots6": { - "interval": 80, - "frames": [ - "⠁", - "⠉", - "⠙", - "⠚", - "⠒", - "⠂", - "⠂", - "⠒", - "⠲", - "⠴", - "⠤", - "⠄", - "⠄", - "⠤", - "⠴", - "⠲", - "⠒", - "⠂", - "⠂", - "⠒", - "⠚", - "⠙", - "⠉", - "⠁" - ] - }, - "dots7": { - "interval": 80, - "frames": [ - "⠈", - "⠉", - "⠋", - "⠓", - "⠒", - "⠐", - "⠐", - "⠒", - "⠖", - "⠦", - "⠤", - "⠠", - "⠠", - "⠤", - "⠦", - "⠖", - "⠒", - "⠐", - "⠐", - "⠒", - "⠓", - "⠋", - "⠉", - "⠈" - ] - }, - "dots8": { - "interval": 80, - "frames": [ - "⠁", - "⠁", - "⠉", - "⠙", - "⠚", - "⠒", - "⠂", - "⠂", - "⠒", - "⠲", - "⠴", - "⠤", - "⠄", - "⠄", - "⠤", - "⠠", - "⠠", - "⠤", - "⠦", - "⠖", - "⠒", - "⠐", - "⠐", - "⠒", - "⠓", - "⠋", - "⠉", - "⠈", - "⠈" - ] - }, - "dots9": { - "interval": 80, - "frames": [ - "⢹", - "⢺", - "⢼", - "⣸", - "⣇", - "⡧", - "⡗", - "⡏" - ] - }, - "dots10": { - "interval": 80, - "frames": [ - "⢄", - "⢂", - "⢁", - "⡁", - "⡈", - "⡐", - "⡠" - ] - }, - "dots11": { - "interval": 100, - "frames": [ - "⠁", - "⠂", - "⠄", - "⡀", - "⢀", - "⠠", - "⠐", - "⠈" - ] - }, - "dots12": { - "interval": 80, - "frames": [ - "⢀⠀", - "⡀⠀", - "⠄⠀", - "⢂⠀", - "⡂⠀", - "⠅⠀", - "⢃⠀", - "⡃⠀", - "⠍⠀", - "⢋⠀", - "⡋⠀", - "⠍⠁", - "⢋⠁", - "⡋⠁", - "⠍⠉", - "⠋⠉", - "⠋⠉", - "⠉⠙", - "⠉⠙", - "⠉⠩", - "⠈⢙", - "⠈⡙", - "⢈⠩", - "⡀⢙", - "⠄⡙", - "⢂⠩", - "⡂⢘", - "⠅⡘", - "⢃⠨", - "⡃⢐", - "⠍⡐", - "⢋⠠", - "⡋⢀", - "⠍⡁", - "⢋⠁", - "⡋⠁", - "⠍⠉", - "⠋⠉", - "⠋⠉", - "⠉⠙", - "⠉⠙", - "⠉⠩", - "⠈⢙", - "⠈⡙", - "⠈⠩", - "⠀⢙", - "⠀⡙", - "⠀⠩", - "⠀⢘", - "⠀⡘", - "⠀⠨", - "⠀⢐", - "⠀⡐", - "⠀⠠", - "⠀⢀", - "⠀⡀" - ] - }, - "dots8Bit": { - "interval": 80, - "frames": [ - "⠀", - "⠁", - "⠂", - "⠃", - "⠄", - "⠅", - "⠆", - "⠇", - "⡀", - "⡁", - "⡂", - "⡃", - "⡄", - "⡅", - "⡆", - "⡇", - "⠈", - "⠉", - "⠊", - "⠋", - "⠌", - "⠍", - "⠎", - "⠏", - "⡈", - "⡉", - "⡊", - "⡋", - "⡌", - "⡍", - "⡎", - "⡏", - "⠐", - "⠑", - "⠒", - "⠓", - "⠔", - "⠕", - "⠖", - "⠗", - "⡐", - "⡑", - "⡒", - "⡓", - "⡔", - "⡕", - "⡖", - "⡗", - "⠘", - "⠙", - "⠚", - "⠛", - "⠜", - "⠝", - "⠞", - "⠟", - "⡘", - "⡙", - "⡚", - "⡛", - "⡜", - "⡝", - "⡞", - "⡟", - "⠠", - "⠡", - "⠢", - "⠣", - "⠤", - "⠥", - "⠦", - "⠧", - "⡠", - "⡡", - "⡢", - "⡣", - "⡤", - "⡥", - "⡦", - "⡧", - "⠨", - "⠩", - "⠪", - "⠫", - "⠬", - "⠭", - "⠮", - "⠯", - "⡨", - "⡩", - "⡪", - "⡫", - "⡬", - "⡭", - "⡮", - "⡯", - "⠰", - "⠱", - "⠲", - "⠳", - "⠴", - "⠵", - "⠶", - "⠷", - "⡰", - "⡱", - "⡲", - "⡳", - "⡴", - "⡵", - "⡶", - "⡷", - "⠸", - "⠹", - "⠺", - "⠻", - "⠼", - "⠽", - "⠾", - "⠿", - "⡸", - "⡹", - "⡺", - "⡻", - "⡼", - "⡽", - "⡾", - "⡿", - "⢀", - "⢁", - "⢂", - "⢃", - "⢄", - "⢅", - "⢆", - "⢇", - "⣀", - "⣁", - "⣂", - "⣃", - "⣄", - "⣅", - "⣆", - "⣇", - "⢈", - "⢉", - "⢊", - "⢋", - "⢌", - "⢍", - "⢎", - "⢏", - "⣈", - "⣉", - "⣊", - "⣋", - "⣌", - "⣍", - "⣎", - "⣏", - "⢐", - "⢑", - "⢒", - "⢓", - "⢔", - "⢕", - "⢖", - "⢗", - "⣐", - "⣑", - "⣒", - "⣓", - "⣔", - "⣕", - "⣖", - "⣗", - "⢘", - "⢙", - "⢚", - "⢛", - "⢜", - "⢝", - "⢞", - "⢟", - "⣘", - "⣙", - "⣚", - "⣛", - "⣜", - "⣝", - "⣞", - "⣟", - "⢠", - "⢡", - "⢢", - "⢣", - "⢤", - "⢥", - "⢦", - "⢧", - "⣠", - "⣡", - "⣢", - "⣣", - "⣤", - "⣥", - "⣦", - "⣧", - "⢨", - "⢩", - "⢪", - "⢫", - "⢬", - "⢭", - "⢮", - "⢯", - "⣨", - "⣩", - "⣪", - "⣫", - "⣬", - "⣭", - "⣮", - "⣯", - "⢰", - "⢱", - "⢲", - "⢳", - "⢴", - "⢵", - "⢶", - "⢷", - "⣰", - "⣱", - "⣲", - "⣳", - "⣴", - "⣵", - "⣶", - "⣷", - "⢸", - "⢹", - "⢺", - "⢻", - "⢼", - "⢽", - "⢾", - "⢿", - "⣸", - "⣹", - "⣺", - "⣻", - "⣼", - "⣽", - "⣾", - "⣿" - ] - }, - "line": { - "interval": 130, - "frames": [ - "-", - "\\", - "|", - "/" - ] - }, - "line2": { - "interval": 100, - "frames": [ - "⠂", - "-", - "–", - "—", - "–", - "-" - ] - }, - "pipe": { - "interval": 100, - "frames": [ - "┤", - "┘", - "┴", - "└", - "├", - "┌", - "┬", - "┐" - ] - }, - "simpleDots": { - "interval": 400, - "frames": [ - ". ", - ".. ", - "...", - " " - ] - }, - "simpleDotsScrolling": { - "interval": 200, - "frames": [ - ". ", - ".. ", - "...", - " ..", - " .", - " " - ] - }, - "star": { - "interval": 70, - "frames": [ - "✶", - "✸", - "✹", - "✺", - "✹", - "✷" - ] - }, - "star2": { - "interval": 80, - "frames": [ - "+", - "x", - "*" - ] - }, - "flip": { - "interval": 70, - "frames": [ - "_", - "_", - "_", - "-", - "`", - "`", - "'", - "´", - "-", - "_", - "_", - "_" - ] - }, - "hamburger": { - "interval": 100, - "frames": [ - "☱", - "☲", - "☴" - ] - }, - "growVertical": { - "interval": 120, - "frames": [ - "▁", - "▃", - "▄", - "▅", - "▆", - "▇", - "▆", - "▅", - "▄", - "▃" - ] - }, - "growHorizontal": { - "interval": 120, - "frames": [ - "▏", - "▎", - "▍", - "▌", - "▋", - "▊", - "▉", - "▊", - "▋", - "▌", - "▍", - "▎" - ] - }, - "balloon": { - "interval": 140, - "frames": [ - " ", - ".", - "o", - "O", - "@", - "*", - " " - ] - }, - "balloon2": { - "interval": 120, - "frames": [ - ".", - "o", - "O", - "°", - "O", - "o", - "." - ] - }, - "noise": { - "interval": 100, - "frames": [ - "▓", - "▒", - "░" - ] - }, - "bounce": { - "interval": 120, - "frames": [ - "⠁", - "⠂", - "⠄", - "⠂" - ] - }, - "boxBounce": { - "interval": 120, - "frames": [ - "▖", - "▘", - "▝", - "▗" - ] - }, - "boxBounce2": { - "interval": 100, - "frames": [ - "▌", - "▀", - "▐", - "▄" - ] - }, - "triangle": { - "interval": 50, - "frames": [ - "◢", - "◣", - "◤", - "◥" - ] - }, - "arc": { - "interval": 100, - "frames": [ - "◜", - "◠", - "◝", - "◞", - "◡", - "◟" - ] - }, - "circle": { - "interval": 120, - "frames": [ - "◡", - "⊙", - "◠" - ] - }, - "squareCorners": { - "interval": 180, - "frames": [ - "◰", - "◳", - "◲", - "◱" - ] - }, - "circleQuarters": { - "interval": 120, - "frames": [ - "◴", - "◷", - "◶", - "◵" - ] - }, - "circleHalves": { - "interval": 50, - "frames": [ - "◐", - "◓", - "◑", - "◒" - ] - }, - "squish": { - "interval": 100, - "frames": [ - "╫", - "╪" - ] - }, - "toggle": { - "interval": 250, - "frames": [ - "⊶", - "⊷" - ] - }, - "toggle2": { - "interval": 80, - "frames": [ - "▫", - "▪" - ] - }, - "toggle3": { - "interval": 120, - "frames": [ - "□", - "■" - ] - }, - "toggle4": { - "interval": 100, - "frames": [ - "■", - "□", - "▪", - "▫" - ] - }, - "toggle5": { - "interval": 100, - "frames": [ - "▮", - "▯" - ] - }, - "toggle6": { - "interval": 300, - "frames": [ - "ဝ", - "၀" - ] - }, - "toggle7": { - "interval": 80, - "frames": [ - "⦾", - "⦿" - ] - }, - "toggle8": { - "interval": 100, - "frames": [ - "◍", - "◌" - ] - }, - "toggle9": { - "interval": 100, - "frames": [ - "◉", - "◎" - ] - }, - "toggle10": { - "interval": 100, - "frames": [ - "㊂", - "㊀", - "㊁" - ] - }, - "toggle11": { - "interval": 50, - "frames": [ - "⧇", - "⧆" - ] - }, - "toggle12": { - "interval": 120, - "frames": [ - "☗", - "☖" - ] - }, - "toggle13": { - "interval": 80, - "frames": [ - "=", - "*", - "-" - ] - }, - "arrow": { - "interval": 100, - "frames": [ - "←", - "↖", - "↑", - "↗", - "→", - "↘", - "↓", - "↙" - ] - }, - "arrow2": { - "interval": 80, - "frames": [ - "⬆️ ", - "↗️ ", - "➡️ ", - "↘️ ", - "⬇️ ", - "↙️ ", - "⬅️ ", - "↖️ " - ] - }, - "arrow3": { - "interval": 120, - "frames": [ - "▹▹▹▹▹", - "▸▹▹▹▹", - "▹▸▹▹▹", - "▹▹▸▹▹", - "▹▹▹▸▹", - "▹▹▹▹▸" - ] - }, - "bouncingBar": { - "interval": 80, - "frames": [ - "[ ]", - "[= ]", - "[== ]", - "[=== ]", - "[ ===]", - "[ ==]", - "[ =]", - "[ ]", - "[ =]", - "[ ==]", - "[ ===]", - "[====]", - "[=== ]", - "[== ]", - "[= ]" - ] - }, - "bouncingBall": { - "interval": 80, - "frames": [ - "( ● )", - "( ● )", - "( ● )", - "( ● )", - "( ●)", - "( ● )", - "( ● )", - "( ● )", - "( ● )", - "(● )" - ] - }, - "smiley": { - "interval": 200, - "frames": [ - "😄 ", - "😝 " - ] - }, - "monkey": { - "interval": 300, - "frames": [ - "🙈 ", - "🙈 ", - "🙉 ", - "🙊 " - ] - }, - "hearts": { - "interval": 100, - "frames": [ - "💛 ", - "💙 ", - "💜 ", - "💚 ", - "❤️ " - ] - }, - "clock": { - "interval": 100, - "frames": [ - "🕛 ", - "🕐 ", - "🕑 ", - "🕒 ", - "🕓 ", - "🕔 ", - "🕕 ", - "🕖 ", - "🕗 ", - "🕘 ", - "🕙 ", - "🕚 " - ] - }, - "earth": { - "interval": 180, - "frames": [ - "🌍 ", - "🌎 ", - "🌏 " - ] - }, - "material": { - "interval": 17, - "frames": [ - "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "███████▁▁▁▁▁▁▁▁▁▁▁▁▁", - "████████▁▁▁▁▁▁▁▁▁▁▁▁", - "█████████▁▁▁▁▁▁▁▁▁▁▁", - "█████████▁▁▁▁▁▁▁▁▁▁▁", - "██████████▁▁▁▁▁▁▁▁▁▁", - "███████████▁▁▁▁▁▁▁▁▁", - "█████████████▁▁▁▁▁▁▁", - "██████████████▁▁▁▁▁▁", - "██████████████▁▁▁▁▁▁", - "▁██████████████▁▁▁▁▁", - "▁██████████████▁▁▁▁▁", - "▁██████████████▁▁▁▁▁", - "▁▁██████████████▁▁▁▁", - "▁▁▁██████████████▁▁▁", - "▁▁▁▁█████████████▁▁▁", - "▁▁▁▁██████████████▁▁", - "▁▁▁▁██████████████▁▁", - "▁▁▁▁▁██████████████▁", - "▁▁▁▁▁██████████████▁", - "▁▁▁▁▁██████████████▁", - "▁▁▁▁▁▁██████████████", - "▁▁▁▁▁▁██████████████", - "▁▁▁▁▁▁▁█████████████", - "▁▁▁▁▁▁▁█████████████", - "▁▁▁▁▁▁▁▁████████████", - "▁▁▁▁▁▁▁▁████████████", - "▁▁▁▁▁▁▁▁▁███████████", - "▁▁▁▁▁▁▁▁▁███████████", - "▁▁▁▁▁▁▁▁▁▁██████████", - "▁▁▁▁▁▁▁▁▁▁██████████", - "▁▁▁▁▁▁▁▁▁▁▁▁████████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", - "█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", - "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", - "██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", - "███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", - "████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", - "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", - "█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", - "██████▁▁▁▁▁▁▁▁▁▁▁▁▁█", - "████████▁▁▁▁▁▁▁▁▁▁▁▁", - "█████████▁▁▁▁▁▁▁▁▁▁▁", - "█████████▁▁▁▁▁▁▁▁▁▁▁", - "█████████▁▁▁▁▁▁▁▁▁▁▁", - "█████████▁▁▁▁▁▁▁▁▁▁▁", - "███████████▁▁▁▁▁▁▁▁▁", - "████████████▁▁▁▁▁▁▁▁", - "████████████▁▁▁▁▁▁▁▁", - "██████████████▁▁▁▁▁▁", - "██████████████▁▁▁▁▁▁", - "▁██████████████▁▁▁▁▁", - "▁██████████████▁▁▁▁▁", - "▁▁▁█████████████▁▁▁▁", - "▁▁▁▁▁████████████▁▁▁", - "▁▁▁▁▁████████████▁▁▁", - "▁▁▁▁▁▁███████████▁▁▁", - "▁▁▁▁▁▁▁▁█████████▁▁▁", - "▁▁▁▁▁▁▁▁█████████▁▁▁", - "▁▁▁▁▁▁▁▁▁█████████▁▁", - "▁▁▁▁▁▁▁▁▁█████████▁▁", - "▁▁▁▁▁▁▁▁▁▁█████████▁", - "▁▁▁▁▁▁▁▁▁▁▁████████▁", - "▁▁▁▁▁▁▁▁▁▁▁████████▁", - "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", - "▁▁▁▁▁▁▁▁▁▁▁▁███████▁", - "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁███████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁", - "▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁" - ] - }, - "moon": { - "interval": 80, - "frames": [ - "🌑 ", - "🌒 ", - "🌓 ", - "🌔 ", - "🌕 ", - "🌖 ", - "🌗 ", - "🌘 " - ] - }, - "runner": { - "interval": 140, - "frames": [ - "🚶 ", - "🏃 " - ] - }, - "pong": { - "interval": 80, - "frames": [ - "▐⠂ ▌", - "▐⠈ ▌", - "▐ ⠂ ▌", - "▐ ⠠ ▌", - "▐ ⡀ ▌", - "▐ ⠠ ▌", - "▐ ⠂ ▌", - "▐ ⠈ ▌", - "▐ ⠂ ▌", - "▐ ⠠ ▌", - "▐ ⡀ ▌", - "▐ ⠠ ▌", - "▐ ⠂ ▌", - "▐ ⠈ ▌", - "▐ ⠂▌", - "▐ ⠠▌", - "▐ ⡀▌", - "▐ ⠠ ▌", - "▐ ⠂ ▌", - "▐ ⠈ ▌", - "▐ ⠂ ▌", - "▐ ⠠ ▌", - "▐ ⡀ ▌", - "▐ ⠠ ▌", - "▐ ⠂ ▌", - "▐ ⠈ ▌", - "▐ ⠂ ▌", - "▐ ⠠ ▌", - "▐ ⡀ ▌", - "▐⠠ ▌" - ] - }, - "shark": { - "interval": 120, - "frames": [ - "▐|\\____________▌", - "▐_|\\___________▌", - "▐__|\\__________▌", - "▐___|\\_________▌", - "▐____|\\________▌", - "▐_____|\\_______▌", - "▐______|\\______▌", - "▐_______|\\_____▌", - "▐________|\\____▌", - "▐_________|\\___▌", - "▐__________|\\__▌", - "▐___________|\\_▌", - "▐____________|\\▌", - "▐____________/|▌", - "▐___________/|_▌", - "▐__________/|__▌", - "▐_________/|___▌", - "▐________/|____▌", - "▐_______/|_____▌", - "▐______/|______▌", - "▐_____/|_______▌", - "▐____/|________▌", - "▐___/|_________▌", - "▐__/|__________▌", - "▐_/|___________▌", - "▐/|____________▌" - ] - }, - "dqpb": { - "interval": 100, - "frames": [ - "d", - "q", - "p", - "b" - ] - }, - "weather": { - "interval": 100, - "frames": [ - "☀️ ", - "☀️ ", - "☀️ ", - "🌤 ", - "⛅️ ", - "🌥 ", - "☁️ ", - "🌧 ", - "🌨 ", - "🌧 ", - "🌨 ", - "🌧 ", - "🌨 ", - "⛈ ", - "🌨 ", - "🌧 ", - "🌨 ", - "☁️ ", - "🌥 ", - "⛅️ ", - "🌤 ", - "☀️ ", - "☀️ " - ] - }, - "christmas": { - "interval": 400, - "frames": [ - "🌲", - "🎄" - ] - }, - "grenade": { - "interval": 80, - "frames": [ - "، ", - "′ ", - " ´ ", - " ‾ ", - " ⸌", - " ⸊", - " |", - " ⁎", - " ⁕", - " ෴ ", - " ⁓", - " ", - " ", - " " - ] - }, - "point": { - "interval": 125, - "frames": [ - "∙∙∙", - "●∙∙", - "∙●∙", - "∙∙●", - "∙∙∙" - ] - }, - "layer": { - "interval": 150, - "frames": [ - "-", - "=", - "≡" - ] - }, - "betaWave": { - "interval": 80, - "frames": [ - "ρββββββ", - "βρβββββ", - "ββρββββ", - "βββρβββ", - "ββββρββ", - "βββββρβ", - "ββββββρ" - ] - }, - "fingerDance": { - "interval": 160, - "frames": [ - "🤘 ", - "🤟 ", - "🖖 ", - "✋ ", - "🤚 ", - "👆 " - ] - }, - "fistBump": { - "interval": 80, - "frames": [ - "🤜\u3000\u3000\u3000\u3000🤛 ", - "🤜\u3000\u3000\u3000\u3000🤛 ", - "🤜\u3000\u3000\u3000\u3000🤛 ", - "\u3000🤜\u3000\u3000🤛\u3000 ", - "\u3000\u3000🤜🤛\u3000\u3000 ", - "\u3000🤜✨🤛\u3000\u3000 ", - "🤜\u3000✨\u3000🤛\u3000 " - ] - }, - "soccerHeader": { - "interval": 80, - "frames": [ - " 🧑⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 ", - "🧑 ⚽️ 🧑 " - ] - }, - "mindblown": { - "interval": 160, - "frames": [ - "😐 ", - "😐 ", - "😮 ", - "😮 ", - "😦 ", - "😦 ", - "😧 ", - "😧 ", - "🤯 ", - "💥 ", - "✨ ", - "\u3000 ", - "\u3000 ", - "\u3000 " - ] - }, - "speaker": { - "interval": 160, - "frames": [ - "🔈 ", - "🔉 ", - "🔊 ", - "🔉 " - ] - }, - "orangePulse": { - "interval": 100, - "frames": [ - "🔸 ", - "🔶 ", - "🟠 ", - "🟠 ", - "🔶 " - ] - }, - "bluePulse": { - "interval": 100, - "frames": [ - "🔹 ", - "🔷 ", - "🔵 ", - "🔵 ", - "🔷 " - ] - }, - "orangeBluePulse": { - "interval": 100, - "frames": [ - "🔸 ", - "🔶 ", - "🟠 ", - "🟠 ", - "🔶 ", - "🔹 ", - "🔷 ", - "🔵 ", - "🔵 ", - "🔷 " - ] - }, - "timeTravel": { - "interval": 100, - "frames": [ - "🕛 ", - "🕚 ", - "🕙 ", - "🕘 ", - "🕗 ", - "🕖 ", - "🕕 ", - "🕔 ", - "🕓 ", - "🕒 ", - "🕑 ", - "🕐 " - ] - }, - "aesthetic": { - "interval": 80, - "frames": [ - "▰▱▱▱▱▱▱", - "▰▰▱▱▱▱▱", - "▰▰▰▱▱▱▱", - "▰▰▰▰▱▱▱", - "▰▰▰▰▰▱▱", - "▰▰▰▰▰▰▱", - "▰▰▰▰▰▰▰", - "▰▱▱▱▱▱▱" - ] - } -} diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/whirly-static-spinners.json b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/whirly-static-spinners.json deleted file mode 100644 index 3c99177d155fcc..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/data/whirly-static-spinners.json +++ /dev/null @@ -1,274 +0,0 @@ -{ - "roman_numerals": { - "interval": 90, - "mode": "swing", - "frames": [ - "Ⅰ", - "Ⅱ", - "Ⅲ", - "Ⅳ", - "Ⅴ", - "Ⅵ", - "Ⅶ", - "Ⅷ", - "Ⅸ", - "Ⅹ" - ] - }, - "double_mark": { - "interval": 120, - "mode": "random", - "frames": [ - "⁇", - "⁈", - "⁉", - "‼" - ] - }, - "heart_exclamation": { - "interval": 45, - "frames": [ - "❢", - "❣" - ] - }, - "pencil": { - "interval": 200, - "frames": [ - "✏", - "✎" - ] - }, - "bars": { - "interval": 80, - "mode": "swing", - "frames": [ - "𝍠", - "𝍡", - "𝍢", - "𝍣", - "𝍤" - ] - }, - "dice": { - "interval": 100, - "mode": "random", - "frames": [ - "⚀", - "⚁", - "⚂", - "⚃", - "⚄", - "⚅" - ] - }, - "hanoi": { - "interval": 150, - "mode": "swing", - "frames": [ - "𝍥", - "𝍦", - "𝍧", - "𝍨" - ] - }, - "vertical_bars": { - "interval": 80, - "mode": "swing", - "frames": [ - "𝍩", - "𝍪", - "𝍫", - "𝍬", - "𝍭" - ] - }, - "whirly": { - "interval": 200, - "mode": "random", - "frames": [ - "😀", - "😁", - "😂", - "😃", - "😄", - "😅", - "😆", - "😇", - "😈", - "😉", - "😊", - "😋", - "😌", - "😍", - "😎", - "😏", - "😐", - "😑", - "😒", - "😓", - "😔", - "😕", - "😖", - "😗", - "😘", - "😙", - "😚", - "😛", - "😜", - "😝", - "😞", - "😟", - "😠", - "😡", - "😢", - "😣", - "😤", - "😥", - "😦", - "😧", - "😨", - "😩", - "😪", - "😫", - "😬", - "😭", - "😮", - "😯", - "😰", - "😱", - "😲", - "😳", - "😴", - "😵", - "😶", - "🙁", - "🙂", - "🙃", - "🙄", - "😷", - "🤐", - "🤑", - "🤒", - "🤓", - "🤔", - "🤕", - "🤖", - "🤗" - ] - }, - "cat": { - "interval": 200, - "mode": "random", - "frames": [ - "😸", - "😹", - "😺", - "😻", - "😼", - "😽", - "😾", - "😿", - "🙀" - ] - }, - "card": { - "interval": 90, - "stop": "🂠", - "frames": [ - "🃁", "🃂", "🃃", "🃄", "🃅", "🃆", "🃇", "🃈", "🃉", "🃊", "🃋", "🃌", "🃍", "🃎", - "🂱", "🂲", "🂳", "🂴", "🂵", "🂶", "🂷", "🂸", "🂹", "🂺", "🂻", "🂼", "🂽", "🂾", - "🂡", "🂢", "🂣", "🂤", "🂥", "🂦", "🂧", "🂨", "🂩", "🂪", "🂫", "🂬", "🂭", "🂮", - "🃑", "🃒", "🃓", "🃔", "🃕", "🃖", "🃗", "🃘", "🃙", "🃚", "🃛", "🃜", "🃝", "🃞" - ] - }, - "cloud": { - "interval": 140, - "frames": [ - "🌥", - "🌦", - "🌧", - "🌨", - "🌩", - "🌪" - ] - }, - "photo": { - "interval": 200, - "frames": [ - "📷", - "📸" - ] - }, - "banknote": { - "interval": 100, - "frames": [ - "💴", - "💵", - "💶", - "💷" - ] - }, - "white_square": { - "interval": 100, - "mode": "swing", - "frames": [ - "🞓", - "🞒", - "🞑", - "🞐", - "🞏", - "🞎", - "🞔" - ] - }, - "xberg": { - "interval": 150, - "mode": "random", - "frames": [ - "⨯", - "⛰", - "⛰", - "⛰", - "⛰", - "⛰", - "⛰" - ] - }, - "circled_letter": { - "interval": 120, - "mode": "random", - "frames": [ - "Ⓐ", "Ⓑ", "Ⓒ", "Ⓓ", "Ⓔ", "Ⓕ", "Ⓖ", "Ⓗ", "Ⓘ", - "Ⓙ", "Ⓚ", "Ⓛ", "Ⓜ", "Ⓝ", "Ⓞ", "Ⓟ", "Ⓠ", "Ⓡ", - "Ⓢ", "Ⓣ", "Ⓤ", "Ⓥ", "Ⓦ", "Ⓧ", "Ⓨ", "Ⓩ" - ] - }, - "circled_number": { - "interval": 120, - "mode": "random", - "frames": [ - "①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨" - ] - }, - "letter_with_parens": { - "interval": 150, - "mode": "random", - "frames": [ - "🄐", "🄑", "🄒", "🄓", "🄔", "🄕", "🄖", "🄗", "🄘", - "🄙", "🄚", "🄛", "🄜", "🄝", "🄞", "🄟", "🄠", "🄡", - "🄢", "🄣", "🄤", "🄥", "🄦", "🄧", "🄨", "🄩" - ] - }, - "starlike": { - "interval": 120, - "mode": "random", - "frames": [ - "✩", "✪", "✫", "✬", "✭", "✮", "✯", "✰", - "✱", "✲", "✳", "✴", "✵", "✶", "✷", "✸", - "✹", "✺", "✻", "✼", "✽", "✾", "✿", "❀", - "❁", "❂", "❃", "❄", "❅", "❆", "❇", "❈", - "❉", "❊" - ] - } -} diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly.rb deleted file mode 100644 index 5106fc7c06e5e6..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly.rb +++ /dev/null @@ -1,263 +0,0 @@ -require_relative "whirly/version" -require_relative "whirly/spinners" - -require "unicode/display_width" - -begin - require "paint" -rescue LoadError -end - -module Whirly - @configured = false - - CLI_COMMANDS = { - hide_cursor: "\x1b[?25l", - show_cursor: "\x1b[?25h", - }.freeze - - DEFAULT_OPTIONS = { - ambiguous_character_width: 1, - ansi_escape_mode: "restore", - append_newline: true, - color: !!defined?(Paint), - color_change_rate: 30, - hide_cursor: true, - non_tty: false, - position: "normal", - remove_after_stop: false, - spinner: "whirly", - spinner_packs: [:whirly, :cli], - status: nil, - stream: $stdout, - }.freeze - - SOFT_DEFAULT_OPTIONS = { - interval: 100, - mode: "linear", - stop: nil, - }.freeze - - class << self - attr_accessor :status - attr_reader :options - - def enabled? - !!(defined?(@enabled) && @enabled) - end - - def configured? - !!(@configured) - end - end - - # set spinner directly or lookup - def self.configure_spinner(spinner_option) - case spinner_option - when Hash - spinner = spinner_option.dup - when Enumerable - spinner = { "frames" => spinner_option.dup } - when Proc - spinner = { "proc" => spinner_option.dup } - else - spinner = nil - catch(:found){ - @options[:spinner_packs].each{ |spinner_pack| - spinners = Whirly::Spinners.const_get(spinner_pack.to_s.upcase) - if spinners[spinner_option] - spinner = spinners[spinner_option].dup - throw(:found) - end - } - } - end - - # validate spinner - if !spinner || (!spinner["frames"] && !spinner["proc"]) - raise(ArgumentError, "Whirly: Invalid spinner given") - end - - spinner - end - - # frames can be generated from enumerables or procs - def self.configure_frames(spinner) - if spinner["frames"] - case spinner["mode"] - when "swing" - frames = (spinner["frames"].to_a + spinner["frames"].to_a[1..-2].reverse).cycle - when "random" - frame_pool = spinner["frames"].to_a - frames = ->(){ frame_pool.sample } - when "reverse" - frames = spinner["frames"].to_a.reverse.cycle - else - frames = spinner["frames"].cycle - end - elsif spinner["proc"] - frames = spinner["proc"].dup - else - raise(ArgumentError, "Whirly: Invalid spinner given") - end - - if frames.is_a? Proc - class << frames - alias next call - end - end - - frames - end - - # save options and preprocess, set defaults if value is still unknown - def self.configure(**options) - if !defined?(@configured) || !@configured || !defined?(@options) || !@options - @options = DEFAULT_OPTIONS.dup - @configured = true - end - - @options.merge!(options) - - spinner = configure_spinner(@options[:spinner]) - spinner_overwrites = {} - spinner_overwrites["mode"] = @options[:mode] if @options.key?(:mode) - @frames = configure_frames(spinner.merge(spinner_overwrites)) - - @interval = (@options[:interval] || spinner["interval"] || SOFT_DEFAULT_OPTIONS[:interval]) * 0.001 - @stop = @options[:stop] || spinner["stop"] - @status = @options[:status] - end - - def self.start(**options) - # optionally overwrite configuration on start - configure(**options) - - # only enable once - return false if defined?(@enabled) && @enabled - - # set status to enabled - @enabled = true - - # only do something if we are on a real terminal (or forced) - return false unless @options[:stream].tty? || @options[:non_tty] - - # ensure cursor is visible after exit the program (only register for the very first time) - if (!defined?(@at_exit_handler_registered) || !@at_exit_handler_registered) && @options[:hide_cursor] - @at_exit_handler_registered = true - stream = @options[:stream] - at_exit{ stream.print CLI_COMMANDS[:show_cursor] } - end - - # init color - initialize_color if @options[:color] - - # hide cursor - @options[:stream].print CLI_COMMANDS[:hide_cursor] if @options[:hide_cursor] - - # start spinner loop - @thread = Thread.new do - @current_frame = nil - while true # it's just a spinner, no exact timing here - next_color if @color - render - sleep(@interval) - end - end - - # idiomatic block syntax support - if block_given? - begin - yield - ensure - Whirly.stop - end - end - - true - end - - def self.stop(stop_frame = nil) - return false unless @enabled - @enabled = false - return false unless @options[:stream].tty? || @options[:non_tty] - - @thread.terminate if @thread - render(stop_frame || @stop) if stop_frame || @stop - unrender if @options[:remove_after_stop] - @options[:stream].puts if @options[:append_newline] - @options[:stream].print CLI_COMMANDS[:show_cursor] if @options[:hide_cursor] - - true - end - - def self.reset - at_exit_handler_registered = defined?(@at_exit_handler_registered) && @at_exit_handler_registered - instance_variables.each{ |iv| remove_instance_variable(iv) } - @at_exit_handler_registered = at_exit_handler_registered - @configured = false - end - - # - - - - - def self.unrender - return unless @current_frame - case @options[:ansi_escape_mode] - when "restore" - @options[:stream].print(render_prefix + ( - ' ' * (Unicode::DisplayWidth.of(@current_frame, @options[:ambiguous_character_width]) + 1) - ) + render_suffix) - when "line" - @options[:stream].print "\e[1K" - end - end - - def self.render(next_frame = nil) - unrender - - @current_frame = next_frame || @frames.next - @current_frame = Paint[@current_frame, @color] if @options[:color] - @current_frame += " #{@status}" if @status - - @options[:stream].print(render_prefix + @current_frame.to_s + render_suffix) - end - - def self.render_prefix - res = "" - res << "\n" if @options[:position] == "below" - res << "\e7" if @options[:ansi_escape_mode] == "restore" - res << "\e[G" if @options[:ansi_escape_mode] == "line" - res - end - - def self.render_suffix - res = "" - res << "\e8" if @options[:ansi_escape_mode] == "restore" - res << "\e[1A" if @options[:position] == "below" - res - end - - def self.initialize_color - if !defined?(Paint) - warn "Whirly warning: Using colors requires the paint gem" - else - @color = "%.6x" % rand(16777216) - @color_directions = (0..2).map{ |e| rand(3) - 1 } - end - end - - def self.next_color - @color = @color.scan(/../).map.with_index{ |c, i| - color_change = rand(@options[:color_change_rate]) * @color_directions[i] - nc = c.to_i(16) + color_change - if nc <= 0 - nc = 0 - @color_directions[i] = rand(3) - 1 - elsif nc >= 255 - nc = 255 - @color_directions[i] = rand(3) - 1 - end - "%.2x" % nc - }.join - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners.rb deleted file mode 100644 index c72b037ae86557..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Whirly - module Spinners - end -end - -require_relative "spinners/whirly" -require_relative "spinners/cli" diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/cli.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/cli.rb deleted file mode 100644 index 4fd2774730f6bc..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/cli.rb +++ /dev/null @@ -1,7 +0,0 @@ -require "json" - -module Whirly - module Spinners - CLI = JSON.load(File.read(File.dirname(__FILE__) + "/../../../data/cli-spinners.json")).freeze - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/whirly.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/whirly.rb deleted file mode 100644 index f40853b0cd17b0..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/spinners/whirly.rb +++ /dev/null @@ -1,15 +0,0 @@ -require "json" - -module Whirly - module Spinners - WHIRLY = { - "random_dots" => { "proc" => ->(){ [ 0x2800 + rand(256)].pack("U") }, "interval" => 100 }, - "mahjong" => { "proc" => ->(){ [0x1F000 + rand(44)].pack("U") }, "interval" => 200 }, - "domino" => { "proc" => ->(){ [0x1F030 + rand(50)].pack("U") }, "interval" => 200 }, - "vertical_domino" => { "proc" => ->(){ [0x1F062 + rand(50)].pack("U") }, "interval" => 200 } - } - WHIRLY.merge! JSON.load(File.read(File.dirname(__FILE__) + "/../../../data/whirly-static-spinners.json")) - - WHIRLY.freeze - end -end diff --git a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/version.rb b/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/version.rb deleted file mode 100644 index 4e33cef7c707ba..00000000000000 --- a/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/whirly-0.3.0/lib/whirly/version.rb +++ /dev/null @@ -1,5 +0,0 @@ -# frozen_string_literal: true - -module Whirly - VERSION = "0.3.0" -end