ppcommand
Parse and pp YAML/JSON/XML/CSV/HTML.
Usage
$ pp --help
pp [options] [file|URI]
-y, --yaml parse YAML and pp.
-j, --json parse JSON and pp.
-x, --xml parse XML using REXML and pp.
-X, --xmlsimple parse XML using XMLSimple and pp.
-c, --csv parse CSV and pp.
-C, --csvtable parse CSV, add labels and pp.
-h, --html parse HTML and pp.
-t, --text do not parse. print plain text.
Examples
Parse YAML and pp.
pp ./config/database.yml
Parse JSON and pp.
pp http://api.twitter.com/1/statuses/public_timeline.json
Parse HTML and pp (required nokogiri).
pp http://www.google.com/
Get URL contents as text, skip 1 line, convert encoding to UTF-8, parse CSV and pp with labels.
pp -t http://example.com/example.csv | head -n +1 | nkf -w | pp -C
Note on Patches/Pull Requests
-
Fork the project.
-
Make your feature addition or bug fix.
-
Add tests for it. This is important so I don’t break it in a future version unintentionally.
-
Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but
bump version in a commit by itself I can ignore when I pull)
-
Send me a pull request. Bonus points for topic branches.
Copyright
Copyright © 2010 KOSEKI Kengo. See LICENSE for details.