awspec 0.64.0 → 0.65.0

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
  SHA1:
3
- metadata.gz: d070c1be2beec227b12d8cd6a53b0d3ac4aba8d0
4
- data.tar.gz: 783e7fe04360753de3e60680ece3a3861f4f8cb2
3
+ metadata.gz: d7911fec1674e43a9b4d63b649c79a8e9ab947f1
4
+ data.tar.gz: 2106723c99932cc802a6d0c24395b5a1303ce181
5
5
  SHA512:
6
- metadata.gz: d73b5dbae0739a79209634ed275c35b2625ad05fe5fadbe4075bce94ba32d8ac327c9ff0f17f3114cea4d0cb088ee56b36e920fdc9085cb010be1da6bfc0789d
7
- data.tar.gz: aeaa99517adefad8f1929096332883781caa2f492527ad1febd50d2e8d3ff2440090f28757f34efc40705131abc2714c807d3792e5f43fda859b824f4c32d380
6
+ metadata.gz: ed58c94454f933395d0c25883e4c4612365e29548db81371e4f912373c97b7e906c4f9d1c6327c2532ddb41766d01de935f725140bd8a7e85def01440fb4688f
7
+ data.tar.gz: 3d6e0a8ac2c860aa0c6340c373780286a1512434f8371f575cd66b737e2dc40cac9f90aa5635422e5044d6609fed5bba23820d9d84f964fcbd71097f99897c96
@@ -71,6 +71,20 @@ describe s3_bucket('my-bucket') do
71
71
  end
72
72
  ```
73
73
 
74
+ ### have_lifecycle_rule
75
+
76
+ ```ruby
77
+ describe s3_bucket('my-bucket') do
78
+ it do
79
+ should have_lifecycle_rule(
80
+ id: 'MyRuleName',
81
+ noncurrent_version_expiration: { noncurrent_days: 1 },
82
+ status: 'Enabled'
83
+ )
84
+ end
85
+ end
86
+ ```
87
+
74
88
  ### have_logging_enabled
75
89
 
76
90
  ```ruby
@@ -1613,6 +1613,21 @@ end
1613
1613
  ```
1614
1614
 
1615
1615
 
1616
+ ### have_lifecycle_rule
1617
+
1618
+ ```ruby
1619
+ describe s3_bucket('my-bucket') do
1620
+ it do
1621
+ should have_lifecycle_rule(
1622
+ id: 'MyRuleName',
1623
+ noncurrent_version_expiration: { noncurrent_days: 1 },
1624
+ status: 'Enabled'
1625
+ )
1626
+ end
1627
+ end
1628
+ ```
1629
+
1630
+
1616
1631
  ### have_logging_enabled
1617
1632
 
1618
1633
  ```ruby
@@ -38,6 +38,12 @@ module Awspec::Helper
38
38
  nil
39
39
  end
40
40
 
41
+ def find_bucket_lifecycle_configuration(id)
42
+ s3_client.get_bucket_lifecycle_configuration(bucket: id)
43
+ rescue Aws::S3::Errors::ServiceError
44
+ nil
45
+ end
46
+
41
47
  def select_all_buckets
42
48
  s3_client.list_buckets.buckets
43
49
  end
@@ -80,6 +80,12 @@ module Awspec::Type
80
80
  bv ? (bv.status == 'Enabled') : false
81
81
  end
82
82
 
83
+ def has_lifecycle_rule?(rule)
84
+ lifecycle_configuration_rules.any? do |lc_rule|
85
+ rule.each { |key, value| lc_rule[key] == value }
86
+ end
87
+ end
88
+
83
89
  def has_mfa_delete_enabled?
84
90
  bv = find_bucket_versioning(id)
85
91
  bv ? (bv.mfa_delete == 'Enabled') : false
@@ -91,5 +97,10 @@ module Awspec::Type
91
97
  cors = find_bucket_cors(id)
92
98
  cors ? cors.cors_rules : []
93
99
  end
100
+
101
+ def lifecycle_configuration_rules
102
+ blc = find_bucket_lifecycle_configuration(id)
103
+ blc ? blc.rules : []
104
+ end
94
105
  end
95
106
  end
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.64.0'
2
+ VERSION = '0.65.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: awspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.64.0
4
+ version: 0.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-19 00:00:00.000000000 Z
11
+ date: 2017-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec