awful 0.0.149 → 0.0.150
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/s3.rb +15 -3
- data/lib/awful/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b7d9b7be1ac2185b81f442844594a9dd27e8938
|
4
|
+
data.tar.gz: bab35536e53b2f6a82a559c012b0232da555cf7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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(
|
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