awspec 0.42.0 → 0.43.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: 269db3afd477e7b97500b7fa382400c9619b565c
4
- data.tar.gz: 3968c5248b90648e277fa1c104b097ee7a31e9bc
3
+ metadata.gz: 3908f21693538a15827e865b9f306930d23500aa
4
+ data.tar.gz: be9ff10f1c28606b1299b90a7b7203b144b99705
5
5
  SHA512:
6
- metadata.gz: 709a0207a1dfe54c95e75b7e5143207c6b1aca6eb97aa13edbed729940979617d6459974da673cf87973a231b15d34f420693a85743075b5faac2948995c788a
7
- data.tar.gz: a914e74d80c93295e185770f22e978089819e4f051fb134ef7190fb3110ce957b835c08b966342b2e168214351283c71e34f982f8100c5a6d912edcb567b8f11
6
+ metadata.gz: a8b2cc99e63161157d2013f234bb8f2fd38c6f5a58d1c3ffefcfa74a2f9c45b3f1141de5cf0340717214d6356f5468015a1119331908e0ee10b3145184d6aa53
7
+ data.tar.gz: b2b63b111a577951a50b6c61f64f90cfd0aca5a4daf1c39d43062321f2ab00c39f9599bdb29bff2aea37ffc62c25ecf03f66cd6924c4635dd78f9dd0fd58ba1f
@@ -25,11 +25,11 @@ Gem::Specification.new do |spec|
25
25
  spec.add_runtime_dependency 'aws-sdk', '~> 2.2.37'
26
26
  spec.add_runtime_dependency 'awsecrets', '~> 1.3.0'
27
27
  spec.add_runtime_dependency 'thor'
28
- spec.add_runtime_dependency 'activesupport'
28
+ spec.add_runtime_dependency 'activesupport', '~> 4.0'
29
29
  spec.add_runtime_dependency 'term-ansicolor'
30
30
  spec.add_development_dependency 'bundler', '~> 1.9'
31
31
  spec.add_development_dependency 'rake', '~> 10.0'
32
- spec.add_development_dependency 'rubocop'
32
+ spec.add_development_dependency 'rubocop', '~> 0.40.0'
33
33
  spec.add_development_dependency 'octorelease'
34
34
  spec.add_development_dependency 'pry'
35
35
  end
@@ -74,7 +74,15 @@ end
74
74
 
75
75
  ```ruby
76
76
  describe s3_bucket('my-bucket') do
77
- it { should have_logging_enabled(target_bukcet: 'my-log-bucket', target_prefix: 'logs/') }
77
+ it { should have_logging_enabled(target_bucket: 'my-log-bucket', target_prefix: 'logs/') }
78
+ end
79
+ ```
80
+
81
+ ### have_versioning_enabled
82
+
83
+ ```ruby
84
+ describe s3_bucket('my-bucket') do
85
+ it { should have_versioning_enabled }
78
86
  end
79
87
  ```
80
88
 
@@ -5,7 +5,7 @@
5
5
  1. Create your feature branch (`git checkout -b add-type-redshift`)
6
6
  2. Generate template files (`bundle exec bin/toolbox template redshift`)
7
7
  3. Fill files with code.
8
- 4. Generate [doc/resource_types.md](doc/resource_types.md) (`bundle exec bin/toolbox docgen > doc/resource_type.md`)
8
+ 4. Generate [doc/resource_types.md](doc/resource_types.md) (`bundle exec bin/toolbox docgen > doc/resource_types.md`)
9
9
  5. Run test (`bundle exec rake spec`)
10
10
  6. Push to the branch (`git push origin add-type-redshift`)
11
11
  7. Create a new Pull Request
@@ -1297,7 +1297,7 @@ end
1297
1297
 
1298
1298
  ```ruby
1299
1299
  describe s3_bucket('my-bucket') do
1300
- it { should have_logging_enabled(target_bukcet: 'my-log-bucket', target_prefix: 'logs/') }
1300
+ it { should have_logging_enabled(target_bucket: 'my-log-bucket', target_prefix: 'logs/') }
1301
1301
  end
1302
1302
  ```
1303
1303
 
@@ -1334,6 +1334,15 @@ end
1334
1334
  ```
1335
1335
 
1336
1336
 
1337
+ ### have_versioning_enabled
1338
+
1339
+ ```ruby
1340
+ describe s3_bucket('my-bucket') do
1341
+ it { should have_versioning_enabled }
1342
+ end
1343
+ ```
1344
+
1345
+
1337
1346
  ### its(:acl_grants_count), its(:acl_owner), its(:cors_rules_count), its(:name), its(:creation_date)
1338
1347
  ### :unlock: Advanced use
1339
1348
 
@@ -32,6 +32,12 @@ module Awspec::Helper
32
32
  nil
33
33
  end
34
34
 
35
+ def find_bucket_versioning(id)
36
+ s3_client.get_bucket_versioning(bucket: id)
37
+ rescue Aws::S3::Errors::NoSuchBucket
38
+ nil
39
+ end
40
+
35
41
  def select_all_buckets
36
42
  s3_client.list_buckets.buckets
37
43
  end
@@ -63,6 +63,10 @@ Aws.config[:s3] = {
63
63
  target_bucket: 'my-log-bucket',
64
64
  target_prefix: 'logs/'
65
65
  }
66
+ },
67
+ get_bucket_versioning: {
68
+ status: 'Enabled',
69
+ mfa_delete: 'Enabled'
66
70
  }
67
71
  }
68
72
  }
@@ -1,6 +1,6 @@
1
1
  module Awspec
2
2
  class Toolbox < Thor
3
- desc 'docgen > doc/resource_type.md', 'Generate doc/resource_type.md document'
3
+ desc 'docgen > doc/resource_types.md', 'Generate doc/resource_types.md document'
4
4
  def docgen
5
5
  puts Awspec::Generator::Doc::Type.generate_doc
6
6
  end
@@ -69,6 +69,11 @@ module Awspec::Type
69
69
  true
70
70
  end
71
71
 
72
+ def has_versioning_enabled?
73
+ bv = find_bucket_versioning(@id)
74
+ bv ? (bv.status == 'Enabled') : false
75
+ end
76
+
72
77
  private
73
78
 
74
79
  def cors_rules
@@ -1,3 +1,3 @@
1
1
  module Awspec
2
- VERSION = '0.42.0'
2
+ VERSION = '0.43.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.42.0
4
+ version: 0.43.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - k1LoW
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-17 00:00:00.000000000 Z
11
+ date: 2016-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -84,16 +84,16 @@ dependencies:
84
84
  name: activesupport
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '4.0'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '4.0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: term-ansicolor
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -140,16 +140,16 @@ dependencies:
140
140
  name: rubocop
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ">="
143
+ - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0'
145
+ version: 0.40.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0'
152
+ version: 0.40.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: octorelease
155
155
  requirement: !ruby/object:Gem::Requirement