htmlbeautifier 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/htmlbeautifier +27 -4
- data/lib/htmlbeautifier/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1f5ee1a14739216070d654cda0baf67f47ca591
|
4
|
+
data.tar.gz: aec9ef2f98e0665639809f0ae4f9ca640925d947
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c65d727deb3738224a9974ffcfe69711f55889c19c9c424e900a68a864ee123708fb75171bc13127e896120ecc284cf8f4023603261291481d53cf585cd7a75f
|
7
|
+
data.tar.gz: 7acf594cb53911c01e0788993d88ea0e8be6f7be7e54315813dd0f61712a5e5dd2385b6f07abb914ac1c937856c6b82b75d93cbac2f5bba0cc199cf76311ce4d
|
data/bin/htmlbeautifier
CHANGED
@@ -9,16 +9,39 @@ rescue => e
|
|
9
9
|
raise "Error parsing #{name}: #{e}"
|
10
10
|
end
|
11
11
|
|
12
|
+
executable = File.basename(__FILE__)
|
13
|
+
|
12
14
|
options = {:tab_stops => 2}
|
13
15
|
parser = OptionParser.new do |opts|
|
14
|
-
opts.banner = "Usage: #{
|
15
|
-
opts.
|
16
|
+
opts.banner = "Usage: #{executable} [options] [file ...]"
|
17
|
+
opts.separator <<END
|
18
|
+
|
19
|
+
#{executable} has two modes of operation:
|
20
|
+
|
21
|
+
1. If no files are listed, it will read from standard input and write to
|
22
|
+
standard output.
|
23
|
+
2. If files are listed, it will modify each file in place, overwriting it
|
24
|
+
with the beautified output.
|
25
|
+
|
26
|
+
The following options are available:
|
27
|
+
|
28
|
+
END
|
29
|
+
opts.on(
|
30
|
+
"-t", "--tab-stops NUMBER", Integer,
|
31
|
+
"Set number of spaces per indent (default #{options[:tab_stops]})"
|
32
|
+
) do |num|
|
16
33
|
options[:tab_stops] = num
|
17
34
|
end
|
18
|
-
opts.on(
|
35
|
+
opts.on(
|
36
|
+
"-e", "--stop-on-errors",
|
37
|
+
"Stop when invalid nesting is encountered in the input"
|
38
|
+
) do |num|
|
19
39
|
options[:stop_on_errors] = num
|
20
40
|
end
|
21
|
-
opts.on(
|
41
|
+
opts.on(
|
42
|
+
"-h", "--help",
|
43
|
+
"Display this help message and exit"
|
44
|
+
) do
|
22
45
|
puts opts
|
23
46
|
exit
|
24
47
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmlbeautifier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Battley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|