cfoo 0.0.5 → 0.0.6

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: 890a22d97ca8850585de4afcefa16687e3a1a471
4
- data.tar.gz: 2cbaaedd141069c700edad7a33cdf2b55771e0cf
3
+ metadata.gz: 23efff0ee7130ae5e75ad43d4fc33e9148b23378
4
+ data.tar.gz: a46b4d7dd742980e0a9ea68dbfc43a2d5cb4d97a
5
5
  SHA512:
6
- metadata.gz: 106acbdf12ff2c523a6b541280935b87db4bb6e1587da7dc82c4a8686d7b3858d5f9696564ae749e19c5e0c0225a5162f08d3aa1639468b7c73ee8919b0c1819
7
- data.tar.gz: 342ef4c8482c39fc1a0f74c4529d650fdd970761266792b2c794527095f5cfeb900b2a04f2d2ed15c3a8f1e122458446465986172d778f958b8fa0f6b669cbfd
6
+ metadata.gz: 5fbe37fdb6abf0ce350f6adc06500ba9a69a57a4b331a710d3b00c5a8b0f3266611d913969084c131c2aff0ef66236a32b97afeec2c2437c8f9078454480f229
7
+ data.tar.gz: c9d67ad7f1bef1cb09609c54717e251488e6715c395c8ea94511803488f3926aff58ee4ac1a05abdcc7c6f266fff3111cbc7828c7d2d72bf1fd2a61309e91be8
@@ -1,7 +1,3 @@
1
1
  language: ruby
2
2
  rvm:
3
- - "1.8.7"
4
- - "1.9.2"
5
- - "1.9.3"
6
- - "2.0.0"
7
- - "2.1.0"
3
+ - "2.2"
@@ -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
  """
@@ -1,3 +1,3 @@
1
1
  module Cfoo
2
- CLOUDFORMATION_FUNCTIONS = %w[Base64 FindInMap GetAtt GetAZs Join Select And Equals If Not Or]
2
+ CLOUDFORMATION_FUNCTIONS = %w[Base64 FindInMap GetAtt GetAZs ImportValue Join Split Select And Equals If Not Or]
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Cfoo
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
@@ -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.5
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: 2015-02-09 00:00:00.000000000 Z
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.4.5
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