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.message}".color(:red) logger.error " Rendered file contains invalid YAML. For debugging, files available at:\n\n source: \#{@task_definition.path}\n compiled: \#{@path}\n\n EOL\n\n md = e.message.match(/at line (\\d+) column (\\d+)/)\n if md\n line_number = md[1]\n DslEvaluator.print_code(@path, line_number)\n else\n print_code(text) # fallback to simpler print code if cannot find line numbers\n end\nend\n" |