awful 0.0.107 → 0.0.108
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 +14 -0
- data/lib/awful/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad58f56271094f479fc3a6fa01e4cf87e3333889
|
4
|
+
data.tar.gz: a30c008fac5e928d5dc13b9a32833ff88b8eb215
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82a83a209db9cc377a991570bc81847e1697a6caf815d948131915b2ce92bdb7709e892a9787183f2d6ffdb992a7628b89cd1e07439ca153f36eac0c66d746d4
|
7
|
+
data.tar.gz: 187d202f3338fab910de80e02d9716b36f38b2ba847f19e31f8ba451e1bb4a31c9aebb82a5ef5e3b38e3f266c3c53062eea8021d409852dde38ae8416f29c578
|
data/lib/awful/s3.rb
CHANGED
@@ -51,6 +51,20 @@ module Awful
|
|
51
51
|
end.tap { |list| puts list }
|
52
52
|
end
|
53
53
|
|
54
|
+
desc 'exists? NAME', 'test if bucket exists'
|
55
|
+
def exists?(bucket_name)
|
56
|
+
begin
|
57
|
+
s3.head_bucket(bucket: bucket_name) && true
|
58
|
+
rescue Aws::S3::Errors::NotFound
|
59
|
+
false
|
60
|
+
end.tap(&method(:puts))
|
61
|
+
end
|
62
|
+
|
63
|
+
desc 'empty? NAME', 'test if bucket is empty'
|
64
|
+
def empty?(bucket_name)
|
65
|
+
s3.list_objects(bucket: bucket_name, max_keys: 1).contents.empty?.tap(&method(:puts))
|
66
|
+
end
|
67
|
+
|
54
68
|
desc 'tagged [NAME_PREFIX]', 'list buckets matching given tags'
|
55
69
|
method_option :tags, aliases: '-t', type: :array, default: [], desc: 'List of tag=value to filter'
|
56
70
|
method_option :stack, aliases: '-s', type: :string, default: nil, desc: 'Filter by stack name'
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.108
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|