Skip to content

Commit

Permalink
Fixed: example/run.js so that it actually runs!
Browse files Browse the repository at this point in the history
Also modified the examples to use unquoted strings and inLineHashes just
to make sure they all show up.
  • Loading branch information
CrypticSwarm authored and tj committed Dec 15, 2010
1 parent ceb3d7d commit f2a158e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion examples/hash.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---
users:
tj:
name: 'tj'
name: tj
age: 23
email: 'tj@vision-media.ca'
bob:
name: 'bob'
age: 27
ted: { name: ted, age: 32, email: ted@tedtalks.com }
something:
blah: 19
2 changes: 1 addition & 1 deletion examples/list.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---
- 'milk'
- lots of milk
- 'cookies'
- 'something'
9 changes: 4 additions & 5 deletions examples/run.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@

var path = process.argv[2],
fs = require('fs'),
sys = require('sys'),
yaml = require('../lib/yaml')

if (!path)
throw new Error('provide path to yaml file')

sys.puts('\n')
sys.puts(fs.readFileSync(path))
sys.puts('\noutputs:\n')
sys.p(yaml.eval(fs.readFileSync(path)))
console.log('\n')
console.log(fs.readFileSync(path).toString())
console.log('\noutputs:\n')
console.log(yaml.eval(fs.readFileSync(path).toString()))

0 comments on commit f2a158e

Please sign in to comment.