codebuild 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/codebuild.gemspec +8 -3
- data/lib/codebuild/version.rb +1 -1
- data/vendor/aws_data/CHANGELOG.md +7 -0
- data/vendor/aws_data/Gemfile +4 -0
- data/{docs/LICENSE → vendor/aws_data/LICENSE.txt} +4 -4
- data/vendor/aws_data/README.md +42 -0
- data/vendor/aws_data/Rakefile +6 -0
- data/vendor/aws_data/aws_data.gemspec +30 -0
- data/vendor/aws_data/bin/console +14 -0
- data/vendor/aws_data/bin/setup +8 -0
- data/vendor/aws_data/lib/aws_data.rb +91 -0
- data/vendor/aws_data/lib/aws_data/version.rb +3 -0
- data/vendor/aws_data/spec/aws_data_spec.rb +5 -0
- data/vendor/aws_data/spec/spec_helper.rb +14 -0
- data/vendor/cfn-status/Gemfile +4 -0
- data/vendor/cfn-status/LICENSE.txt +21 -0
- data/vendor/cfn-status/README.md +56 -0
- data/vendor/cfn-status/Rakefile +6 -0
- data/vendor/cfn-status/bin/console +14 -0
- data/vendor/cfn-status/bin/setup +8 -0
- data/vendor/cfn-status/cfn-status.gemspec +30 -0
- data/vendor/cfn-status/lib/cfn/aws_service.rb +56 -0
- data/vendor/cfn-status/lib/cfn/status.rb +220 -0
- data/vendor/cfn-status/lib/cfn/status/version.rb +5 -0
- data/vendor/cfn-status/spec/cfn/status_spec.rb +81 -0
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json +1080 -0
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json +1080 -0
- data/vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json +1086 -0
- data/vendor/cfn-status/spec/spec_helper.rb +14 -0
- data/vendor/cfn_camelizer/CHANGELOG.md +10 -0
- data/vendor/cfn_camelizer/Gemfile +4 -0
- data/vendor/cfn_camelizer/LICENSE.txt +21 -0
- data/vendor/cfn_camelizer/README.md +40 -0
- data/vendor/cfn_camelizer/Rakefile +6 -0
- data/vendor/cfn_camelizer/bin/console +14 -0
- data/vendor/cfn_camelizer/bin/setup +8 -0
- data/vendor/cfn_camelizer/cfn_camelizer.gemspec +32 -0
- data/vendor/cfn_camelizer/lib/camelizer.yml +33 -0
- data/vendor/cfn_camelizer/lib/cfn_camelizer.rb +92 -0
- data/vendor/cfn_camelizer/lib/cfn_camelizer/version.rb +3 -0
- data/vendor/cfn_camelizer/spec/cfn_camelizer_spec.rb +79 -0
- data/vendor/cfn_camelizer/spec/spec_helper.rb +14 -0
- metadata +46 -173
- data/docs/.gitignore +0 -4
- data/docs/CNAME +0 -1
- data/docs/Gemfile +0 -3
- data/docs/README.md +0 -25
- data/docs/_config.yml +0 -73
- data/docs/_docs/contributing.md +0 -99
- data/docs/_docs/conventions.md +0 -51
- data/docs/_docs/deploy.md +0 -69
- data/docs/_docs/dsl.md +0 -12
- data/docs/_docs/dsl/project.md +0 -80
- data/docs/_docs/dsl/role.md +0 -79
- data/docs/_docs/dsl/schedule.md +0 -29
- data/docs/_docs/examples.md +0 -12
- data/docs/_docs/examples/ecs.md +0 -107
- data/docs/_docs/examples/jets.md +0 -79
- data/docs/_docs/examples/ruby.md +0 -44
- data/docs/_docs/github_oauth.md +0 -51
- data/docs/_docs/install.md +0 -14
- data/docs/_docs/next-steps.md +0 -16
- data/docs/_docs/settings.md +0 -34
- data/docs/_docs/start.md +0 -51
- data/docs/_docs/type-option.md +0 -72
- data/docs/_docs/variables.md +0 -117
- data/docs/_includes/commands.html +0 -88
- data/docs/_includes/content.html +0 -25
- data/docs/_includes/edit-on-github.html +0 -9
- data/docs/_includes/examples-steps.md +0 -17
- data/docs/_includes/footer.html +0 -41
- data/docs/_includes/google_analytics.html +0 -10
- data/docs/_includes/head.html +0 -45
- data/docs/_includes/js.html +0 -15
- data/docs/_includes/nav.html +0 -17
- data/docs/_includes/prev_next.md +0 -19
- data/docs/_includes/reference.md +0 -1
- data/docs/_includes/subnav.html +0 -38
- data/docs/_includes/tutorials.md +0 -38
- data/docs/_layouts/default.html +0 -12
- data/docs/_reference/cb-completion.md +0 -44
- data/docs/_reference/cb-completion_script.md +0 -25
- data/docs/_reference/cb-delete.md +0 -26
- data/docs/_reference/cb-deploy.md +0 -58
- data/docs/_reference/cb-init.md +0 -88
- data/docs/_reference/cb-start.md +0 -43
- data/docs/_reference/cb-version.md +0 -21
- data/docs/_sass/_bootstrap-overrides.scss +0 -40
- data/docs/_sass/_contact.scss +0 -49
- data/docs/_sass/_cta.scss +0 -37
- data/docs/_sass/_download.scss +0 -31
- data/docs/_sass/_features.scss +0 -47
- data/docs/_sass/_footer.scss +0 -49
- data/docs/_sass/_global.scss +0 -102
- data/docs/_sass/_main.scss +0 -364
- data/docs/_sass/_masthead.scss +0 -70
- data/docs/_sass/_mixins.scss +0 -79
- data/docs/_sass/_navbar.scss +0 -92
- data/docs/_sass/_syntax.scss +0 -65
- data/docs/_sass/_table.scss +0 -34
- data/docs/_sass/_timeline.scss +0 -207
- data/docs/_sass/_variables.scss +0 -24
- data/docs/bin/web +0 -8
- data/docs/docs.md +0 -22
- data/docs/img/docs/codebuild-output.png +0 -0
- data/docs/img/logos/boltops-logo-full.png +0 -0
- data/docs/img/logos/boltops-logo.png +0 -0
- data/docs/img/logos/project-logo.png +0 -0
- data/docs/index.html +0 -35
- data/docs/js/nav.js +0 -39
- data/docs/js/new-age.js +0 -38
- data/docs/js/new-age.min.js +0 -6
- data/docs/new-age.scss +0 -20
- data/docs/quick-start.md +0 -72
- data/docs/reference.md +0 -12
- data/docs/support.md +0 -22
- data/docs/vendor/bootstrap/css/bootstrap-grid.css +0 -1339
- data/docs/vendor/bootstrap/css/bootstrap-grid.css.map +0 -1
- data/docs/vendor/bootstrap/css/bootstrap-grid.min.css +0 -1
- data/docs/vendor/bootstrap/css/bootstrap-grid.min.css.map +0 -1
- data/docs/vendor/bootstrap/css/bootstrap-reboot.css +0 -459
- data/docs/vendor/bootstrap/css/bootstrap-reboot.css.map +0 -1
- data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css +0 -1
- data/docs/vendor/bootstrap/css/bootstrap-reboot.min.css.map +0 -1
- data/docs/vendor/bootstrap/css/bootstrap.css +0 -9320
- data/docs/vendor/bootstrap/css/bootstrap.css.map +0 -1
- data/docs/vendor/bootstrap/css/bootstrap.min.css +0 -6
- data/docs/vendor/bootstrap/css/bootstrap.min.css.map +0 -1
- data/docs/vendor/bootstrap/js/bootstrap.js +0 -3535
- data/docs/vendor/bootstrap/js/bootstrap.min.js +0 -7
- data/docs/vendor/font-awesome/css/font-awesome.css +0 -2337
- data/docs/vendor/font-awesome/css/font-awesome.min.css +0 -4
- data/docs/vendor/font-awesome/fonts/FontAwesome.otf +0 -0
- data/docs/vendor/font-awesome/fonts/fontawesome-webfont.eot +0 -0
- data/docs/vendor/font-awesome/fonts/fontawesome-webfont.svg +0 -2671
- data/docs/vendor/font-awesome/fonts/fontawesome-webfont.ttf +0 -0
- data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff +0 -0
- data/docs/vendor/font-awesome/fonts/fontawesome-webfont.woff2 +0 -0
- data/docs/vendor/font-awesome/less/animated.less +0 -34
- data/docs/vendor/font-awesome/less/bordered-pulled.less +0 -25
- data/docs/vendor/font-awesome/less/core.less +0 -12
- data/docs/vendor/font-awesome/less/fixed-width.less +0 -6
- data/docs/vendor/font-awesome/less/font-awesome.less +0 -18
- data/docs/vendor/font-awesome/less/icons.less +0 -789
- data/docs/vendor/font-awesome/less/larger.less +0 -13
- data/docs/vendor/font-awesome/less/list.less +0 -19
- data/docs/vendor/font-awesome/less/mixins.less +0 -60
- data/docs/vendor/font-awesome/less/path.less +0 -15
- data/docs/vendor/font-awesome/less/rotated-flipped.less +0 -20
- data/docs/vendor/font-awesome/less/screen-reader.less +0 -5
- data/docs/vendor/font-awesome/less/stacked.less +0 -20
- data/docs/vendor/font-awesome/less/variables.less +0 -799
- data/docs/vendor/font-awesome/scss/_animated.scss +0 -34
- data/docs/vendor/font-awesome/scss/_bordered-pulled.scss +0 -25
- data/docs/vendor/font-awesome/scss/_core.scss +0 -12
- data/docs/vendor/font-awesome/scss/_fixed-width.scss +0 -6
- data/docs/vendor/font-awesome/scss/_icons.scss +0 -789
- data/docs/vendor/font-awesome/scss/_larger.scss +0 -13
- data/docs/vendor/font-awesome/scss/_list.scss +0 -19
- data/docs/vendor/font-awesome/scss/_mixins.scss +0 -60
- data/docs/vendor/font-awesome/scss/_path.scss +0 -15
- data/docs/vendor/font-awesome/scss/_rotated-flipped.scss +0 -20
- data/docs/vendor/font-awesome/scss/_screen-reader.scss +0 -5
- data/docs/vendor/font-awesome/scss/_stacked.scss +0 -20
- data/docs/vendor/font-awesome/scss/_variables.scss +0 -799
- data/docs/vendor/font-awesome/scss/font-awesome.scss +0 -18
- data/docs/vendor/jquery-easing/jquery.easing.compatibility.js +0 -59
- data/docs/vendor/jquery-easing/jquery.easing.js +0 -166
- data/docs/vendor/jquery-easing/jquery.easing.min.js +0 -1
- data/docs/vendor/jquery/jquery.js +0 -10253
- data/docs/vendor/jquery/jquery.min.js +0 -4
- data/docs/vendor/simple-line-icons/css/simple-line-icons.css +0 -778
- data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.eot +0 -0
- data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.svg +0 -200
- data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.ttf +0 -0
- data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff +0 -0
- data/docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff2 +0 -0
- data/docs/vendor/simple-line-icons/less/simple-line-icons.less +0 -982
- data/docs/vendor/simple-line-icons/scss/simple-line-icons.scss +0 -979
- data/docs/vendor/tether/tether.js +0 -1811
- data/docs/vendor/tether/tether.min.js +0 -1
- data/spec/fixtures/app/.codebuild/project.rb +0 -2
- data/spec/fixtures/app/.codebuild/role.rb +0 -1
- data/spec/fixtures/app/.codebuild/schedule.rb +0 -1
- data/spec/fixtures/app/.codebuild/settings.yml +0 -13
- data/spec/lib/cli_spec.rb +0 -13
- data/spec/lib/project_spec.rb +0 -12
- data/spec/lib/role_spec.rb +0 -12
- data/spec/lib/schedule_spec.rb +0 -12
- data/spec/spec_helper.rb +0 -35
@@ -0,0 +1,14 @@
|
|
1
|
+
require "bundler/setup"
|
2
|
+
require "cfn/status"
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
# Enable flags like --only-failures and --next-failure
|
6
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
7
|
+
|
8
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
9
|
+
config.disable_monkey_patching!
|
10
|
+
|
11
|
+
config.expect_with :rspec do |c|
|
12
|
+
c.syntax = :expect
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2019 Tung Nguyen
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# CfnCamelizer
|
2
|
+
|
3
|
+
Camelizer for CloudFormation.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'cfn_camelizer'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install cfn_camelizer
|
20
|
+
|
21
|
+
## Usage
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
data = {my_data: 1}
|
25
|
+
CfnCamelizer.transform(data) => {"MyData" => 1}
|
26
|
+
```
|
27
|
+
|
28
|
+
## Development
|
29
|
+
|
30
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
31
|
+
|
32
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
33
|
+
|
34
|
+
## Contributing
|
35
|
+
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/cfn_camelizer.
|
37
|
+
|
38
|
+
## License
|
39
|
+
|
40
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "cfn_camelizer"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "cfn_camelizer/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "cfn_camelizer"
|
8
|
+
spec.version = CfnCamelizer::VERSION
|
9
|
+
spec.authors = ["Tung Nguyen"]
|
10
|
+
spec.email = ["tongueroo@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = "Cfn Camelizer"
|
13
|
+
spec.homepage = "https://github.com/tongueroo/cfn_camelizer"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
# Specify which files should be added to the gem when it is released.
|
17
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
18
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
19
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
end
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
|
+
|
25
|
+
spec.add_dependency "activesupport"
|
26
|
+
spec.add_dependency "memoist"
|
27
|
+
spec.add_dependency "rainbow"
|
28
|
+
|
29
|
+
spec.add_development_dependency "bundler"
|
30
|
+
spec.add_development_dependency "rake"
|
31
|
+
spec.add_development_dependency "rspec"
|
32
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
special_keys:
|
3
|
+
Aws: AWS
|
4
|
+
# Very fine grain control, since these map rules are scoped to specific resources
|
5
|
+
# After the special_keys map for backwards compatibility.
|
6
|
+
resource_keys: # specific to resource types
|
7
|
+
AWS::AutoScaling::AutoScalingGroup:
|
8
|
+
ServiceLinkedRoleArn: ServiceLinkedRoleARN
|
9
|
+
TargetGroupArns: TargetGroupARNs
|
10
|
+
VpcZoneIdentifier: VPCZoneIdentifier
|
11
|
+
AutoScaling::LaunchConfiguration:
|
12
|
+
ClassicLinkVpcId: ClassicLinkVPCId
|
13
|
+
ClassicLinkVpcSecurityGroups: ClassicLinkVPCSecurityGroups
|
14
|
+
AWS::AutoScaling::LifecycleHook:
|
15
|
+
NotificationTargetArn: NotificationTargetARN
|
16
|
+
RoleArn: RoleARN
|
17
|
+
AWS::ApplicationAutoScaling::ScalableTarget:
|
18
|
+
RoleArn: RoleARN
|
19
|
+
AWS::CloudFormation::Stack:
|
20
|
+
NotificationArns: NotificationARNs
|
21
|
+
TemplateUrl: TemplateURL
|
22
|
+
AWS::Route53::RecordSet:
|
23
|
+
Ttl: TTL
|
24
|
+
AWS::RDS::DBSubnetGroup:
|
25
|
+
DbSubnetGroupDescription: DBSubnetGroupDescription
|
26
|
+
DbSubnetGroupName: DBSubnetGroupName
|
27
|
+
AWS::SQS::Queue:
|
28
|
+
DeadLetterTargetArn: deadLetterTargetArn # under RedrivePolicy
|
29
|
+
MaxReceiveCount: maxReceiveCount # under RedrivePolicy
|
30
|
+
passthrough_parent_keys:
|
31
|
+
- Fn::Sub # https://amzn.to/2HKwxri
|
32
|
+
- ResponseParameters # API Gateway MethodResponse https://amzn.to/2HKw0Wk
|
33
|
+
- Variables # Lambda Environment Variables https://amzn.to/2HLlttV
|
@@ -0,0 +1,92 @@
|
|
1
|
+
require "cfn_camelizer/version"
|
2
|
+
require "memoist"
|
3
|
+
require "yaml"
|
4
|
+
require "rainbow/ext/string"
|
5
|
+
require "active_support/core_ext/string"
|
6
|
+
require "active_support/core_ext/hash"
|
7
|
+
|
8
|
+
class CfnCamelizer
|
9
|
+
class << self
|
10
|
+
extend Memoist
|
11
|
+
|
12
|
+
def transform(value, parent_keys=[], resource_type=nil)
|
13
|
+
case value
|
14
|
+
when Array
|
15
|
+
value.map { |v| transform(v, parent_keys, resource_type) }
|
16
|
+
when Hash
|
17
|
+
if value.keys.include?(:type)
|
18
|
+
resource_type ||= value[:type]
|
19
|
+
end
|
20
|
+
|
21
|
+
initializer = value.map do |k, v|
|
22
|
+
new_key = camelize_key(k, parent_keys, resource_type)
|
23
|
+
[new_key, transform(v, parent_keys+[new_key], resource_type)]
|
24
|
+
end
|
25
|
+
Hash[initializer]
|
26
|
+
else
|
27
|
+
value # do not transform values
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def camelize_key(k, parent_keys=[], resource_type=nil)
|
32
|
+
k = k.to_s
|
33
|
+
|
34
|
+
if passthrough?(k, parent_keys)
|
35
|
+
k # pass through untouch
|
36
|
+
elsif parent_keys.last == "EventPattern" # top-level
|
37
|
+
k.dasherize
|
38
|
+
elsif parent_keys.include?("EventPattern")
|
39
|
+
# Any keys at 2nd level under EventPattern will be pascalized
|
40
|
+
pascalize(k)
|
41
|
+
else
|
42
|
+
camelize(k, resource_type)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def passthrough?(k, parent_keys)
|
47
|
+
# Do not transform keys under certain parent keys or keys that contain - or /
|
48
|
+
passthrough = camelizer_yaml["passthrough_parent_keys"]
|
49
|
+
intersection = parent_keys & passthrough
|
50
|
+
!intersection.empty? || k.include?('-') || k.include?('/')
|
51
|
+
end
|
52
|
+
|
53
|
+
def camelize(value, resource_type=nil)
|
54
|
+
return value if value.is_a?(Integer)
|
55
|
+
|
56
|
+
value = value.to_s.camelize
|
57
|
+
v = special_map[value] || value # after the special_keys map
|
58
|
+
resource_map(resource_type)[v] || v
|
59
|
+
end
|
60
|
+
|
61
|
+
def pascalize(value)
|
62
|
+
new_value = value.camelize
|
63
|
+
first_char = new_value[0..0].downcase
|
64
|
+
new_value[0] = first_char
|
65
|
+
new_value
|
66
|
+
end
|
67
|
+
|
68
|
+
# Some keys have special mappings
|
69
|
+
def special_map
|
70
|
+
camelizer_yaml["special_keys"]
|
71
|
+
end
|
72
|
+
|
73
|
+
def resource_map(resource_type)
|
74
|
+
camelizer_yaml["resource_keys"][resource_type] || {}
|
75
|
+
end
|
76
|
+
|
77
|
+
def camelizer_yaml
|
78
|
+
# default
|
79
|
+
path = File.expand_path("camelizer.yml", File.dirname(__FILE__))
|
80
|
+
default = YAML.load_file(path)
|
81
|
+
# project specific
|
82
|
+
path = "#{Dir.pwd}/configs/camelizer.yml"
|
83
|
+
if File.exist?(path)
|
84
|
+
project = YAML.load_file(path)
|
85
|
+
default.deep_merge(project)
|
86
|
+
else
|
87
|
+
default
|
88
|
+
end
|
89
|
+
end
|
90
|
+
memoize :camelizer_yaml
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,79 @@
|
|
1
|
+
RSpec.describe CfnCamelizer do
|
2
|
+
let(:camelizer) { CfnCamelizer }
|
3
|
+
context "not camelize the special cases" do
|
4
|
+
it "transform should not transform keys under Fn::Sub" do
|
5
|
+
data = {"UserData"=>{"Fn::Sub"=>["hello", {"k1"=>"v1", "k2"=>"v2"}]}}
|
6
|
+
result = camelizer.transform(data)
|
7
|
+
expect(result).to eq(data)
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
it "simple string" do
|
12
|
+
s = "foo_bar"
|
13
|
+
s = camelizer.camelize(s)
|
14
|
+
expect(s).to eq "FooBar"
|
15
|
+
end
|
16
|
+
|
17
|
+
it "transform keys" do
|
18
|
+
h = {foo_bar: 1}
|
19
|
+
result = camelizer.transform(h)
|
20
|
+
result.keys == ["FooBar"]
|
21
|
+
end
|
22
|
+
|
23
|
+
it "do not pasalize anything under Variables" do
|
24
|
+
h = {foo_bar: 1, variables: {dont_touch: 2}}
|
25
|
+
result = camelizer.transform(h)
|
26
|
+
# pp result
|
27
|
+
expect(result).to eq("FooBar"=>1, "Variables"=>{"dont_touch"=>2})
|
28
|
+
end
|
29
|
+
|
30
|
+
# CloudWatch Event patterns have slightly different casing
|
31
|
+
it "dasherize anything under EventPattern at the top level" do
|
32
|
+
h = {foo_bar: 1, event_pattern: {dash_me: 2}}
|
33
|
+
result = camelizer.transform(h)
|
34
|
+
# pp result
|
35
|
+
expect(result).to eq("FooBar"=>1, "EventPattern"=>{"dash-me"=>2})
|
36
|
+
end
|
37
|
+
|
38
|
+
it "camelize anything under EventPattern at any level beyond the top level" do
|
39
|
+
h = {foo_bar: 1, event_pattern: {dash_me: {camelize_me: 3}}}
|
40
|
+
result = camelizer.transform(h)
|
41
|
+
# pp result
|
42
|
+
expect(result).to eq("FooBar"=>1, "EventPattern"=>{"dash-me"=>{"camelizeMe"=>3}})
|
43
|
+
end
|
44
|
+
|
45
|
+
it "dont touch anything under ResponseParameters" do
|
46
|
+
h = {foo_bar: 1, response_parameters: {dont_touch: 3}}
|
47
|
+
result = camelizer.transform(h)
|
48
|
+
# pp result
|
49
|
+
expect(result).to eq("FooBar"=>1, "ResponseParameters"=>{"dont_touch"=>3})
|
50
|
+
end
|
51
|
+
|
52
|
+
it "dont touch anything with - or /" do
|
53
|
+
h = {foo_bar: 1, "has-dash": 2, "has/slash": 3,"application/json":4}
|
54
|
+
result = camelizer.transform(h)
|
55
|
+
# pp result
|
56
|
+
expect(result).to eq("FooBar"=>1, "has-dash"=>2,"has/slash"=>3,"application/json"=>4)
|
57
|
+
end
|
58
|
+
|
59
|
+
it "special map keys" do
|
60
|
+
h = {template_url: 1, ttl: 60}
|
61
|
+
result = camelizer.transform(h)
|
62
|
+
# pp result
|
63
|
+
expect(result).to eq("TemplateURL"=>1, "TTL"=> 60)
|
64
|
+
end
|
65
|
+
|
66
|
+
it "role_arn property under AWS::Events::Rule type maintains normal RoleArn camelization" do
|
67
|
+
h = {
|
68
|
+
events_rule: {
|
69
|
+
type: "AWS::Events::Rule",
|
70
|
+
properties: {
|
71
|
+
role_arn: "some.arn"
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
result = camelizer.transform(h)
|
76
|
+
# pp result
|
77
|
+
expect(result).to eq({"EventsRule"=>{"Type"=>"AWS::Events::Rule", "Properties"=>{"RoleArn"=>"some.arn"}}})
|
78
|
+
end
|
79
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require "bundler/setup"
|
2
|
+
require "cfn_camelizer"
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
# Enable flags like --only-failures and --next-failure
|
6
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
7
|
+
|
8
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
9
|
+
config.disable_monkey_patching!
|
10
|
+
|
11
|
+
config.expect_with :rspec do |c|
|
12
|
+
c.syntax = :expect
|
13
|
+
end
|
14
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codebuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: aws_data
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - ">="
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: aws-sdk-cloudformation
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -243,145 +229,6 @@ files:
|
|
243
229
|
- README.md
|
244
230
|
- Rakefile
|
245
231
|
- codebuild.gemspec
|
246
|
-
- docs/.gitignore
|
247
|
-
- docs/CNAME
|
248
|
-
- docs/Gemfile
|
249
|
-
- docs/LICENSE
|
250
|
-
- docs/README.md
|
251
|
-
- docs/_config.yml
|
252
|
-
- docs/_docs/contributing.md
|
253
|
-
- docs/_docs/conventions.md
|
254
|
-
- docs/_docs/deploy.md
|
255
|
-
- docs/_docs/dsl.md
|
256
|
-
- docs/_docs/dsl/project.md
|
257
|
-
- docs/_docs/dsl/role.md
|
258
|
-
- docs/_docs/dsl/schedule.md
|
259
|
-
- docs/_docs/examples.md
|
260
|
-
- docs/_docs/examples/ecs.md
|
261
|
-
- docs/_docs/examples/jets.md
|
262
|
-
- docs/_docs/examples/ruby.md
|
263
|
-
- docs/_docs/github_oauth.md
|
264
|
-
- docs/_docs/install.md
|
265
|
-
- docs/_docs/next-steps.md
|
266
|
-
- docs/_docs/settings.md
|
267
|
-
- docs/_docs/start.md
|
268
|
-
- docs/_docs/type-option.md
|
269
|
-
- docs/_docs/variables.md
|
270
|
-
- docs/_includes/commands.html
|
271
|
-
- docs/_includes/content.html
|
272
|
-
- docs/_includes/edit-on-github.html
|
273
|
-
- docs/_includes/examples-steps.md
|
274
|
-
- docs/_includes/footer.html
|
275
|
-
- docs/_includes/google_analytics.html
|
276
|
-
- docs/_includes/head.html
|
277
|
-
- docs/_includes/js.html
|
278
|
-
- docs/_includes/nav.html
|
279
|
-
- docs/_includes/prev_next.md
|
280
|
-
- docs/_includes/reference.md
|
281
|
-
- docs/_includes/subnav.html
|
282
|
-
- docs/_includes/tutorials.md
|
283
|
-
- docs/_layouts/default.html
|
284
|
-
- docs/_reference/cb-completion.md
|
285
|
-
- docs/_reference/cb-completion_script.md
|
286
|
-
- docs/_reference/cb-delete.md
|
287
|
-
- docs/_reference/cb-deploy.md
|
288
|
-
- docs/_reference/cb-init.md
|
289
|
-
- docs/_reference/cb-start.md
|
290
|
-
- docs/_reference/cb-version.md
|
291
|
-
- docs/_sass/_bootstrap-overrides.scss
|
292
|
-
- docs/_sass/_contact.scss
|
293
|
-
- docs/_sass/_cta.scss
|
294
|
-
- docs/_sass/_download.scss
|
295
|
-
- docs/_sass/_features.scss
|
296
|
-
- docs/_sass/_footer.scss
|
297
|
-
- docs/_sass/_global.scss
|
298
|
-
- docs/_sass/_main.scss
|
299
|
-
- docs/_sass/_masthead.scss
|
300
|
-
- docs/_sass/_mixins.scss
|
301
|
-
- docs/_sass/_navbar.scss
|
302
|
-
- docs/_sass/_syntax.scss
|
303
|
-
- docs/_sass/_table.scss
|
304
|
-
- docs/_sass/_timeline.scss
|
305
|
-
- docs/_sass/_variables.scss
|
306
|
-
- docs/bin/web
|
307
|
-
- docs/docs.md
|
308
|
-
- docs/img/docs/codebuild-output.png
|
309
|
-
- docs/img/logos/boltops-logo-full.png
|
310
|
-
- docs/img/logos/boltops-logo.png
|
311
|
-
- docs/img/logos/project-logo.png
|
312
|
-
- docs/index.html
|
313
|
-
- docs/js/nav.js
|
314
|
-
- docs/js/new-age.js
|
315
|
-
- docs/js/new-age.min.js
|
316
|
-
- docs/new-age.scss
|
317
|
-
- docs/quick-start.md
|
318
|
-
- docs/reference.md
|
319
|
-
- docs/support.md
|
320
|
-
- docs/vendor/bootstrap/css/bootstrap-grid.css
|
321
|
-
- docs/vendor/bootstrap/css/bootstrap-grid.css.map
|
322
|
-
- docs/vendor/bootstrap/css/bootstrap-grid.min.css
|
323
|
-
- docs/vendor/bootstrap/css/bootstrap-grid.min.css.map
|
324
|
-
- docs/vendor/bootstrap/css/bootstrap-reboot.css
|
325
|
-
- docs/vendor/bootstrap/css/bootstrap-reboot.css.map
|
326
|
-
- docs/vendor/bootstrap/css/bootstrap-reboot.min.css
|
327
|
-
- docs/vendor/bootstrap/css/bootstrap-reboot.min.css.map
|
328
|
-
- docs/vendor/bootstrap/css/bootstrap.css
|
329
|
-
- docs/vendor/bootstrap/css/bootstrap.css.map
|
330
|
-
- docs/vendor/bootstrap/css/bootstrap.min.css
|
331
|
-
- docs/vendor/bootstrap/css/bootstrap.min.css.map
|
332
|
-
- docs/vendor/bootstrap/js/bootstrap.js
|
333
|
-
- docs/vendor/bootstrap/js/bootstrap.min.js
|
334
|
-
- docs/vendor/font-awesome/css/font-awesome.css
|
335
|
-
- docs/vendor/font-awesome/css/font-awesome.min.css
|
336
|
-
- docs/vendor/font-awesome/fonts/FontAwesome.otf
|
337
|
-
- docs/vendor/font-awesome/fonts/fontawesome-webfont.eot
|
338
|
-
- docs/vendor/font-awesome/fonts/fontawesome-webfont.svg
|
339
|
-
- docs/vendor/font-awesome/fonts/fontawesome-webfont.ttf
|
340
|
-
- docs/vendor/font-awesome/fonts/fontawesome-webfont.woff
|
341
|
-
- docs/vendor/font-awesome/fonts/fontawesome-webfont.woff2
|
342
|
-
- docs/vendor/font-awesome/less/animated.less
|
343
|
-
- docs/vendor/font-awesome/less/bordered-pulled.less
|
344
|
-
- docs/vendor/font-awesome/less/core.less
|
345
|
-
- docs/vendor/font-awesome/less/fixed-width.less
|
346
|
-
- docs/vendor/font-awesome/less/font-awesome.less
|
347
|
-
- docs/vendor/font-awesome/less/icons.less
|
348
|
-
- docs/vendor/font-awesome/less/larger.less
|
349
|
-
- docs/vendor/font-awesome/less/list.less
|
350
|
-
- docs/vendor/font-awesome/less/mixins.less
|
351
|
-
- docs/vendor/font-awesome/less/path.less
|
352
|
-
- docs/vendor/font-awesome/less/rotated-flipped.less
|
353
|
-
- docs/vendor/font-awesome/less/screen-reader.less
|
354
|
-
- docs/vendor/font-awesome/less/stacked.less
|
355
|
-
- docs/vendor/font-awesome/less/variables.less
|
356
|
-
- docs/vendor/font-awesome/scss/_animated.scss
|
357
|
-
- docs/vendor/font-awesome/scss/_bordered-pulled.scss
|
358
|
-
- docs/vendor/font-awesome/scss/_core.scss
|
359
|
-
- docs/vendor/font-awesome/scss/_fixed-width.scss
|
360
|
-
- docs/vendor/font-awesome/scss/_icons.scss
|
361
|
-
- docs/vendor/font-awesome/scss/_larger.scss
|
362
|
-
- docs/vendor/font-awesome/scss/_list.scss
|
363
|
-
- docs/vendor/font-awesome/scss/_mixins.scss
|
364
|
-
- docs/vendor/font-awesome/scss/_path.scss
|
365
|
-
- docs/vendor/font-awesome/scss/_rotated-flipped.scss
|
366
|
-
- docs/vendor/font-awesome/scss/_screen-reader.scss
|
367
|
-
- docs/vendor/font-awesome/scss/_stacked.scss
|
368
|
-
- docs/vendor/font-awesome/scss/_variables.scss
|
369
|
-
- docs/vendor/font-awesome/scss/font-awesome.scss
|
370
|
-
- docs/vendor/jquery-easing/jquery.easing.compatibility.js
|
371
|
-
- docs/vendor/jquery-easing/jquery.easing.js
|
372
|
-
- docs/vendor/jquery-easing/jquery.easing.min.js
|
373
|
-
- docs/vendor/jquery/jquery.js
|
374
|
-
- docs/vendor/jquery/jquery.min.js
|
375
|
-
- docs/vendor/simple-line-icons/css/simple-line-icons.css
|
376
|
-
- docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.eot
|
377
|
-
- docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.svg
|
378
|
-
- docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.ttf
|
379
|
-
- docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff
|
380
|
-
- docs/vendor/simple-line-icons/fonts/Simple-Line-Icons.woff2
|
381
|
-
- docs/vendor/simple-line-icons/less/simple-line-icons.less
|
382
|
-
- docs/vendor/simple-line-icons/scss/simple-line-icons.scss
|
383
|
-
- docs/vendor/tether/tether.js
|
384
|
-
- docs/vendor/tether/tether.min.js
|
385
232
|
- exe/cb
|
386
233
|
- exe/codebuild
|
387
234
|
- img/github-admin-settings-tab.png
|
@@ -429,15 +276,50 @@ files:
|
|
429
276
|
- lib/template/top/variables/base.rb
|
430
277
|
- lib/template/top/variables/development.rb
|
431
278
|
- lib/template/top/variables/production.rb
|
432
|
-
-
|
433
|
-
-
|
434
|
-
-
|
435
|
-
-
|
436
|
-
-
|
437
|
-
-
|
438
|
-
-
|
439
|
-
-
|
440
|
-
-
|
279
|
+
- vendor/aws_data/CHANGELOG.md
|
280
|
+
- vendor/aws_data/Gemfile
|
281
|
+
- vendor/aws_data/Gemfile.lock
|
282
|
+
- vendor/aws_data/LICENSE.txt
|
283
|
+
- vendor/aws_data/README.md
|
284
|
+
- vendor/aws_data/Rakefile
|
285
|
+
- vendor/aws_data/aws_data.gemspec
|
286
|
+
- vendor/aws_data/bin/console
|
287
|
+
- vendor/aws_data/bin/setup
|
288
|
+
- vendor/aws_data/lib/aws_data.rb
|
289
|
+
- vendor/aws_data/lib/aws_data/version.rb
|
290
|
+
- vendor/aws_data/pkg/aws_data-0.1.0.gem
|
291
|
+
- vendor/aws_data/spec/aws_data_spec.rb
|
292
|
+
- vendor/aws_data/spec/spec_helper.rb
|
293
|
+
- vendor/cfn-status/Gemfile
|
294
|
+
- vendor/cfn-status/Gemfile.lock
|
295
|
+
- vendor/cfn-status/LICENSE.txt
|
296
|
+
- vendor/cfn-status/README.md
|
297
|
+
- vendor/cfn-status/Rakefile
|
298
|
+
- vendor/cfn-status/bin/console
|
299
|
+
- vendor/cfn-status/bin/setup
|
300
|
+
- vendor/cfn-status/cfn-status.gemspec
|
301
|
+
- vendor/cfn-status/lib/cfn/aws_service.rb
|
302
|
+
- vendor/cfn-status/lib/cfn/status.rb
|
303
|
+
- vendor/cfn-status/lib/cfn/status/version.rb
|
304
|
+
- vendor/cfn-status/spec/cfn/status_spec.rb
|
305
|
+
- vendor/cfn-status/spec/fixtures/cfn/stack-events-complete.json
|
306
|
+
- vendor/cfn-status/spec/fixtures/cfn/stack-events-in-progress.json
|
307
|
+
- vendor/cfn-status/spec/fixtures/cfn/stack-events-update-rollback-complete.json
|
308
|
+
- vendor/cfn-status/spec/spec_helper.rb
|
309
|
+
- vendor/cfn_camelizer/CHANGELOG.md
|
310
|
+
- vendor/cfn_camelizer/Gemfile
|
311
|
+
- vendor/cfn_camelizer/Gemfile.lock
|
312
|
+
- vendor/cfn_camelizer/LICENSE.txt
|
313
|
+
- vendor/cfn_camelizer/README.md
|
314
|
+
- vendor/cfn_camelizer/Rakefile
|
315
|
+
- vendor/cfn_camelizer/bin/console
|
316
|
+
- vendor/cfn_camelizer/bin/setup
|
317
|
+
- vendor/cfn_camelizer/cfn_camelizer.gemspec
|
318
|
+
- vendor/cfn_camelizer/lib/camelizer.yml
|
319
|
+
- vendor/cfn_camelizer/lib/cfn_camelizer.rb
|
320
|
+
- vendor/cfn_camelizer/lib/cfn_camelizer/version.rb
|
321
|
+
- vendor/cfn_camelizer/spec/cfn_camelizer_spec.rb
|
322
|
+
- vendor/cfn_camelizer/spec/spec_helper.rb
|
441
323
|
homepage: https://github.com/tongueroo/codebuild
|
442
324
|
licenses:
|
443
325
|
- MIT
|
@@ -461,13 +343,4 @@ rubygems_version: 3.0.3
|
|
461
343
|
signing_key:
|
462
344
|
specification_version: 4
|
463
345
|
summary: CodeBuild DSL Tool to Quickly Create CodeBuild Project
|
464
|
-
test_files:
|
465
|
-
- spec/fixtures/app/.codebuild/project.rb
|
466
|
-
- spec/fixtures/app/.codebuild/role.rb
|
467
|
-
- spec/fixtures/app/.codebuild/schedule.rb
|
468
|
-
- spec/fixtures/app/.codebuild/settings.yml
|
469
|
-
- spec/lib/cli_spec.rb
|
470
|
-
- spec/lib/project_spec.rb
|
471
|
-
- spec/lib/role_spec.rb
|
472
|
-
- spec/lib/schedule_spec.rb
|
473
|
-
- spec/spec_helper.rb
|
346
|
+
test_files: []
|