rubycfn 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1e1ddb4bc14986f09f2ae4323ece08e80fd690e2
4
+ data.tar.gz: 23340bef42fc6010b374681ae0370cbf91ccfefb
5
+ SHA512:
6
+ metadata.gz: 916800447fb3b053847f6b7de92004bd1f062c18d57ff1b069323a817ffdd21eb7ff344cb444cf868e10c3e590c2348448126a6c48593e649d84b8ed22f26822
7
+ data.tar.gz: c4f8c5bdf44b0e6c14517614ef815d14520745f0e3c17eb6c57d02610e6136c34792043250554bcb6e392feda34ca14d70158133c7300d666a5f3ecc152efbda
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ .idea/
2
+ *.swp
3
+ *.gem
4
+ *.rbc
5
+ .bundle
6
+ .config
7
+ .yardoc
8
+ /coverage
9
+ /doc/
10
+ .ruby-version
11
+ /test-reports
data/Gemfile ADDED
@@ -0,0 +1,2 @@
1
+ source "https://rubygems.org"
2
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,120 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rubycfn (0.0.8)
5
+ activesupport (~> 5.1.5)
6
+ json (~> 2.1.0)
7
+ neatjson (~> 0.8.4)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activesupport (5.1.6)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 0.7, < 2)
15
+ minitest (~> 5.1)
16
+ tzinfo (~> 1.1)
17
+ addressable (2.5.2)
18
+ public_suffix (>= 2.0.2, < 4.0)
19
+ awesome_print (1.8.0)
20
+ coderay (1.1.2)
21
+ concurrent-ruby (1.0.5)
22
+ diff-lcs (1.3)
23
+ docile (1.3.1)
24
+ ffi (1.9.25)
25
+ formatador (0.2.5)
26
+ given_core (3.8.0)
27
+ sorcerer (>= 0.3.7)
28
+ guard (2.14.2)
29
+ formatador (>= 0.2.4)
30
+ listen (>= 2.7, < 4.0)
31
+ lumberjack (>= 1.0.12, < 2.0)
32
+ nenv (~> 0.1)
33
+ notiffany (~> 0.0)
34
+ pry (>= 0.9.12)
35
+ shellany (~> 0.0)
36
+ thor (>= 0.18.1)
37
+ guard-compat (1.2.1)
38
+ guard-rspec (4.7.3)
39
+ guard (~> 2.1)
40
+ guard-compat (~> 1.1)
41
+ rspec (>= 2.99.0, < 4.0)
42
+ i18n (1.0.1)
43
+ concurrent-ruby (~> 1.0)
44
+ json (2.1.0)
45
+ launchy (2.4.3)
46
+ addressable (~> 2.3)
47
+ listen (3.1.5)
48
+ rb-fsevent (~> 0.9, >= 0.9.4)
49
+ rb-inotify (~> 0.9, >= 0.9.7)
50
+ ruby_dep (~> 1.2)
51
+ lumberjack (1.0.13)
52
+ method_source (0.9.0)
53
+ minitest (5.11.3)
54
+ neatjson (0.8.4)
55
+ nenv (0.3.0)
56
+ notiffany (0.1.1)
57
+ nenv (~> 0.1)
58
+ shellany (~> 0.0)
59
+ pry (0.11.3)
60
+ coderay (~> 1.1.0)
61
+ method_source (~> 0.9.0)
62
+ public_suffix (3.0.2)
63
+ rake (10.5.0)
64
+ rb-fsevent (0.10.3)
65
+ rb-inotify (0.9.10)
66
+ ffi (>= 0.5.0, < 2)
67
+ rspec (3.7.0)
68
+ rspec-core (~> 3.7.0)
69
+ rspec-expectations (~> 3.7.0)
70
+ rspec-mocks (~> 3.7.0)
71
+ rspec-core (3.7.1)
72
+ rspec-support (~> 3.7.0)
73
+ rspec-expectations (3.7.0)
74
+ diff-lcs (>= 1.2.0, < 2.0)
75
+ rspec-support (~> 3.7.0)
76
+ rspec-given (3.8.0)
77
+ given_core (= 3.8.0)
78
+ rspec (>= 2.14.0)
79
+ rspec-its (1.2.0)
80
+ rspec-core (>= 3.0.0)
81
+ rspec-expectations (>= 3.0.0)
82
+ rspec-mocks (3.7.0)
83
+ diff-lcs (>= 1.2.0, < 2.0)
84
+ rspec-support (~> 3.7.0)
85
+ rspec-support (3.7.1)
86
+ rspec_junit_formatter (0.4.1)
87
+ rspec-core (>= 2, < 4, != 2.12.0)
88
+ ruby_dep (1.5.0)
89
+ shellany (0.0.1)
90
+ simplecov (0.16.1)
91
+ docile (~> 1.1)
92
+ json (>= 1.8, < 3)
93
+ simplecov-html (~> 0.10.0)
94
+ simplecov-html (0.10.2)
95
+ sorcerer (1.0.2)
96
+ thor (0.20.0)
97
+ thread_safe (0.3.6)
98
+ tzinfo (1.2.5)
99
+ thread_safe (~> 0.1)
100
+
101
+ PLATFORMS
102
+ ruby
103
+
104
+ DEPENDENCIES
105
+ awesome_print (~> 1.2)
106
+ bundler (~> 1.7)
107
+ guard (~> 2.6)
108
+ guard-rspec (~> 4.3)
109
+ launchy (~> 2.4)
110
+ pry (~> 0.10)
111
+ rake (~> 10.3)
112
+ rspec (~> 3.2)
113
+ rspec-given (~> 3.7)
114
+ rspec-its (~> 1.2)
115
+ rspec_junit_formatter (~> 0.2)
116
+ rubycfn!
117
+ simplecov (~> 0.9)
118
+
119
+ BUNDLED WITH
120
+ 1.15.4
data/README.md ADDED
@@ -0,0 +1,216 @@
1
+ # RubyCfn
2
+
3
+ RubyCfn is a light-weight tiny CloudFormation DSL to make expressing
4
+ CloudFormation as Ruby code a bit more pleasing to the eye.
5
+
6
+ ## Installation
7
+
8
+ Type: `gem install rubycfn`
9
+
10
+ or, create a Gemfile with this content:
11
+
12
+ ```
13
+ source "https://rubygems.org"
14
+
15
+ gem "rubycfn", "~> 0.0.8"
16
+
17
+ ```
18
+
19
+ ## Example code
20
+
21
+ You can find stack examples at [https://github.com/dennisvink/rubycfn-example](https://github.com/dennisvink/rubycfn-example/)
22
+
23
+ ## Running specs
24
+
25
+ Type `rake` to run the tests. It tests if RubyCfn creates a valid
26
+ CloudFormation stack.
27
+
28
+ ## Example usage
29
+
30
+ ```ruby
31
+ require "rubycfn"
32
+
33
+ module DnsStack
34
+ extend ActiveSupport::Concern
35
+ include Rubycfn
36
+
37
+ included do
38
+ parameter :domain_name,
39
+ default: "example.com",
40
+ description: "Domain name for the HostedZone"
41
+
42
+ resource :hosted_zone,
43
+ type: "AWS::Route53::HostedZone" do |r|
44
+ r.property(:hosted_zone_config) do
45
+ {
46
+ Comment: [
47
+ "Hosted Zone for ",
48
+ "DomainName".ref
49
+ ].fnjoin
50
+ }
51
+ end
52
+ r.property(:name) { "DomainName".ref }
53
+ end
54
+
55
+ resource :hosted_zone_ses,
56
+ amount: 1,
57
+ type: "AWS::SES::ConfigurationSet" do |r|
58
+ r.depends_on "HostedZone"
59
+ r.property(:name) { ["HostedZone".ref, "_SESConfigurationSet"].fnjoin }
60
+ end
61
+
62
+ output :hosted_zone_id,
63
+ value: "HostedZone".ref,
64
+ description: "HostedZoneId",
65
+ export: {
66
+ "Name": ["AWS::StackName".ref, "HostedZoneId"].fnjoin(":")
67
+ }
68
+
69
+ end
70
+ end
71
+
72
+ MyDemoStack = include DnsStack
73
+ puts MyDemoStack.render_template
74
+
75
+ ```
76
+
77
+ The above code renders into this CloudFormation template:
78
+
79
+ ```json
80
+ {
81
+ "AWSTemplateFormatVersion": "2010-09-09",
82
+ "Parameters": {
83
+ "DomainName": {
84
+ "Default": "example.com",
85
+ "Description": "Domain name for the HostedZone",
86
+ "Type": "String"
87
+ }
88
+ },
89
+ "Resources": {
90
+ "HostedZone": {
91
+ "Properties": {
92
+ "HostedZoneConfig": {
93
+ "Comment": {
94
+ "Fn::Join": [
95
+ "",
96
+ [
97
+ "Hosted Zone for ",
98
+ {
99
+ "Ref": "DomainName"
100
+ }
101
+ ]
102
+ ]
103
+ }
104
+ },
105
+ "Name": {
106
+ "Ref": "DomainName"
107
+ }
108
+ },
109
+ "Type": "AWS::Route53::HostedZone"
110
+ },
111
+ "HostedZoneSes": {
112
+ "DependsOn": [
113
+ "HostedZone"
114
+ ],
115
+ "Properties": {
116
+ "Name": {
117
+ "Fn::Join": [
118
+ "",
119
+ [
120
+ {
121
+ "Ref": "HostedZone"
122
+ },
123
+ "_SESConfigurationSet"
124
+ ]
125
+ ]
126
+ }
127
+ },
128
+ "Type": "AWS::SES::ConfigurationSet"
129
+ }
130
+ },
131
+ "Outputs": {
132
+ "HostedZoneId": {
133
+ "Description": "HostedZoneId",
134
+ "Export": {
135
+ "Name": {
136
+ "Fn::Join": [
137
+ ":",
138
+ [
139
+ {
140
+ "Ref": "AWS::StackName"
141
+ },
142
+ "HostedZoneId"
143
+ ]
144
+ ]
145
+ }
146
+ },
147
+ "Value": {
148
+ "Ref": "HostedZone"
149
+ }
150
+ }
151
+ }
152
+ }
153
+ ```
154
+
155
+ I've deliberately added amount: 1 to the hosted_zone_ses resources, which is not
156
+ necessary as this defaults to 1 if you omit it. If you want multiple resources of
157
+ the same type just increase the amount. The resource names will be enumerated,
158
+ e.g. Resource, Resource2, Resource3, etc.
159
+
160
+ With |r, index| you will be have to access the index number of the generated
161
+ resource in the `index` variable.
162
+
163
+ For example:
164
+
165
+ ```ruby
166
+ resource :my_s3_bucket,
167
+ amount: 10,
168
+ type: "AWS::S3::Bucket" do |r, index|
169
+
170
+ r.property(:name) { "MyAwesomeBucket#{index+1}" }
171
+ end
172
+ ```
173
+
174
+ ## Implemented AWS functions
175
+
176
+ You can Ref by postpending the .ref method to any string. E.g. "string".ref
177
+ If you supply an argument to .ref it'll be rendered as Fn::GetAtt. Last but
178
+ not least, calling Fn::Join is achieved by postpending .fnjoin to an array.
179
+ You can provide it with an argument for the separator. By default its "".
180
+
181
+ You can use the following methods in the same fashion:
182
+
183
+ fnsplit, fnbase64, fnjoin and fnselect
184
+
185
+ ## Outputting to YAML
186
+
187
+ `brew install cfnflip`
188
+
189
+ or...
190
+
191
+ Paste the CloudFormation output in [cfnflip.com](https://cfnflip.com/) to
192
+ convert it to YAML format ;)
193
+
194
+ ## License
195
+
196
+ MIT License
197
+
198
+ Copyright (c) 2018 Dennis Vink
199
+
200
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
201
+ this software and associated documentation files (the "Software"), to deal in
202
+ the Software without restriction, including without limitation the rights to
203
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
204
+ of the Software, and to permit persons to whom the Software is furnished to do
205
+ so, subject to the following conditions:
206
+
207
+ The above copyright notice and this permission notice shall be included in all
208
+ copies or substantial portions of the Software.
209
+
210
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
211
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
212
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
213
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
214
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
215
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
216
+ THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,11 @@
1
+ require "bundler/gem_tasks"
2
+ Bundler::GemHelper.install_tasks
3
+
4
+ require "rspec/core/rake_task"
5
+ RSpec::Core::RakeTask.new do |t|
6
+ t.rspec_opts = \
7
+ " --format RspecJunitFormatter" \
8
+ " --out test-reports/rspec.xml"
9
+ end
10
+
11
+ task default: %i(spec)
@@ -0,0 +1,4 @@
1
+ # Rubycfn version
2
+ module Rubycfn
3
+ VERSION = "0.0.8"
4
+ end
data/lib/rubycfn.rb ADDED
@@ -0,0 +1,212 @@
1
+ # Rubycfn RubyCFN is a light-weight CloudFormation DSL
2
+ require "neatjson"
3
+ require "json"
4
+ require "rubycfn/version"
5
+ require 'active_support/concern'
6
+
7
+ @depends_on = []
8
+ @description = ""
9
+ @outputs = {}
10
+ @parameters = {}
11
+ @properties = {}
12
+ @resources = {}
13
+ @variables = {}
14
+ @global_variables = {}
15
+
16
+ # Monkey patching
17
+ class String
18
+ def cfnize
19
+ return self if self !~ /_/ && self =~ /[A-Z]+.*/
20
+ split('_').map{|e| e.capitalize}.join
21
+ end
22
+
23
+ def ref(attr = nil)
24
+ unless attr
25
+ return { Ref: self }
26
+ end
27
+ return { "Fn::GetAtt": [ self, attr ] }
28
+ end
29
+
30
+ def fnsplit(separator = "")
31
+ {
32
+ "Fn::Split": [
33
+ separator,
34
+ self
35
+ ]
36
+ }
37
+ end
38
+
39
+ def fnbase64
40
+ return { "Fn::Base64": self }
41
+ end
42
+
43
+ def fngetazs
44
+ return { "Fn::GetAZs": self }
45
+ end
46
+ end
47
+
48
+ class Array
49
+ def fnjoin(separator = "")
50
+ {
51
+ "Fn::Join": [
52
+ separator,
53
+ self
54
+ ]
55
+ }
56
+ end
57
+
58
+ def fnselect(index = 0)
59
+ {
60
+ "Fn::Select": [
61
+ index,
62
+ self
63
+ ]
64
+ }
65
+ end
66
+ end
67
+
68
+ class ::Hash
69
+ def deep_merge(second)
70
+ merger = proc { |key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : Array === v1 && Array === v2 ? v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2 }
71
+ self.merge(second.to_h, &merger)
72
+ end
73
+
74
+ def recursive_compact
75
+ delete_if do |k, v|
76
+ (v.respond_to?(:empty?) ? v.empty? : !v) or v.instance_of?(Hash) && v.recursive_compact.empty?
77
+ end
78
+ end
79
+
80
+ def compact
81
+ delete_if { |k, v| v.nil? }
82
+ end
83
+ end
84
+
85
+ module Rubycfn
86
+ extend ActiveSupport::Concern
87
+
88
+ included do
89
+ def self.method_missing(name, *args)
90
+ super unless TOPLEVEL_BINDING.eval("@variables[:#{name}]") || \
91
+ TOPLEVEL_BINDING.eval("@global_variables[:#{name}]")
92
+ if TOPLEVEL_BINDING.eval("@variables[:#{name}]")
93
+ TOPLEVEL_BINDING.eval("@variables[:#{name}]")
94
+ else
95
+ TOPLEVEL_BINDING.eval("@global_variables[:#{name}]")
96
+ end
97
+ end
98
+
99
+ def self.description(description)
100
+ TOPLEVEL_BINDING.eval("@description = '#{description}'")
101
+ end
102
+
103
+ def self.parameter(name, arguments)
104
+ name = name.to_s.cfnize
105
+ arguments[:type] ||= "String"
106
+
107
+ param = {
108
+ "Type": arguments[:type],
109
+ "Default": arguments[:default],
110
+ "AllowedValues": arguments[:allowed_values],
111
+ "Description": arguments[:description]
112
+ }.compact
113
+ res = {
114
+ "#{name}": param
115
+ }
116
+
117
+ TOPLEVEL_BINDING.eval("@parameters = @parameters.deep_merge(#{res})")
118
+ end
119
+
120
+ def self.output(name, arguments)
121
+ name = name.to_s.cfnize
122
+ param = {
123
+ "Description": arguments[:description],
124
+ "Value": arguments[:value],
125
+ "Export": arguments[:export]
126
+ }.compact
127
+ res = {
128
+ "#{name}": param
129
+ }
130
+
131
+ TOPLEVEL_BINDING.eval("@outputs = @outputs.deep_merge(#{res})")
132
+ end
133
+
134
+ def self.variable(name, arguments = {})
135
+ arguments[:default] ||= ""
136
+ arguments[:value] ||= ""
137
+ arguments[:required] ||= false
138
+ arguments[:global] ||= false
139
+
140
+ if arguments[:value].empty?
141
+ arguments[:value] = arguments[:default]
142
+ if arguments[:required]
143
+ if arguments[:value].empty?
144
+ raise "Property `#{name}` is required."
145
+ end
146
+ end
147
+ end
148
+
149
+ res = {
150
+ "#{name}": arguments[:value]
151
+ }
152
+ if arguments[:global] == false
153
+ TOPLEVEL_BINDING.eval("@variables = @variables.deep_merge(#{res})")
154
+ else
155
+ TOPLEVEL_BINDING.eval("@global_variables = @global_variables.deep_merge(#{res})")
156
+ TOPLEVEL_BINDING.eval("@variables = @variables.deep_merge(#{res})")
157
+ end
158
+ end
159
+
160
+ def self.depends_on(resources)
161
+ case resources
162
+ when String
163
+ resources = [resources.cfnize]
164
+ when Array
165
+ resources = resources.map { |r| r.cfnize }
166
+ end
167
+ TOPLEVEL_BINDING.eval("@depends_on = #{resources}")
168
+ end
169
+
170
+ def self.property(name, index = 0, &block)
171
+ name = TOPLEVEL_BINDING.eval("'#{name}'.cfnize")
172
+ res = { "#{name}": yield(block) }
173
+ TOPLEVEL_BINDING.eval("@properties = @properties.deep_merge(#{res})")
174
+ end
175
+
176
+ def self.resource(name, arguments, &block)
177
+ arguments[:amount] ||= 1
178
+ name = name.to_s.cfnize
179
+ arguments[:amount].times do |i|
180
+ yield self, i if block_given?
181
+ res = {
182
+ "#{name.to_s}#{i == 0 ? "" : i+1}": {
183
+ Properties: TOPLEVEL_BINDING.eval("@properties"),
184
+ Type: arguments[:type]
185
+ }
186
+ }
187
+ TOPLEVEL_BINDING.eval("@resources = @resources.deep_merge(#{res})")
188
+ end
189
+ TOPLEVEL_BINDING.eval("@depends_on = []")
190
+ TOPLEVEL_BINDING.eval("@properties = {}")
191
+ end
192
+
193
+ def self.sort_json(obj)
194
+ JSON.parse(
195
+ JSON.neat_generate(obj, sort: true)
196
+ )
197
+ end
198
+
199
+ def self.render_template
200
+ skeleton = { "AWSTemplateFormatVersion": "2010-09-09" }
201
+ skeleton = JSON.parse(skeleton.to_json)
202
+ skeleton.merge!(Description: TOPLEVEL_BINDING.eval("@description"))
203
+ skeleton.merge!(Parameters: sort_json(TOPLEVEL_BINDING.eval("@parameters")))
204
+ skeleton.merge!(Resources: sort_json(TOPLEVEL_BINDING.eval("@resources")))
205
+ skeleton.merge!(Outputs: sort_json(TOPLEVEL_BINDING.eval("@outputs")))
206
+ TOPLEVEL_BINDING.eval("@variables = @resources = @outputs = @properties = @parameters = {}")
207
+ TOPLEVEL_BINDING.eval("@depends_on = []")
208
+ TOPLEVEL_BINDING.eval("@description = ''")
209
+ JSON.pretty_generate(skeleton.recursive_compact)
210
+ end
211
+ end
212
+ end
data/rubycfn.gemspec ADDED
@@ -0,0 +1,36 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "rubycfn/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "rubycfn"
8
+ spec.version = Rubycfn::VERSION
9
+ spec.authors = ["Dennis Vink"]
10
+ spec.email = ["dennis@drvink.com"]
11
+ spec.summary = "Rubycfn"
12
+ spec.description = "RubyCFN is a light-weight CloudFormation DSL"
13
+ spec.homepage = "https://github.com/dennisvink/rubycfn"
14
+ spec.required_ruby_version = ">= 2.2.0"
15
+ spec.license = "MIT"
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.test_files = spec.files.grep(/(?:test|spec|features)/)
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_runtime_dependency "neatjson", "~> 0.8.4"
21
+ spec.add_runtime_dependency "json", "~> 2.1.0"
22
+ spec.add_runtime_dependency "activesupport", "~> 5.1.5"
23
+
24
+ spec.add_development_dependency "awesome_print", "~> 1.2"
25
+ spec.add_development_dependency "bundler", "~> 1.7"
26
+ spec.add_development_dependency "guard-rspec", "~> 4.3"
27
+ spec.add_development_dependency "guard", "~> 2.6"
28
+ spec.add_development_dependency "launchy", "~> 2.4"
29
+ spec.add_development_dependency "pry", "~> 0.10"
30
+ spec.add_development_dependency "rake", "~> 10.3"
31
+ spec.add_development_dependency "rspec", "~> 3.2"
32
+ spec.add_development_dependency "rspec-given", "~> 3.7"
33
+ spec.add_development_dependency "rspec-its", "~> 1.2"
34
+ spec.add_development_dependency "rspec_junit_formatter", "~> 0.2"
35
+ spec.add_development_dependency "simplecov", "~> 0.9"
36
+ end
@@ -0,0 +1,21 @@
1
+ require "spec_helper"
2
+
3
+ require "rubycfn"
4
+ require "active_support/concern"
5
+
6
+ describe Rubycfn do
7
+
8
+ module RSpec
9
+ include Rubycfn
10
+ end
11
+
12
+ context "renders template" do
13
+ let(:template) { JSON.parse(RSpec.render_template) }
14
+ subject { template }
15
+
16
+ it { should_not have_key 'Parameters' }
17
+ it { should_not have_key 'Outputs' }
18
+ it { should_not have_key 'Resources' }
19
+ it { should have_key 'AWSTemplateFormatVersion' }
20
+ end
21
+ end
@@ -0,0 +1,26 @@
1
+ require "simplecov"
2
+ SimpleCov.start do
3
+ add_filter "/spec/"
4
+ end
5
+
6
+ require "json"
7
+ require "launchy"
8
+ require "rspec"
9
+ require "rspec/its"
10
+ require "rspec/given"
11
+
12
+ RSpec.configure do |config|
13
+ config.color = true
14
+ config.formatter = "documentation"
15
+
16
+ config.mock_with :rspec do |c|
17
+ c.syntax = %i(should expect)
18
+ end
19
+
20
+ config.filter_run_excluding broken: true
21
+ config.filter_run_excluding turn_off: true
22
+ config.filter_run focus: true
23
+ config.run_all_when_everything_filtered = true
24
+ config.filter_run_excluding :slow unless ENV["SLOW_SPECS"]
25
+ config.filter_run_excluding :debug unless ENV["DEBUG_SPECS"]
26
+ end
metadata ADDED
@@ -0,0 +1,267 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rubycfn
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.8
5
+ platform: ruby
6
+ authors:
7
+ - Dennis Vink
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-06-10 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: neatjson
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.4
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.4
27
+ - !ruby/object:Gem::Dependency
28
+ name: json
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: activesupport
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: 5.1.5
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: 5.1.5
55
+ - !ruby/object:Gem::Dependency
56
+ name: awesome_print
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.2'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.2'
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.7'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.7'
83
+ - !ruby/object:Gem::Dependency
84
+ name: guard-rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.3'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.3'
97
+ - !ruby/object:Gem::Dependency
98
+ name: guard
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '2.6'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '2.6'
111
+ - !ruby/object:Gem::Dependency
112
+ name: launchy
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '2.4'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '2.4'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0.10'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.10'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '10.3'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '10.3'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rspec
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '3.2'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '3.2'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rspec-given
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: '3.7'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "~>"
179
+ - !ruby/object:Gem::Version
180
+ version: '3.7'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rspec-its
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.2'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.2'
195
+ - !ruby/object:Gem::Dependency
196
+ name: rspec_junit_formatter
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '0.2'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '0.2'
209
+ - !ruby/object:Gem::Dependency
210
+ name: simplecov
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '0.9'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '0.9'
223
+ description: RubyCFN is a light-weight CloudFormation DSL
224
+ email:
225
+ - dennis@drvink.com
226
+ executables: []
227
+ extensions: []
228
+ extra_rdoc_files: []
229
+ files:
230
+ - ".gitignore"
231
+ - Gemfile
232
+ - Gemfile.lock
233
+ - README.md
234
+ - Rakefile
235
+ - lib/rubycfn.rb
236
+ - lib/rubycfn/version.rb
237
+ - rubycfn.gemspec
238
+ - spec/lib/rubycfn_spec.rb
239
+ - spec/spec_helper.rb
240
+ homepage: https://github.com/dennisvink/rubycfn
241
+ licenses:
242
+ - MIT
243
+ metadata: {}
244
+ post_install_message:
245
+ rdoc_options: []
246
+ require_paths:
247
+ - lib
248
+ required_ruby_version: !ruby/object:Gem::Requirement
249
+ requirements:
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: 2.2.0
253
+ required_rubygems_version: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ requirements: []
259
+ rubyforge_project:
260
+ rubygems_version: 2.6.7
261
+ signing_key:
262
+ specification_version: 4
263
+ summary: Rubycfn
264
+ test_files:
265
+ - rubycfn.gemspec
266
+ - spec/lib/rubycfn_spec.rb
267
+ - spec/spec_helper.rb