progress_download 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a8b3ec914a2c4c4c094c4092f2ce287d1456231bd85ba06de906286f6232e33
4
- data.tar.gz: 15e1671829c921eedc564bd412c0ca91b9a20d5174cbf3aa41a299bc04e3ebcc
3
+ metadata.gz: 235c52cf3d6ac47f73ca74486c4c09986af9e0a6a1f30c83c8b70fd150e5f764
4
+ data.tar.gz: 03dc9fb00adb6ed6334666ff6b0eef302ef63af8a094ca27dde7f01c6fda7561
5
5
  SHA512:
6
- metadata.gz: 74a4509bf80d977de5a55d126e844b5ca83c2c4e851723061307659d4986afdb0aca287300ae40cec826b17a221ca8e5116b9962d77b93d3ecb088a81cf307a9
7
- data.tar.gz: 36525dce0ebaf028c6f8a4c9470867d11df9de3e437db0e6703175f116e424d0b1230bc1e57f6925b7f15e7780c4f5777c17b9c376c5ad632d166e8e41eb6657
6
+ metadata.gz: 8efbd0317b2118c262caab4b6db1800f4312e62879c1e195af653d68ae6a55ac1f3b2dc889c42da79db3ac0f4f21c60c6ab120b2f2ccaeb1e5c2de275111ca0f
7
+ data.tar.gz: 7fcaf289d84cc77270da37353c4da6bbf9733dd5ae4382043e7592c4bcbc55d2f61bc70eb21d875e49da4353b132b628c6a067421b0b35c20904f851c2734a9b
data/README.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # Progress Download
2
- > Simple customisable progress bar in Ruby.
2
+ > Simple customisable progress bar for downloading remote files in Ruby.
3
+
4
+ ## Installation
5
+ In your shell:
6
+ ```shell
7
+ gem install progress_download
8
+ ```
9
+ or, form source
10
+ ```shell
11
+ git clone https://github.com/Demonstrandum/progress_download.git
12
+ cd progress_download/
13
+ ```
14
+ Then install it:
15
+ ```shell
16
+ gem build progress_download.gemspec
17
+ gem install progress_download-*
18
+ ```
19
+ or use it directly:
20
+ ```shell
21
+ ruby -Ilib bin/* [OPTIONS] ... [URL]
22
+ # or just copy the lib direcotry to where you need it
23
+ ```
3
24
 
4
25
  ## Usage
5
26
  You may test it out in your terminal by doing:
@@ -8,7 +29,16 @@ progress-download [STYLE] [URI]
8
29
  # For example
9
30
  progress-download --style pump http://ipv4.download.thinkbroadband.com/10MB.zip
10
31
  ```
11
- In Ruby
32
+ Output should look something like:
33
+ ```shell
34
+ ‘10MB.zip’ — 8.44 / 10.0 MiB at 1.76 MiB/s in 4.78s
35
+ ⠴ [ █████████████████████████████████████████████▒▒▒▒▒▒▒▒▒ ] 84%
36
+ # ...
37
+ ‘10MB.zip’ — 10.00 / 10.0 MiB at 1.85 MiB/s in 5.41s
38
+ ⠶ [ ██████████████████████████████████████████████████████ ] 100%
39
+ ```
40
+ where the bar fills the entier width of the terminal
41
+ ### In Ruby
12
42
  ```ruby
13
43
  # Basic usage
14
44
  url = 'http://ipv4.download.thinkbroadband.com/10MB.zip'
@@ -21,7 +51,6 @@ ProgressBar.download url, :location => '~/Downloads', :style => :classic, :speed
21
51
  - `:style` is `:dots`
22
52
  - `:speed` is `1`
23
53
  and
24
- - `:refresh` is 0.125
54
+ - `:refresh` is `0.125`
25
55
 
26
- `:refresh` is the amount of time between 'frames' in seconds, by this `:speed` is how many times the spinner updates per frame drawn, meaning thusly that
27
- `: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.
56
+ `: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.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
- require 'progress_bar'
2
+ require 'progress_download'
3
3
 
4
4
  style = ARGV.include?('--style') ? ARGV[ARGV.index('--style') + 1] : :dots
5
5
  if ARGV.include? '--style'
@@ -7,4 +7,4 @@ if ARGV.include? '--style'
7
7
  ARGV.delete '--style'
8
8
  end
9
9
 
10
- ProgressBar.download ARGV[0], :spinner => style
10
+ ProgressDownload.download ARGV[0], :spinner => style
@@ -1,7 +1,7 @@
1
1
  Dir["#{File.dirname __FILE__}/progress_download/*.rb"].each { |f| require f }
2
2
 
3
3
  module ProgressDownload
4
- VERSIONS = { :major => 0, :minor => 1, :tiny => 0 }.freeze
4
+ VERSIONS = { :major => 0, :minor => 1, :tiny => 1 }.freeze
5
5
 
6
6
  def self.version *args
7
7
  VERSIONS.flatten.select.with_index { |_, i| i.odd? }.join '.'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: progress_download
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Demonstrandum