soundyoink 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eec0cd3b652fda1750336c78d610dfe14bddf26e
4
- data.tar.gz: 6c246193603c0f2aa4bcb574a465ea4632dacd6e
3
+ metadata.gz: 374e3d6dbb02237cea4513235ae85b146de88324
4
+ data.tar.gz: dc3556d8e1853d3bdf602dc33dbf05066b9dffe9
5
5
  SHA512:
6
- metadata.gz: bc595f9a7118ad868f90529152fb65a135ce7e2b11be197449ac854d09171e9a42c5a59630ccdc652a83198358bc300d6b4eaf64a682d621b012236bcc84319c
7
- data.tar.gz: b35137528abfad76258a7cc331f1b4baab3da96617e44f17ed85bebe3346fe93538b1b3b19fffd6ad70def1866cb38e9d7077720edb3fc0502be6a77e0e34567
6
+ metadata.gz: 911339a7a1c0b2ac47af5d8e6be1c41179324932ad4488f7642b49953f83747e630779dc3073c62e07b29d805a6d1e497bef99dc76e7938191e6943b094758b9
7
+ data.tar.gz: 00744af0e119983923a93aadb555d8794f859bbaeb8082a3f6c0c3786912dc39e8e92f5fb647aacea527d67f587da29931314a1627bc69e8f723f2a55f37ae2e
@@ -20,19 +20,18 @@ module Soundyoink
20
20
  # it already exists and is over 10 KB.
21
21
  def download
22
22
  return nil if already_exists?
23
- bar = ProgressBar.create(title: 'Downloading',
24
- length: 70,
25
- format: '%t |%B| %p%')
23
+ bar = ProgressBar.create(title: 'Downloading', format: '%t |%B| %p%')
26
24
  filesize = nil
27
25
  puts @filename
28
26
  target = open(@file_url, 'rb',
29
27
  content_length_proc: -> (size) { filesize = size },
30
28
  progress_proc: lambda do |accumulated|
29
+ # Set bar.progress to the 'percent complete' figure
31
30
  bar.progress = (accumulated.to_f / filesize * 100).to_i
32
31
  end
33
32
  )
34
33
  File.open(@filename, 'wb') do |f|
35
- while chunk = target.read(1000)
34
+ while chunk = target.read(1_000_000)
36
35
  f.write(chunk)
37
36
  end
38
37
  end
@@ -24,7 +24,8 @@ module Soundyoink
24
24
  def add_profile(profile)
25
25
  open(profile).read
26
26
  .scan(%r{(https://[^.]+[.]net/u/[^"]+)})
27
- .flatten.map { |a| @audios << Audio.new(a) }
27
+ .flatten
28
+ .map { |a| @audios << Audio.new(a) }
28
29
  end
29
30
 
30
31
  # +@workers+ number of threads work on the +@audios+ queue in parallel.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soundyoink
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Plant
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-11 00:00:00.000000000 Z
11
+ date: 2016-06-09 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Command-line utility for downloading SG material, either specific titles
14
14
  or entire user histories.