cloud_formation 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -10
- data/cloud_formation.gemspec +2 -2
- data/lib/cloud_formation/dynamo_db.rb +2 -1
- data/lib/cloud_formation/version.rb +1 -1
- data/test/dynamo_db_test.rb +22 -0
- data/test/template_test.rb +24 -0
- data/test/templates/dynamo_db/basic.json +19 -0
- data/test/templates/template/default.json +1 -0
- data/test/templates/template/pretty.json +6 -0
- data/test/test_helper.rb +8 -0
- metadata +20 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7947c1d9043cf5c8121895f04ea632dee1db5d5f
|
4
|
+
data.tar.gz: be5a73638e103ddafa4a018b5cfef1ff13a53572
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fd95397e280ef0232a3dab26df66ed336418af34a8ad2391332bad492c8bb4ad9f55375d265167a56d011a52e043ecf2433f0f558450629f0a3847c3ac784a6
|
7
|
+
data.tar.gz: d57179e2befc0fc92e4118328ae88895d6a3e90581b75bfb635834e821ef04e3ee1e395668b9af9c30ce97616b186a9a7ed6ee80df92afce1fa49e5411f430d1
|
data/README.md
CHANGED
@@ -77,16 +77,16 @@ Running with the `pretty true` options will generate an easier to read version:
|
|
77
77
|
"ProvisionedThroughput": {
|
78
78
|
"WriteCapacityUnits": "5",
|
79
79
|
"ReadCapacityUnits": "10"
|
80
|
-
}
|
81
|
-
},
|
82
|
-
"KeySchema": {
|
83
|
-
"RangeKeyElement": {
|
84
|
-
"AttributeName": "comment_id",
|
85
|
-
"AttributeType": "N"
|
86
80
|
},
|
87
|
-
"
|
88
|
-
"
|
89
|
-
|
81
|
+
"KeySchema": {
|
82
|
+
"RangeKeyElement": {
|
83
|
+
"AttributeName": "comment_id",
|
84
|
+
"AttributeType": "N"
|
85
|
+
},
|
86
|
+
"HashKeyElement": {
|
87
|
+
"AttributeName": "blog_post_id",
|
88
|
+
"AttributeType": "N"
|
89
|
+
}
|
90
90
|
}
|
91
91
|
}
|
92
92
|
}
|
@@ -96,7 +96,7 @@ Running with the `pretty true` options will generate an easier to read version:
|
|
96
96
|
|
97
97
|
## Contributing
|
98
98
|
|
99
|
-
1. Fork it ( http://github.com
|
99
|
+
1. Fork it ( http://github.com/davidrhyswhite/cloud_formation/fork )
|
100
100
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
101
101
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
102
102
|
4. Push to the branch (`git push origin my-new-feature`)
|
data/cloud_formation.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ["david.white@spry-soft.com"]
|
11
11
|
spec.summary = %q{A Ruby gem to create AWS CloudFormation descriptions.}
|
12
12
|
spec.description = spec.summary
|
13
|
-
spec.homepage = ""
|
13
|
+
spec.homepage = "https://github.com/davidrhyswhite/cloud_formation"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
@@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_development_dependency "bundler", "~> 1.5"
|
22
|
-
spec.add_development_dependency "rake"
|
22
|
+
spec.add_development_dependency "rake", "~> 10.1"
|
23
23
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class DynamoDBTest < Minitest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@dynamo_db = CloudFormation::DynamoDB.new
|
7
|
+
|
8
|
+
@dynamo_db.build_table do |t|
|
9
|
+
t.name = "tableName"
|
10
|
+
t.read_capacity_units = 10
|
11
|
+
t.write_capacity_units = 5
|
12
|
+
t.hash_key = { column_one_id: :number }
|
13
|
+
t.range_key = { column_two_id: :number }
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_basic
|
18
|
+
expected = @dynamo_db.serialize
|
19
|
+
assert_equal load_fixture("dynamo_db/basic"), expected
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TemplateTest < Minitest::Test
|
4
|
+
|
5
|
+
def setup
|
6
|
+
@template = CloudFormation::Template.new
|
7
|
+
|
8
|
+
@template.build do |t|
|
9
|
+
t.name = "stack-name"
|
10
|
+
t.description = "A description of the stack"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def test_default
|
15
|
+
rendered = @template.render
|
16
|
+
assert_equal load_fixture("template/default"), JSON.parse(rendered)
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_pretty
|
20
|
+
rendered = @template.render pretty: true
|
21
|
+
assert_equal load_fixture("template/default"), JSON.parse(rendered)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
{
|
2
|
+
"Type": "AWS::DynamoDB::Table",
|
3
|
+
"Properties": {
|
4
|
+
"ProvisionedThroughput": {
|
5
|
+
"WriteCapacityUnits": "5",
|
6
|
+
"ReadCapacityUnits": "10"
|
7
|
+
},
|
8
|
+
"KeySchema": {
|
9
|
+
"RangeKeyElement": {
|
10
|
+
"AttributeName": "column_two_id",
|
11
|
+
"AttributeType": "N"
|
12
|
+
},
|
13
|
+
"HashKeyElement": {
|
14
|
+
"AttributeName": "column_one_id",
|
15
|
+
"AttributeType": "N"
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"AWSTemplateFormatVersion":"2010-09-09","Name":"stack-name","Description":"A description of the stack","Resources":{}}
|
data/test/test_helper.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloud_formation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David White
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '10.1'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '10.1'
|
41
41
|
description: A Ruby gem to create AWS CloudFormation descriptions.
|
42
42
|
email:
|
43
43
|
- david.white@spry-soft.com
|
@@ -57,7 +57,13 @@ files:
|
|
57
57
|
- lib/cloud_formation/refinements.rb
|
58
58
|
- lib/cloud_formation/template.rb
|
59
59
|
- lib/cloud_formation/version.rb
|
60
|
-
|
60
|
+
- test/dynamo_db_test.rb
|
61
|
+
- test/template_test.rb
|
62
|
+
- test/templates/dynamo_db/basic.json
|
63
|
+
- test/templates/template/default.json
|
64
|
+
- test/templates/template/pretty.json
|
65
|
+
- test/test_helper.rb
|
66
|
+
homepage: https://github.com/davidrhyswhite/cloud_formation
|
61
67
|
licenses:
|
62
68
|
- MIT
|
63
69
|
metadata: {}
|
@@ -81,4 +87,10 @@ rubygems_version: 2.2.0
|
|
81
87
|
signing_key:
|
82
88
|
specification_version: 4
|
83
89
|
summary: A Ruby gem to create AWS CloudFormation descriptions.
|
84
|
-
test_files:
|
90
|
+
test_files:
|
91
|
+
- test/dynamo_db_test.rb
|
92
|
+
- test/template_test.rb
|
93
|
+
- test/templates/dynamo_db/basic.json
|
94
|
+
- test/templates/template/default.json
|
95
|
+
- test/templates/template/pretty.json
|
96
|
+
- test/test_helper.rb
|