Class: Ufo::TaskDefinition::Erb::Yaml
- Defined in:
- lib/ufo/task_definition/erb/yaml.rb
Instance Attribute Summary
Attributes inherited from CLI::Base
Instance Method Summary collapse
Methods inherited from Base
Methods inherited from CLI::Base
Methods included from Utils::Sure
Methods included from Utils::Pretty
#pretty_home, #pretty_path, #pretty_time
Methods included from Utils::Logging
Methods included from Concerns
Methods included from Concerns::Names
Methods included from AwsServices
#acm, #applicationautoscaling, #aws_options, #cloudformation, #cloudwatchlogs, #ec2, #ecr, #ecs, #elb, #find_stack, #ssm_client, #stack_resources, #status, #task_definition_arns
Constructor Details
This class inherits a constructor from Ufo::TaskDefinition::Erb::Base
Instance Method Details
#data ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ufo/task_definition/erb/yaml.rb', line 3 def data text = IO.read(@path) YAML.load(text) rescue Psych::SyntaxError => e logger.error "ERROR: #{e.class}: #{e.}".color(:red) logger.error <<~EOL Rendered file contains invalid YAML. For debugging, files available at: source: #{@task_definition.path} compiled: #{@path} EOL md = e..match(/at line (\d+) column (\d+)/) if md line_number = md[1] DslEvaluator.print_code(@path, line_number) else print_code(text) # fallback to simpler print code if cannot find line numbers end end |