How to merge YAML arrays?

If the aim is to run a sequence of shell commands, you may be able to achieve this as follows: # note: no dash before commands some_stuff: &some_stuff |- a b c combined_stuff: – *some_stuff – d – e – f This is equivalent to: some_stuff: “a\nb\nc” combined_stuff: – “a\nb\nc” – d – e – … Read more

YAML Multi-Line Arrays

A YAML sequence is an array. So this is the right way to express it: key: – string1 – string2 – string3 – string4 – string5 – string6 That’s identical in meaning to: key: [‘string1’, ‘string2’, ‘string3’, ‘string4’, ‘string5’, ‘string6′] It’s also legal to split a single-line array over several lines: key: [‘string1’, ‘string2’, ‘string3’, … Read more

How do I parse a YAML file in Ruby?

Maybe I’m missing something, but why try to parse the file? Why not just load the YAML and examine the object(s) that result? If your sample YAML is in some.yml, then this: require ‘yaml’ thing = YAML.load_file(‘some.yml’) puts thing.inspect gives me {“javascripts”=>[{“fo_global”=>[“lazyload-min”, “holla-min”]}]}

What is the difference between .yaml and .yml extension? [duplicate]

File extensions do not have any bearing or impact on the content of the file. You can hold YAML content in files with any extension: .yml, .yaml or indeed anything else. The (rather sparse) YAML FAQ recommends that you use .yaml in preference to .yml, but for historic reasons many Windows programmers are still scared … Read more

Setting active profile and config location from command line in spring boot

There are two different ways you can add/override spring properties on the command line. Option 1: Java System Properties (VM Arguments) It’s important that the -D parameters are before your application.jar otherwise they are not recognized. java -jar -Dspring.profiles.active=prod application.jar Option 2: Program arguments java -jar application.jar –spring.profiles.active=prod –spring.config.location=c:\config

why — (3 dashes/hyphen) in yaml file?

As you already found out, the three dashes — are used to signal the start of a document, i.e.: To signal the document start after directives, i.e., %YAML or %TAG lines according to the current spec. For example: %YAML 1.2 %TAG !foo! !foo-types/ — myKey: myValue To signal the document start when you have multiple … Read more

YAML current date in rmarkdown

This is a little bit tricky, but you just need to make the date field valid in YAML by quoting the inline R expression, e.g. date: “`r format(Sys.time(), ‘%d %B, %Y’)`” Then the parsing error will be gone, and the date will be generated in the markdown output so Pandoc can use the value from … Read more

tech