Class: Jets::Cfn::Builder::PostProcess
- Inherits:
-
Object
- Object
- Jets::Cfn::Builder::PostProcess
- Defined in:
- lib/jets/cfn/builder/post_process.rb
Instance Method Summary collapse
-
#initialize(text) ⇒ PostProcess
constructor
A new instance of PostProcess.
- #process ⇒ Object
Constructor Details
#initialize(text) ⇒ PostProcess
Returns a new instance of PostProcess.
6 7 8 |
# File 'lib/jets/cfn/builder/post_process.rb', line 6 def initialize(text) @text = text end |
Instance Method Details
#process ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/jets/cfn/builder/post_process.rb', line 10 def process results = @text.split("\n").map do |line| if line.include?(': "!') # IE: IamRole: "!Ref IamRole", # IamRole: "!Ref IamRole" => IamRole: !Ref IamRole line.sub(/: "(.*)"/, ': \1') elsif line.include?('- "!') # IE: - "!GetAtt Foo.Arn" # IamRole: - "!GetAtt Foo.Arn" => - !GetAtt Foo.Arn line.sub(/- "(.*)"/, '- \1') else line end end results.join("\n") + "\n" end |