awful 0.0.149 → 0.0.150

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/awful/s3.rb +15 -3
  3. data/lib/awful/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e57d00ae8d82a5f9567358f877adfe11f42c2b2
4
- data.tar.gz: 709fade131b43199128f2f0983a46860344bfcce
3
+ metadata.gz: 8b7d9b7be1ac2185b81f442844594a9dd27e8938
4
+ data.tar.gz: bab35536e53b2f6a82a559c012b0232da555cf7b
5
5
  SHA512:
6
- metadata.gz: 93972b5343ab4e2ef2201f6b0ffa1b78627ca0f139d532e7fa4a0646299e003f30a127deb340d305c3c2525769c1d5ef07502d36475ccc1b9022597c024be186
7
- data.tar.gz: 73fdb3e8539f4c76ab8e3b926da72bad42a50f94a055286f63bcb401864bbc53994cad0ab03c6df55f4b55916061499ba31d7ffddee30a03465ef40d5309a111
6
+ metadata.gz: 0cbf187ebba3eca77ccb2008dcc8c28dfcb1887d784d6035ea172396a28892cddb33edc394538ba5160b44de640eb65067ba61d88cd716046458127aedd6d892
7
+ data.tar.gz: c58ca7a89003c286dc0742c619cb799c12d4da5a3477dc391e7802ff98a6325b5f64d63bffb22a941e0a44333f05771b7b6828c11254fa39228538175f24c2f8
data/lib/awful/s3.rb CHANGED
@@ -94,6 +94,7 @@ module Awful
94
94
  end
95
95
  end
96
96
 
97
+ ## deprecated in favour of get below
97
98
  desc 'cat BUCKET/OBJECT', 'stream s3 object to stdout'
98
99
  def cat(path)
99
100
  bucket, key = path.split('/', 2)
@@ -102,6 +103,18 @@ module Awful
102
103
  end
103
104
  end
104
105
 
106
+ ## new version of cat
107
+ desc 'get BUCKET OBJECT [FILENAME]', 'get object from bucket'
108
+ def get(bucket, key, filename = nil)
109
+ if filename
110
+ s3.get_object(bucket: bucket, key: key, response_target: filename)
111
+ else
112
+ s3.get_object(bucket: bucket, key: key).output do |response|
113
+ puts response.body.read
114
+ end
115
+ end
116
+ end
117
+
105
118
  ## deprecated in favour of put below
106
119
  desc 'upload FILE BUCKET/OBJECT', 'upload FILE to given object'
107
120
  def upload(file, s3path)
@@ -110,11 +123,10 @@ module Awful
110
123
  end
111
124
 
112
125
  ## this is the new version of upload
113
- desc 'put BUCKET/OBJECT [FILE]', 'put object in bucket from file/stdin/string'
126
+ desc 'put BUCKET OBJECT [FILENAME]', 'put object in bucket from file/stdin/string'
114
127
  method_option :string, aliases: '-s', type: :string, default: nil, desc: 'send string instead of reading a file'
115
128
  method_option :kms, aliases: '-k', type: :string, default: nil, desc: 'KMS key ID for encryption'
116
- def put(s3path, filename = nil)
117
- bucket, key = s3path.split('/', 2)
129
+ def put(bucket, key, filename = nil)
118
130
  body = options.fetch('string', file_or_stdin(filename))
119
131
  s3.put_object(
120
132
  bucket: bucket,
data/lib/awful/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.149'
2
+ VERSION = '0.0.150'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.149
4
+ version: 0.0.150
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ric Lister