Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/omnibus/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,11 @@ def reset!
# @return [Integer]
default(:build_retries, 0)

# Display a progress bar during download.
#
# @return [true, false]
default(:enable_progress_bar, true)

# Use the incremental build caching implemented via git. This will
# drastically improve build times, but may result in hidden and
# unexpected bugs.
Expand Down
5 changes: 3 additions & 2 deletions lib/omnibus/download_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ def download_file!(from_url, to_path, download_options = {})

# Regular HTTP download using OpenURI
# :enable_progress_bar is a special option we handle.
# by default we enable the progress bar.
# by default we enable the progress bar, see: ./config.rb
# the options.delete is here to still handle the override from ./licensing.rb
enable_progress_bar = options.delete(:enable_progress_bar)
enable_progress_bar = true if enable_progress_bar.nil?
enable_progress_bar = Config.enable_progress_bar if enable_progress_bar.nil?

# Safely extract download headers if they exist and ensure we send
# Accept-Encoding => "identity" by default (tests and some proxies expect it)
Expand Down
1 change: 1 addition & 0 deletions spec/unit/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module Omnibus
include_examples "a configurable", :solaris_linker_mapfile, "files/mapfiles/solaris"
include_examples "a configurable", :append_timestamp, true
include_examples "a configurable", :build_retries, 0
include_examples "a configurable", :enable_progress_bar, true
include_examples "a configurable", :use_git_caching, true
include_examples "a configurable", :fetcher_read_timeout, 60
include_examples "a configurable", :fetcher_retries, 5
Expand Down