drud 0.0.8 → 0.0.9

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/drud/s3.rb +16 -2
  3. data/lib/drud/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ea9d9b3b4678a16f8a614f7cadd8985166b9630
4
- data.tar.gz: e54457cdcd1b609282810131f9750ac16c7d1be3
3
+ metadata.gz: 91ff33878895a220d1248d664abea2708625b205
4
+ data.tar.gz: 01bf78c7ec9c09c7300e3095e54314bf636a766d
5
5
  SHA512:
6
- metadata.gz: e5cbaf70a11de40abcd93d05b762b25c08541b8dc1c560520afa818c78e9ba1a383ae5105f7c587b8c2c4ee04a920f7a695bb50116f2ab40c1e8850a17ba8d01
7
- data.tar.gz: 156f30e3e5fd2c891287c302b56b127b24cd9b707b5ebcb21045fff366478761bd54dbca59f756d2967e47be385111b01ad0fad488052b1d1bbbcf505ff6a9de
6
+ metadata.gz: 2cb4226ff6d33ddff0c8a462e03fc90137cf4a453410559950fc4a54ef0974f4abb4984256eed55bc1c48f65abfdfe28994f285bf4abadf395feb3695938b956
7
+ data.tar.gz: e2f25d846c1f190eec0879c63929b284e948ecb4b369e596fc1a5f152f1326b716ba7f78e3f87baac2afeef3893c4d6089bfe32e2d782009dc1e2484d6b0cb24
@@ -36,14 +36,28 @@ module Drud
36
36
  latest
37
37
  end
38
38
  # Get a client encrypted s3Object
39
- def get(s3Object)
39
+ def get(s3Object, destination)
40
40
  key = Base64.decode64(@aws_utf_symmetric_key).encode('ascii-8bit')
41
41
  options = { encryption_key: key }
42
- File.open(s3Object.key.split('/').last, 'wb') do |file|
42
+ dest = File.join(destination, s3Object.key.split('/').last)
43
+ cl = Humanize::Byte.new(s3Object.content_length)
44
+ mb = "#{cl.to_m}".to_f.round(2)
45
+ gb = "#{cl.to_g}".to_f.round(2)
46
+ size = "#{gb} GB" if mb >= 1000.00
47
+ size = "#{mb} MB" if mb < 1000.00
48
+ count = 0
49
+
50
+ print "#{s3Object.key} (#{size}) \n>"
51
+ $stdout.sync = true
52
+ File.open(dest, 'wb') do |file|
43
53
  s3Object.read(options) do |chunk|
54
+ print '=' if count % 1000 == 0
44
55
  file.write(chunk)
56
+ count += 1
45
57
  end
46
58
  end
59
+ print '<'
60
+ puts "\n#{dest}"
47
61
  end
48
62
  # Describe an s3Object
49
63
  def describe(s3Object)
@@ -2,5 +2,5 @@
2
2
  # be more efficient.
3
3
  module Drud
4
4
  # The drud version number.
5
- VERSION = '0.0.8'
5
+ VERSION = '0.0.9'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: drud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Bridges