awful 0.0.107 → 0.0.108

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 +14 -0
  3. data/lib/awful/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 51063a3a1c4c58bab96dfa743006f334a9ffbdb5
4
- data.tar.gz: f6bf657fb70555adad45c6b0878bd921e83da297
3
+ metadata.gz: ad58f56271094f479fc3a6fa01e4cf87e3333889
4
+ data.tar.gz: a30c008fac5e928d5dc13b9a32833ff88b8eb215
5
5
  SHA512:
6
- metadata.gz: 383850d370c8e8b791b0208c22749917576a37fc494b1fe849d2f59b04f0fb5abf616b959c4a73dd6819c868e8f8e519f891ae9e5029c9abb8852a3157c0edb0
7
- data.tar.gz: 3eeed77f798bfb99032b9b7435f6b0c9ec87e662476f02ff89b6a288b00f344d4f3629a495bc126b68622a88b96d4a3efbcabcbe01b42ee19127041e0cf1e96c
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
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.107'
2
+ VERSION = '0.0.108'
3
3
  end
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.107
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-25 00:00:00.000000000 Z
11
+ date: 2016-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler