htmlcompressor 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,6 @@
1
+ 0.0.5 - 31/01/2013
2
+ Safer rack default options: remove_intertag_spaces => false
3
+ README more clear
1
4
  0.0.4 - 16/01/2013
2
5
  Preserve empty textarea (issue #3)
3
6
  0.0.3 - 18/05/2012
data/README.md CHANGED
@@ -18,14 +18,45 @@ Using the compressor class is straightforward:
18
18
  compressor.compress('<html><body><div id="compress_me"></div></body></html>')
19
19
  ```
20
20
 
21
- The compressor ships with some default option that may be overwritten passing the options hash to the constructor:
21
+ The compressor ships with basic and safe default options that may be overwritten passing the options hash to the constructor:
22
22
 
23
23
  ```ruby
24
- option = {
24
+ options = {
25
25
  :enabled => true
26
26
  :remove_multi_spaces => true,
27
27
  :remove_comments => true,
28
- :remove_intertag_spaces => true,
28
+ :remove_intertag_spaces => fasle,
29
+ :remove_quotes => fasle,
30
+ :compress_css => false,
31
+ :compress_javascript => false,
32
+ :simple_doctype => false,
33
+ :remove_script_attributes => fasle,
34
+ :remove_style_attributes => fasle,
35
+ :remove_link_attributes => fasle,
36
+ :remove_form_attributes => fasle,
37
+ :remove_input_attributes => fasle,
38
+ :remove_javascript_protocol => fasle,
39
+ :remove_http_protocol => fasle,
40
+ :remove_https_protocol => false,
41
+ :preserve_line_breaks => false,
42
+ :simple_boolean_attributes => fasle
43
+ }
44
+ ```
45
+
46
+ Using rack middleware is as easy as:
47
+
48
+ ```ruby
49
+ config.middleware.use HtmlCompressor::Rack, options
50
+ ```
51
+
52
+ The middleware uses a little more aggressive options by default:
53
+
54
+ ```ruby
55
+ options = {
56
+ :enabled => true,
57
+ :remove_multi_spaces => true,
58
+ :remove_comments => true,
59
+ :remove_intertag_spaces => false,
29
60
  :remove_quotes => true,
30
61
  :compress_css => false,
31
62
  :compress_javascript => false,
@@ -43,14 +74,6 @@ The compressor ships with some default option that may be overwritten passing th
43
74
  }
44
75
  ```
45
76
 
46
- Using rack middleware is as easy as:
47
-
48
- ```ruby
49
- config.middleware.use HtmlCompressor::Rack, options
50
- ```
51
-
52
- The options has his optional and can be used to overwrite default options
53
-
54
77
  Rails 2.3 users may need to add
55
78
  ```ruby
56
79
  require 'htmlcompressor'
@@ -6,7 +6,7 @@ module HtmlCompressor
6
6
  :enabled => true,
7
7
  :remove_multi_spaces => true,
8
8
  :remove_comments => true,
9
- :remove_intertag_spaces => true,
9
+ :remove_intertag_spaces => false,
10
10
  :remove_quotes => true,
11
11
  :compress_css => false,
12
12
  :compress_javascript => false,
@@ -1,3 +1,3 @@
1
1
  module HtmlCompressor
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,87 +1,93 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: htmlcompressor
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.4
3
+ version: !ruby/object:Gem::Version
4
+ hash: 21
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 5
10
+ version: 0.0.5
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Paolo Chiodi
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2013-02-06 00:00:00 +01:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
15
22
  name: yui-compressor
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 0.9.6
22
- type: :runtime
23
23
  prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
25
  none: false
26
- requirements:
26
+ requirements:
27
27
  - - ~>
28
- - !ruby/object:Gem::Version
28
+ - !ruby/object:Gem::Version
29
+ hash: 55
30
+ segments:
31
+ - 0
32
+ - 9
33
+ - 6
29
34
  version: 0.9.6
30
- - !ruby/object:Gem::Dependency
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
31
38
  name: closure-compiler
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ~>
36
- - !ruby/object:Gem::Version
37
- version: 1.1.5
38
- type: :development
39
39
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
41
  none: false
42
- requirements:
42
+ requirements:
43
43
  - - ~>
44
- - !ruby/object:Gem::Version
44
+ - !ruby/object:Gem::Version
45
+ hash: 25
46
+ segments:
47
+ - 1
48
+ - 1
49
+ - 5
45
50
  version: 1.1.5
46
- - !ruby/object:Gem::Dependency
47
- name: rake
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: '0'
54
51
  type: :development
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: rake
55
55
  prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
57
  none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- - !ruby/object:Gem::Dependency
63
- name: minitest
64
- requirement: !ruby/object:Gem::Requirement
65
- none: false
66
- requirements:
67
- - - ! '>='
68
- - !ruby/object:Gem::Version
69
- version: '0'
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ hash: 3
62
+ segments:
63
+ - 0
64
+ version: "0"
70
65
  type: :development
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ name: minitest
71
69
  prerelease: false
72
- version_requirements: !ruby/object:Gem::Requirement
70
+ requirement: &id004 !ruby/object:Gem::Requirement
73
71
  none: false
74
- requirements:
75
- - - ! '>='
76
- - !ruby/object:Gem::Version
77
- version: '0'
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ type: :development
80
+ version_requirements: *id004
78
81
  description: Put your html on a diet
79
- email:
82
+ email:
80
83
  - chiodi84@gmail.com
81
84
  executables: []
85
+
82
86
  extensions: []
87
+
83
88
  extra_rdoc_files: []
84
- files:
89
+
90
+ files:
85
91
  - .gitignore
86
92
  - CHANGELOG
87
93
  - Gemfile
@@ -214,31 +220,41 @@ files:
214
220
  - test/resources/xml/testRemoveCommentsResult.xml
215
221
  - test/resources/xml/testRemoveIntertagSpaces.xml
216
222
  - test/resources/xml/testRemoveIntertagSpacesResult.xml
217
- homepage: ''
223
+ has_rdoc: true
224
+ homepage: ""
218
225
  licenses: []
226
+
219
227
  post_install_message:
220
228
  rdoc_options: []
221
- require_paths:
229
+
230
+ require_paths:
222
231
  - lib
223
- required_ruby_version: !ruby/object:Gem::Requirement
232
+ required_ruby_version: !ruby/object:Gem::Requirement
224
233
  none: false
225
- requirements:
226
- - - ! '>='
227
- - !ruby/object:Gem::Version
228
- version: '0'
229
- required_rubygems_version: !ruby/object:Gem::Requirement
234
+ requirements:
235
+ - - ">="
236
+ - !ruby/object:Gem::Version
237
+ hash: 3
238
+ segments:
239
+ - 0
240
+ version: "0"
241
+ required_rubygems_version: !ruby/object:Gem::Requirement
230
242
  none: false
231
- requirements:
232
- - - ! '>='
233
- - !ruby/object:Gem::Version
234
- version: '0'
243
+ requirements:
244
+ - - ">="
245
+ - !ruby/object:Gem::Version
246
+ hash: 3
247
+ segments:
248
+ - 0
249
+ version: "0"
235
250
  requirements: []
251
+
236
252
  rubyforge_project:
237
- rubygems_version: 1.8.23
253
+ rubygems_version: 1.6.0
238
254
  signing_key:
239
255
  specification_version: 3
240
256
  summary: htmlcompressor provides a class and a rack middleware to minify html pages
241
- test_files:
257
+ test_files:
242
258
  - test/compressor_test.rb
243
259
  - test/resources/html/.svn/all-wcprops
244
260
  - test/resources/html/.svn/entries