cfoo 0.0.5 → 0.0.6
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/.travis.yml +1 -5
- data/features/yamly_shortcuts.feature +16 -0
- data/lib/cfoo/constants.rb +1 -1
- data/lib/cfoo/version.rb +1 -1
- data/spec/cfoo/parser_spec.rb +5 -0
- data/spec/cfoo/yaml_parser_spec.rb +10 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23efff0ee7130ae5e75ad43d4fc33e9148b23378
|
4
|
+
data.tar.gz: a46b4d7dd742980e0a9ea68dbfc43a2d5cb4d97a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fbe37fdb6abf0ce350f6adc06500ba9a69a57a4b331a710d3b00c5a8b0f3266611d913969084c131c2aff0ef66236a32b97afeec2c2437c8f9078454480f229
|
7
|
+
data.tar.gz: c9d67ad7f1bef1cb09609c54717e251488e6715c395c8ea94511803488f3926aff58ee4ac1a05abdcc7c6f266fff3111cbc7828c7d2d72bf1fd2a61309e91be8
|
data/.travis.yml
CHANGED
@@ -60,6 +60,22 @@ Feature: YAMLy shortcuts
|
|
60
60
|
}
|
61
61
|
"""
|
62
62
|
|
63
|
+
Scenario: Split function call
|
64
|
+
Given I have a file "split.yml" containing
|
65
|
+
"""
|
66
|
+
Split: !Split
|
67
|
+
- "|"
|
68
|
+
- "a|b|c"
|
69
|
+
"""
|
70
|
+
When I process "split.yml"
|
71
|
+
Then the output should match JSON
|
72
|
+
"""
|
73
|
+
{
|
74
|
+
"AWSTemplateFormatVersion" : "2010-09-09",
|
75
|
+
"Split" : { "Fn::Split" : [ "|", "a|b|c" ] }
|
76
|
+
}
|
77
|
+
"""
|
78
|
+
|
63
79
|
Scenario: Join function call with empty strings
|
64
80
|
Given I have a file "join.yml" containing
|
65
81
|
"""
|
data/lib/cfoo/constants.rb
CHANGED
data/lib/cfoo/version.rb
CHANGED
data/spec/cfoo/parser_spec.rb
CHANGED
@@ -108,6 +108,11 @@ module Cfoo
|
|
108
108
|
|
109
109
|
parser.parse_file("join.yml").should == {"Fn::Join" => [ "" , [ "a", "b", "c" ] ] }
|
110
110
|
end
|
111
|
+
it "wraps splits in AWS Split function-calls" do
|
112
|
+
file_system.should_receive(:parse_file).with("split.yml").and_return(YAML::DomainType.create("Split", ["|", "a|b|c"]))
|
113
|
+
|
114
|
+
parser.parse_file("split.yml").should == {"Fn::Split" => [ "|" , "a|b|c" ] }
|
115
|
+
end
|
111
116
|
it "wraps map lookups in AWS FindInMap function-calls" do
|
112
117
|
file_system.should_receive(:parse_file).with("findinmap.yml").and_return(YAML::DomainType.create("FindInMap", ["Map", "Key", "Value"]))
|
113
118
|
|
@@ -51,6 +51,16 @@ module Cfoo
|
|
51
51
|
|
52
52
|
parser.load_file("#{working_dir}/join.yml").should == YAML::DomainType.create("Join", ["", ["a","b","c"]])
|
53
53
|
end
|
54
|
+
it "wraps splits in AWS Split function-calls" do
|
55
|
+
write "#{working_dir}/split.yml", "!Split ['|', 'a|b|c']"
|
56
|
+
|
57
|
+
parser.load_file("#{working_dir}/split.yml").should == YAML::DomainType.create("Split", ["|", "a|b|c"])
|
58
|
+
end
|
59
|
+
it "wraps imported value strings in AWS ImportValue function-calls" do
|
60
|
+
write "#{working_dir}/importvalue.yml", "!ImportValue exportedvaluename"
|
61
|
+
|
62
|
+
parser.load_file("#{working_dir}/importvalue.yml").should == YAML::DomainType.create("ImportValue", "exportedvaluename")
|
63
|
+
end
|
54
64
|
it "wraps selects in AWS Select function-calls" do
|
55
65
|
write "#{working_dir}/select.yml", "!Select [1, [a, b, c]]"
|
56
66
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- drrb
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|
@@ -271,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
271
271
|
version: '0'
|
272
272
|
requirements: []
|
273
273
|
rubyforge_project:
|
274
|
-
rubygems_version: 2.
|
274
|
+
rubygems_version: 2.6.9
|
275
275
|
signing_key:
|
276
276
|
specification_version: 4
|
277
277
|
summary: Cfoo (pronounced 'sifu') allows you to write your CloudFormation templates
|