Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

progress_download

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

progress_download

  • 0.1.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Progress Download

Simple customisable progress bar for downloading remote files in Ruby.

Installation

In your shell:

gem install progress_download

or, form source

git clone https://github.com/Demonstrandum/progress_download.git
cd progress_download/

Then install it:

gem build progress_download.gemspec
gem install progress_download-*

or use it directly:

ruby -Ilib bin/* [OPTIONS] ... [URL]
# or just copy the lib direcotry to where you need it

Usage

You may test it out in your terminal by doing:

progress-download [STYLE] [URI]
# For example
progress-download --style pump http://ipv4.download.thinkbroadband.com/10MB.zip

Output should look something like:

‘10MB.zip’ — 8.44 / 10.0 MiB at 1.76 MiB/s in 4.78s
⠴ [ █████████████████████████████████████████████▒▒▒▒▒▒▒▒▒ ]  84%
# ...
‘10MB.zip’ — 10.00 / 10.0 MiB at 1.85 MiB/s in 5.41s
⠶ [ ██████████████████████████████████████████████████████ ] 100%

where the bar fills the entier width of the terminal

In Ruby

# Basic usage
url = 'http://ipv4.download.thinkbroadband.com/10MB.zip'
ProgressBar.download url
# More advanced options include:
ProgressBar.download url, :location => '~/Downloads', :style => :classic, :speed => 0.1, :refresh => 0.5

By default:

  • :location is the current working directory (Dir.getwd)
  • :style is :dots
  • :speed is 1 and
  • :refresh is 0.125

:refresh is the amount of time between each 'frame' in seconds, by this, :speed is how many times the spinner updates per frame drawn, meaning thusly that :speed must be 1 or less, 1 meaning that the spinner advances one step for every 'frame' drawn, and 0.5 would be every second frame, etc.

FAQs

Package last updated on 20 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc