htmlmin 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/htmlmin/slot_machines/comment.rb +7 -0
- data/lib/htmlmin/slot_machines/common.rb +7 -0
- data/lib/htmlmin/slot_machines/doctype.rb +49 -0
- data/lib/htmlmin/version.rb +1 -1
- data/test/input/entity_2.txt +10 -0
- data/test/options/entity_2.rb +11 -0
- data/test/output/entity_2.txt +1 -0
- metadata +8 -2
data/README.md
CHANGED
@@ -8,7 +8,7 @@ Please report issues on [Github] (https://github.com/aishek/htmlmin/issues).
|
|
8
8
|
|
9
9
|
For feedback, suggestions, etc. write to <aishek@gmail.com>.
|
10
10
|
|
11
|
-
**Important**: this project is in beta and may contain bugs. Current version: 0.0.
|
11
|
+
**Important**: this project is in beta and may contain bugs. Current version: 0.0.6
|
12
12
|
|
13
13
|
# Installation
|
14
14
|
|
@@ -37,6 +37,13 @@ module HTMLMin
|
|
37
37
|
when 'D'
|
38
38
|
add_to_buffer char
|
39
39
|
change_state_to :doctype_begin_1
|
40
|
+
when '&'
|
41
|
+
reset_saved_state
|
42
|
+
|
43
|
+
flush_buffer
|
44
|
+
|
45
|
+
add_to_buffer char
|
46
|
+
change_state_to :entity
|
40
47
|
when HTMLMin::Minifier::END_OF_FILE
|
41
48
|
flush_buffer
|
42
49
|
else
|
@@ -17,6 +17,13 @@ module HTMLMin
|
|
17
17
|
flush_buffer
|
18
18
|
|
19
19
|
change_state_to_spaces char
|
20
|
+
when '&'
|
21
|
+
reset_saved_state
|
22
|
+
|
23
|
+
flush_buffer
|
24
|
+
|
25
|
+
add_to_buffer char
|
26
|
+
change_state_to :entity
|
20
27
|
when HTMLMin::Minifier::END_OF_FILE
|
21
28
|
flush_buffer
|
22
29
|
else
|
@@ -34,6 +41,13 @@ module HTMLMin
|
|
34
41
|
when "C"
|
35
42
|
add_to_buffer char
|
36
43
|
change_state_to :doctype_begin_3
|
44
|
+
when '&'
|
45
|
+
reset_saved_state
|
46
|
+
|
47
|
+
flush_buffer
|
48
|
+
|
49
|
+
add_to_buffer char
|
50
|
+
change_state_to :entity
|
37
51
|
when "\s", "\n", "\r", "\t", " "
|
38
52
|
reset_saved_state
|
39
53
|
|
@@ -56,6 +70,13 @@ module HTMLMin
|
|
56
70
|
when "T"
|
57
71
|
add_to_buffer char
|
58
72
|
change_state_to :doctype_begin_4
|
73
|
+
when '&'
|
74
|
+
reset_saved_state
|
75
|
+
|
76
|
+
flush_buffer
|
77
|
+
|
78
|
+
add_to_buffer char
|
79
|
+
change_state_to :entity
|
59
80
|
when "\s", "\n", "\r", "\t", " "
|
60
81
|
reset_saved_state
|
61
82
|
|
@@ -78,6 +99,13 @@ module HTMLMin
|
|
78
99
|
when "Y"
|
79
100
|
add_to_buffer char
|
80
101
|
change_state_to :doctype_begin_5
|
102
|
+
when '&'
|
103
|
+
reset_saved_state
|
104
|
+
|
105
|
+
flush_buffer
|
106
|
+
|
107
|
+
add_to_buffer char
|
108
|
+
change_state_to :entity
|
81
109
|
when "\s", "\n", "\r", "\t", " "
|
82
110
|
reset_saved_state
|
83
111
|
|
@@ -100,6 +128,13 @@ module HTMLMin
|
|
100
128
|
when "P"
|
101
129
|
add_to_buffer char
|
102
130
|
change_state_to :doctype_begin_6
|
131
|
+
when '&'
|
132
|
+
reset_saved_state
|
133
|
+
|
134
|
+
flush_buffer
|
135
|
+
|
136
|
+
add_to_buffer char
|
137
|
+
change_state_to :entity
|
103
138
|
when "\s", "\n", "\r", "\t", " "
|
104
139
|
reset_saved_state
|
105
140
|
|
@@ -122,6 +157,13 @@ module HTMLMin
|
|
122
157
|
when "E"
|
123
158
|
add_to_buffer char
|
124
159
|
change_state_to :doctype_begin_7
|
160
|
+
when '&'
|
161
|
+
reset_saved_state
|
162
|
+
|
163
|
+
flush_buffer
|
164
|
+
|
165
|
+
add_to_buffer char
|
166
|
+
change_state_to :entity
|
125
167
|
when "\s", "\n", "\r", "\t", " "
|
126
168
|
reset_saved_state
|
127
169
|
|
@@ -147,6 +189,13 @@ module HTMLMin
|
|
147
189
|
|
148
190
|
add_to_buffer char
|
149
191
|
change_state_to :doctype
|
192
|
+
when '&'
|
193
|
+
reset_saved_state
|
194
|
+
|
195
|
+
flush_buffer
|
196
|
+
|
197
|
+
add_to_buffer char
|
198
|
+
change_state_to :entity
|
150
199
|
when "\s", "\n", "\r", "\t"
|
151
200
|
reset_saved_state
|
152
201
|
|
data/lib/htmlmin/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
<­ <!« <!-¡ <!D¢ <!DO¦ <!DOC» <!DOCT  <!DOCTY» <!DOCTYP  <!DOCTYPE¸
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: htmlmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-08-
|
12
|
+
date: 2011-08-29 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: HTMLMin is a HTML-code minification tool implemented in Ruby. It works
|
15
15
|
like a slot machine.
|
@@ -49,6 +49,7 @@ files:
|
|
49
49
|
- test/input/doctype_2.txt
|
50
50
|
- test/input/doctype_3.txt
|
51
51
|
- test/input/entity_1.txt
|
52
|
+
- test/input/entity_2.txt
|
52
53
|
- test/input/line_length_1.txt
|
53
54
|
- test/input/line_length_2.txt
|
54
55
|
- test/input/line_length_3.txt
|
@@ -67,6 +68,7 @@ files:
|
|
67
68
|
- test/options/comment_8.rb
|
68
69
|
- test/options/doctype_3.rb
|
69
70
|
- test/options/entity_1.rb
|
71
|
+
- test/options/entity_2.rb
|
70
72
|
- test/options/line_length_1.rb
|
71
73
|
- test/options/line_length_2.rb
|
72
74
|
- test/options/line_length_3.rb
|
@@ -87,6 +89,7 @@ files:
|
|
87
89
|
- test/output/doctype_2.txt
|
88
90
|
- test/output/doctype_3.txt
|
89
91
|
- test/output/entity_1.txt
|
92
|
+
- test/output/entity_2.txt
|
90
93
|
- test/output/line_length_1.txt
|
91
94
|
- test/output/line_length_2.txt
|
92
95
|
- test/output/line_length_3.txt
|
@@ -138,6 +141,7 @@ test_files:
|
|
138
141
|
- test/input/doctype_2.txt
|
139
142
|
- test/input/doctype_3.txt
|
140
143
|
- test/input/entity_1.txt
|
144
|
+
- test/input/entity_2.txt
|
141
145
|
- test/input/line_length_1.txt
|
142
146
|
- test/input/line_length_2.txt
|
143
147
|
- test/input/line_length_3.txt
|
@@ -156,6 +160,7 @@ test_files:
|
|
156
160
|
- test/options/comment_8.rb
|
157
161
|
- test/options/doctype_3.rb
|
158
162
|
- test/options/entity_1.rb
|
163
|
+
- test/options/entity_2.rb
|
159
164
|
- test/options/line_length_1.rb
|
160
165
|
- test/options/line_length_2.rb
|
161
166
|
- test/options/line_length_3.rb
|
@@ -176,6 +181,7 @@ test_files:
|
|
176
181
|
- test/output/doctype_2.txt
|
177
182
|
- test/output/doctype_3.txt
|
178
183
|
- test/output/entity_1.txt
|
184
|
+
- test/output/entity_2.txt
|
179
185
|
- test/output/line_length_1.txt
|
180
186
|
- test/output/line_length_2.txt
|
181
187
|
- test/output/line_length_3.txt
|