s3_zipper 1.0.2 → 1.0.3

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: 84332cb30a6a397fec7d8177f0e8d3280029390fc59df29cfc3e87751d46e71c
4
- data.tar.gz: d77c52979e0fa24a212a764aec88d615b87c6cc0733f1b8880a7a3789ca84b6c
3
+ metadata.gz: 1df86be6cbf4a8a1faf25f919821e021dbb532663d72ffe5eed7e5093dc1ce0a
4
+ data.tar.gz: 5d8adcb636fc848363268db0d8ef20b8a8cb9abf7b1c01ddd762ffa0079ca821
5
5
  SHA512:
6
- metadata.gz: 130d0dab10c03d8fb6dadd9169875bd146dd2e881aa8b5cae9846d751044337b890d3b0cb3e180a4cf069b52406844ef946aa8a7d5316bdf28cc7f273a48eb70
7
- data.tar.gz: 7f81076f24d724a998dc044422a139590a78ee75ad50a09df2e5b695f02e78b071b495b66df19e0206239cd175c7abe582f807b465954695a38e37a90d2bde98
6
+ metadata.gz: 55722eca67823cd8ff98b6638b5526c0e3c5a6f1bd3659e00f4b38c2a68264e459422de0abbbf588fcb24fcc39437f43d1492333237d6baf4457d58bd2d7a007
7
+ data.tar.gz: 3d10cd54337e44e344a5e3ea047d9f34d48e6fd756528b65dd931e14d801da2921dd577a2eefb5fb65ec8f8e8aa31b368a7ce43890cb453cb13a47f143471c14
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- s3_zipper (1.0.2)
4
+ s3_zipper (1.0.3)
5
5
  aws-sdk-s3 (~> 1)
6
6
  ruby-progressbar (~> 1)
7
7
  rubyzip (>= 1.0.0)
data/exe/s3_zipper CHANGED
@@ -4,11 +4,21 @@ require "s3_zipper"
4
4
  require 'thor'
5
5
  require 'awesome_print'
6
6
  class CLI < Thor
7
- desc 'zip_to_ FILES', 'zip files from s3'
8
- options filename: :string
7
+ desc 'local_file FILES', 'zip files from s3 to a local file'
8
+ method_option :filename, type: :string, aliases: 'f', desc: 'Name of the created zip archive'
9
+ method_option :bucket, type: :string, default: ENV['AWS_BUCKET'], required: !ENV['AWS_BUCKET'].nil?, aliases: 'b', desc: 'Name of the bucket the files are in'
9
10
 
10
- def zip(*files)
11
- S3Zipper.new(ENV['AWS_BUCKET']).zip_files(files)
11
+ def local_file(*files)
12
+ S3Zipper.new(options[:bucket]).zip_to_local_file(files, file: options[:filename] || SecureRandom.hex)
13
+ end
14
+
15
+ desc 's3 FILES', 'zip files from s3 to s3'
16
+ method_option :filename, type: :string, aliases: 'f', desc: 'Name of the created zip archive'
17
+ method_option :path, type: :string, aliases: 'p', desc: 'Path to the file in s3'
18
+ method_option :bucket, type: :string, default: ENV['AWS_BUCKET'], required: !ENV['AWS_BUCKET'].nil?, aliases: 'b', desc: 'Name of the bucket the files are in'
19
+
20
+ def s3(*files)
21
+ S3Zipper.new(options[:bucket]).zip_to_s3(files, filename: options[:filename] || SecureRandom.hex, path: options[:path])
12
22
  end
13
23
  end
14
24
  CLI.start(ARGV)
@@ -1,3 +1,3 @@
1
1
  class S3Zipper
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_zipper
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Capshare