mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
AutoBuild: gem started at 2025-04-16-16UTC (#11724)
* Gem logic and version updates. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Use Time.new in progress_bar Signed-off-by: Satadru Pramanik <satadru@gmail.com> * WIP time issue Signed-off-by: Satadru Pramanik <satadru@gmail.com> * bump buildessential version Signed-off-by: Satadru Pramanik <satadru@gmail.com> * require time for progress_bar Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Try to fix time... Signed-off-by: Satadru Pramanik <satadru@gmail.com> * time debug Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Avoid conflict with progressbar gem. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Remove debug code Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Use CamelCase Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com> Co-authored-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
456d16e80b
commit
1180b81ce4
@@ -44,10 +44,17 @@ def set_vars(passed_name = nil, passed_version = nil)
|
||||
$gems ||= BasicCompactIndexClient.new.gems
|
||||
puts 'Done populating gem information.'.lightgreen
|
||||
end
|
||||
# Parse gem information from compact index, the format for which is
|
||||
# here: https://guides.rubygems.org/rubygems-org-compact-index-api/
|
||||
# Figure out gem name, noting that there may be dashes and underscores
|
||||
# in the name.
|
||||
gem_test = $gems.grep(/#{"^#{passed_name.gsub(/^ruby_/, '')}\\s.*$"}/).last.blank? ? $gems.grep(/#{"^\(#{passed_name.gsub(/^ruby_/, '').gsub('_', ')*.(')}\\s\).*$"}/).last : $gems.grep(/#{"^#{passed_name.gsub(/^ruby_/, '')}\\s.*$"}/).last
|
||||
abort "Cannot find #{passed_name} gem to install.".lightred if gem_test.blank?
|
||||
gem_test_name = gem_test.split.first
|
||||
gem_test_versions = gem_test.split[1].split(',')
|
||||
# Remove minus prefixed versions, as those have been yanked as per
|
||||
# https://guides.rubygems.org/rubygems-org-compact-index-api/
|
||||
gem_test_versions.delete_if { |i| i.start_with?('-') }
|
||||
# Any version with a letter is considered a prerelease as per
|
||||
# https://github.com/rubygems/rubygems/blob/b5798efd348935634d4e0e2b846d4f455582db48/lib/rubygems/version.rb#L305
|
||||
gem_test_versions.delete_if { |i| i.match?(/[a-zA-Z]/) }
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
require 'etc'
|
||||
|
||||
OLD_CREW_VERSION ||= defined?(CREW_VERSION) ? CREW_VERSION : '1.0'
|
||||
CREW_VERSION ||= '1.58.1' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||
CREW_VERSION ||= '1.58.2' unless defined?(CREW_VERSION) && CREW_VERSION == OLD_CREW_VERSION
|
||||
|
||||
# Kernel architecture.
|
||||
KERN_ARCH ||= Etc.uname[:machine]
|
||||
|
||||
@@ -129,7 +129,7 @@ def http_downloader(uri, filename = File.basename(url), verbose: false)
|
||||
downloaded_size = 0.0
|
||||
|
||||
# initialize progress bar
|
||||
progress_bar = ProgressBar.new(file_size)
|
||||
progress_bar = ChromebrewProgressBar.new(file_size)
|
||||
|
||||
if verbose
|
||||
warn <<~EOT
|
||||
|
||||
@@ -2,7 +2,7 @@ require 'io/console'
|
||||
require_relative 'color'
|
||||
require_relative 'misc_functions'
|
||||
|
||||
class ProgressBar
|
||||
class ChromebrewProgressBar
|
||||
class InvalidSizeError < StandardError; end
|
||||
|
||||
attr_accessor :progress_bar_showing
|
||||
|
||||
Reference in New Issue
Block a user