-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Myles Byrne
committed
Sep 18, 2014
1 parent
cf11fa0
commit ae5b937
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
# ensure we're in the parent directory of this file | ||
cd $(dirname $0)/.. | ||
|
||
# feed in some yaml | ||
./yaml-to-json <<YAML | ||
key: | ||
subkey: | ||
- first element | ||
- second element | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# Converts yaml formatted input (on stdin) to json formatted output (on stdout) | ||
|
||
require 'yaml' | ||
require 'json' | ||
|
||
map = YAML.load(STDIN.read) | ||
puts JSON.dump(map) |