-
-
Save anonymous/97b826594f40ae228f2a to your computer and use it in GitHub Desktop.
parsing yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gregf@jupiter:/var/www/dev_hermes_backend/current$ cat foo.yml | |
foo: 1 | |
bar: | |
- 100 | |
- 200 | |
baz: hello | |
useragent: Mozilla | |
gregf@jupiter:/var/www/dev_hermes_backend/current$ ruby -le ' | |
require "yaml"; data = YAML.load_file("./foo.yml"); p data.select { |k,v| k =~ /useragent/ } | |
' | |
{"useragent"=>"Mozilla"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment