xmlpretty 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/README.md +11 -0
  2. data/bin/xmlpretty +11 -0
  3. metadata +50 -0
@@ -0,0 +1,11 @@
1
+ An xml pretty printer.
2
+
3
+ usage:
4
+
5
+ just pipe your output into xmlpretty
6
+
7
+ echo '<foo><bar></bar></foo>' | xmlpretty
8
+
9
+ specify indent level with the first param
10
+
11
+ echo '<foo><bar></bar></foo>' | xmlpretty 2
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rexml/document'
4
+
5
+ DEFAULT_INDENT_LEVEL = 2
6
+
7
+ indent_level = ARGV[0] ? ARGV[0].to_i : DEFAULT_INDENT_LEVEL
8
+
9
+ doc = REXML::Document.new($stdin, { :raw => :all })
10
+ doc.write($stdout, indent_level)
11
+ puts ""
metadata ADDED
@@ -0,0 +1,50 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: xmlpretty
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Scott Taylor
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-04-20 00:00:00.000000000Z
13
+ dependencies: []
14
+ description: ! ' Super simple utility to pretty print xml. Pass the xml in on
15
+ stdin.
16
+
17
+ '
18
+ email: scott@railsnewbie.com
19
+ executables:
20
+ - xmlpretty
21
+ extensions: []
22
+ extra_rdoc_files: []
23
+ files:
24
+ - README.md
25
+ - bin/xmlpretty
26
+ homepage: http://github.com/smtlaissezfaire/xmlpretty
27
+ licenses: []
28
+ post_install_message:
29
+ rdoc_options: []
30
+ require_paths:
31
+ - lib
32
+ required_ruby_version: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ required_rubygems_version: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ requirements: []
45
+ rubyforge_project:
46
+ rubygems_version: 1.8.19
47
+ signing_key:
48
+ specification_version: 3
49
+ summary: Pretty prints xml
50
+ test_files: []