middleman-minify-html 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (149) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +6 -7
  3. data/CONTRIBUTING.md +43 -0
  4. data/Gemfile +18 -15
  5. data/Gemfile-3.0 +18 -0
  6. data/{LICENSE → LICENSE.md} +2 -2
  7. data/README.md +32 -22
  8. data/Rakefile +13 -3
  9. data/features/empty-text-area.feature +17 -0
  10. data/features/{preview.feature → minify.feature} +18 -1
  11. data/fixtures/basic-app/source/empty-text-area.html +9 -0
  12. data/fixtures/basic-app/source/foobar.php +5 -0
  13. data/lib/middleman-minify-html/extension.rb +1 -1
  14. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/.gitignore +17 -0
  15. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/CHANGELOG +12 -0
  16. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/Gemfile +4 -0
  17. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/LICENSE +13 -0
  18. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/README.md +106 -0
  19. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/Rakefile +2 -0
  20. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/htmlcompressor.gemspec +22 -0
  21. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/lib/htmlcompressor.rb +6 -0
  22. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/lib/htmlcompressor/compressor.rb +787 -0
  23. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/lib/htmlcompressor/rack.rb +58 -0
  24. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/lib/htmlcompressor/version.rb +3 -0
  25. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/compressor_test.rb +263 -0
  26. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/all-wcprops +275 -0
  27. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/entries +1558 -0
  28. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testRemoveHttpProtocol.html.svn-base +5 -0
  29. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testRemoveHttpProtocolResult.html.svn-base +5 -0
  30. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testRemoveHttpsProtocol.html.svn-base +5 -0
  31. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testRemoveHttpsProtocolResult.html.svn-base +5 -0
  32. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testRemoveSpacesInsideTags.html.svn-base +5 -0
  33. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testRemoveSpacesInsideTagsResult.html.svn-base +5 -0
  34. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testSurroundingSpaces.html.svn-base +5 -0
  35. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/prop-base/testSurroundingSpacesResult.html.svn-base +5 -0
  36. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompress.html.svn-base +10 -0
  37. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompressCss.html.svn-base +11 -0
  38. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompressCssResult.html.svn-base +6 -0
  39. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompressJavaScript.html.svn-base +24 -0
  40. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompressJavaScriptClosureResult.html.svn-base +7 -0
  41. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompressJavaScriptYuiResult.html.svn-base +7 -0
  42. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testCompressResult.html.svn-base +1 -0
  43. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testEnabled.html.svn-base +1 -0
  44. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testEnabledResult.html.svn-base +1 -0
  45. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testPreserveLineBreaks.html.svn-base +11 -0
  46. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testPreserveLineBreaksResult.html.svn-base +5 -0
  47. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testPreservePatterns.html.svn-base +7 -0
  48. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testPreservePatternsResult.html.svn-base +1 -0
  49. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveComments.html.svn-base +17 -0
  50. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveCommentsResult.html.svn-base +4 -0
  51. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveFormAttributes.html.svn-base +1 -0
  52. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveFormAttributesResult.html.svn-base +1 -0
  53. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveHttpProtocol.html.svn-base +1 -0
  54. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveHttpProtocolResult.html.svn-base +1 -0
  55. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveHttpsProtocol.html.svn-base +1 -0
  56. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveHttpsProtocolResult.html.svn-base +1 -0
  57. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveInputAttributes.html.svn-base +1 -0
  58. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveInputAttributesResult.html.svn-base +1 -0
  59. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveIntertagSpaces.html.svn-base +5 -0
  60. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveIntertagSpacesResult.html.svn-base +1 -0
  61. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveJavaScriptProtocol.html.svn-base +1 -0
  62. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveJavaScriptProtocolResult.html.svn-base +1 -0
  63. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveLinkAttributes.html.svn-base +5 -0
  64. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveLinkAttributesResult.html.svn-base +1 -0
  65. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveMultiSpaces.html.svn-base +1 -0
  66. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveMultiSpacesResult.html.svn-base +1 -0
  67. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveQuotes.html.svn-base +7 -0
  68. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveQuotesResult.html.svn-base +1 -0
  69. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveScriptAttributes.html.svn-base +6 -0
  70. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveScriptAttributesResult.html.svn-base +1 -0
  71. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveSpacesInsideTags.html.svn-base +1 -0
  72. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveSpacesInsideTagsResult.html.svn-base +1 -0
  73. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveStyleAttributes.html.svn-base +3 -0
  74. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testRemoveStyleAttributesResult.html.svn-base +1 -0
  75. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testSimpleBooleanAttributes.html.svn-base +1 -0
  76. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testSimpleBooleanAttributesResult.html.svn-base +1 -0
  77. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testSimpleDoctype.html.svn-base +2 -0
  78. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testSimpleDoctypeResult.html.svn-base +1 -0
  79. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testSurroundingSpaces.html.svn-base +1 -0
  80. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/.svn/text-base/testSurroundingSpacesResult.html.svn-base +1 -0
  81. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompress.html +11 -0
  82. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompressCss.html +11 -0
  83. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompressCssResult.html +6 -0
  84. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompressJavaScript.html +24 -0
  85. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompressJavaScriptClosureResult.html +7 -0
  86. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompressJavaScriptYuiResult.html +7 -0
  87. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testCompressResult.html +1 -0
  88. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testEnabled.html +1 -0
  89. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testEnabledResult.html +1 -0
  90. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testPreserveLineBreaks.html +11 -0
  91. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testPreserveLineBreaksResult.html +5 -0
  92. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testPreservePatterns.html +7 -0
  93. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testPreservePatternsResult.html +1 -0
  94. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testPreserveTextareas.html +2 -0
  95. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testPreserveTextareasResult.html +1 -0
  96. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveComments.html +17 -0
  97. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveCommentsResult.html +4 -0
  98. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveFormAttributes.html +1 -0
  99. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveFormAttributesResult.html +1 -0
  100. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveHttpProtocol.html +1 -0
  101. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveHttpProtocolResult.html +1 -0
  102. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveHttpsProtocol.html +1 -0
  103. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveHttpsProtocolResult.html +1 -0
  104. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveInputAttributes.html +1 -0
  105. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveInputAttributesResult.html +1 -0
  106. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveIntertagSpaces.html +5 -0
  107. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveIntertagSpacesResult.html +1 -0
  108. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveJavaScriptProtocol.html +1 -0
  109. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveJavaScriptProtocolResult.html +1 -0
  110. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveLinkAttributes.html +5 -0
  111. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveLinkAttributesResult.html +1 -0
  112. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveMultiSpaces.html +1 -0
  113. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveMultiSpacesResult.html +1 -0
  114. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveQuotes.html +7 -0
  115. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveQuotesResult.html +1 -0
  116. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveScriptAttributes.html +6 -0
  117. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveScriptAttributesResult.html +1 -0
  118. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveSpacesInsideTags.html +1 -0
  119. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveSpacesInsideTagsResult.html +1 -0
  120. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveStyleAttributes.html +3 -0
  121. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testRemoveStyleAttributesResult.html +1 -0
  122. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testSimpleBooleanAttributes.html +1 -0
  123. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testSimpleBooleanAttributesResult.html +1 -0
  124. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testSimpleDoctype.html +2 -0
  125. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testSimpleDoctypeResult.html +1 -0
  126. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testSurroundingSpaces.html +1 -0
  127. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/html/testSurroundingSpacesResult.html +1 -0
  128. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/all-wcprops +53 -0
  129. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/entries +300 -0
  130. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testCompress.xml.svn-base +11 -0
  131. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testCompressResult.xml.svn-base +5 -0
  132. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testEnabled.xml.svn-base +1 -0
  133. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testEnabledResult.xml.svn-base +1 -0
  134. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testRemoveComments.xml.svn-base +5 -0
  135. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testRemoveCommentsResult.xml.svn-base +4 -0
  136. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testRemoveIntertagSpaces.xml.svn-base +11 -0
  137. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/.svn/text-base/testRemoveIntertagSpacesResult.xml.svn-base +5 -0
  138. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testCompress.xml +11 -0
  139. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testCompressResult.xml +5 -0
  140. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testEnabled.xml +1 -0
  141. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testEnabledResult.xml +1 -0
  142. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testRemoveComments.xml +5 -0
  143. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testRemoveCommentsResult.xml +4 -0
  144. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testRemoveIntertagSpaces.xml +11 -0
  145. data/lib/middleman-minify-html/vendor/htmlcompressor-0.0.6/test/resources/xml/testRemoveIntertagSpacesResult.xml +5 -0
  146. data/lib/middleman-minify-html/version.rb +1 -1
  147. data/middleman-minify-html.gemspec +13 -17
  148. metadata +156 -43
  149. data/fixtures/basic-app/config.rb +0 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 725e6f476d76ed3b3a3f74c9e086ec5f8c11808f
4
+ data.tar.gz: 10ee97c0bb5764ae2d28726c231a5261fe4a09df
5
+ SHA512:
6
+ metadata.gz: d7f0f404032730695564bc323ecd5879156fd735217b16022a0df0a7218cd83c0e0e81c7b84fec2b4cd8b44b862a68d890f1e4c360d0b717ad66d005a8a83aa0
7
+ data.tar.gz: 741847a36db91a290d7d582767709d65ca0275bbb757dbfd82cdd6dc12d82c678cf1c2312354a30e33bc8b162dcca00f0418676f6cc91132a3a2897513096a0c
data/.travis.yml CHANGED
@@ -1,15 +1,14 @@
1
1
  rvm:
2
2
  - 1.8.7
3
- - 1.9.2
4
3
  - 1.9.3
4
+ - 2.0.0
5
5
  - jruby-18mode
6
6
  - jruby-19mode
7
7
 
8
- script: "bundle exec rake test"
8
+ gemfile:
9
+ - Gemfile
10
+ - Gemfile-3.0
9
11
 
10
- env: TEST=true
12
+ script: "bundle exec rake test"
11
13
 
12
- matrix:
13
- allow_failures:
14
- - rvm: jruby-18mode
15
- - rvm: jruby-19mode
14
+ env: TEST=true
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,43 @@
1
+ # Contributing
2
+ In the spirit of [free software][free-sw], **everyone** is encouraged to help
3
+ improve this project.
4
+
5
+ [free-sw]: http://www.fsf.org/licensing/essays/free-sw.html
6
+
7
+ Here are some ways *you* can contribute:
8
+
9
+ * by using alpha, beta, and prerelease versions
10
+ * by reporting bugs
11
+ * by suggesting new features
12
+ * by writing or editing documentation
13
+ * by writing specifications
14
+ * by writing code ( **no patch is too small** : fix typos, add comments, clean up inconsistent whitespace )
15
+ * by refactoring code
16
+ * by closing [issues][]
17
+ * by reviewing patches
18
+
19
+ [issues]: https://github.com/middleman/middleman-minify-html/issues
20
+
21
+ ## Submitting an Issue
22
+ We use the [GitHub issue tracker][issues] to track bugs and features. Before
23
+ submitting a bug report or feature request, check to make sure it hasn't
24
+ already been submitted. When submitting a bug report, please include a [Gist][]
25
+ that includes a stack trace and any details that may be necessary to reproduce
26
+ the bug, including your gem version, Ruby version, and operating system.
27
+ Ideally, a bug report should include a pull request with failing specs.
28
+
29
+ [gist]: https://gist.github.com/
30
+
31
+ ## Submitting a Pull Request
32
+ 1. [Fork the repository.][fork]
33
+ 2. [Create a topic branch.][branch]
34
+ 3. Add specs for your unimplemented feature or bug fix.
35
+ 4. Run `bundle exec rake test`. If your specs pass, return to step 3.
36
+ 5. Implement your feature or bug fix.
37
+ 6. Run `bundle exec rake test`. If your specs fail, return to step 5.
38
+ 7. Add, commit, and push your changes.
39
+ 8. [Submit a pull request.][pr]
40
+
41
+ [fork]: http://help.github.com/fork-a-repo/
42
+ [branch]: http://learn.github.com/p/branching.html
43
+ [pr]: http://help.github.com/send-pull-requests/
data/Gemfile CHANGED
@@ -1,20 +1,23 @@
1
- source :rubygems
1
+ source "https://rubygems.org"
2
2
 
3
- git "git://github.com/middleman/middleman.git" do
4
- # gem "middleman"
5
- gem "middleman-core"
6
- # gem "middleman-more"
7
- end
3
+ gem "middleman-core", :github => "middleman/middleman"
8
4
 
9
- # Specify your gem's dependencies in middleman-blog.gemspec
5
+ # Specify your gem's dependencies in middleman-minify-html.gemspec
10
6
  gemspec
11
7
 
12
- group :development do
13
- gem "cucumber", "~> 1.1.0"
14
- gem "fivemat"
15
- gem "aruba", "~> 0.4.11"
16
- gem "rake", "~> 0.9.2"
17
- gem "rspec", "~> 2.7"
18
- # gem "rdoc", "~> 3.9"
19
- # gem "yard"
8
+ gem "rake", "~> 10.0.3", :require => false
9
+ gem "yard", "~> 0.8.0", :require => false
10
+
11
+ gem "cucumber", "~> 1.3.1"
12
+ gem "fivemat"
13
+ gem "aruba", "~> 0.5.1"
14
+ gem "rspec", "~> 2.12"
15
+ gem "builder", "~> 3.0.0"
16
+
17
+ # Code Quality
18
+ gem "cane", :platforms => [:mri_19, :mri_20], :require => false
19
+
20
+ # Cross-templating language block fix for Ruby 1.8
21
+ platforms :mri_18 do
22
+ gem "ruby18_source_location"
20
23
  end
data/Gemfile-3.0 ADDED
@@ -0,0 +1,18 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in middleman-minify-html.gemspec
4
+ gemspec
5
+
6
+ gem "middleman", "~> 3.0.0"
7
+
8
+ gem "rake", "~> 10.0.3", :require => false
9
+ gem "yard", "~> 0.8.0", :require => false
10
+
11
+ gem "cucumber", "~> 1.3.1"
12
+ gem "fivemat"
13
+ gem "aruba", "~> 0.5.1"
14
+ gem "rspec", "~> 2.12"
15
+ gem "builder", "~> 3.0.0"
16
+
17
+ # Code Quality
18
+ gem "cane", :platforms => [:mri_19, :mri_20], :require => false
@@ -1,4 +1,4 @@
1
- Copyright (c) 2010 Thomas Reynolds
1
+ Copyright (c) 2010-2013 Thomas Reynolds
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -17,4 +17,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
17
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
18
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
19
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -1,49 +1,59 @@
1
- # middleman-minify-html
1
+ # Middleman-Minify-HTML
2
2
 
3
- # Install
3
+ `middleman-minify-html` is an extension for the [Middleman] static site generator that minifies whitespace around HTML via [Htmlcompressor](https://github.com/paolochiodi/htmlcompressor).
4
+
5
+ ## Installation
6
+
7
+ If you're just getting started, install the `middleman` gem and generate a new project:
4
8
 
5
9
  ```
6
- gem install middleman-minify-html
10
+ gem install middleman
11
+ middleman init MY_PROJECT
7
12
  ```
8
13
 
9
- If you already have a Middleman project:
10
- Add `middleman-middleman-minify-html` to your `Gemfile`, and open your `config.rb` and add:
14
+ If you already have a Middleman project: Add `gem "middleman-minify-html"` to your `Gemfile` and run `bundle install`
15
+
16
+ ## Configuration
11
17
 
12
18
  ```
13
19
  activate :minify_html
14
20
  ```
15
21
 
16
- # Community
17
-
18
- The official community forum is available at:
19
-
20
- http://forum.middlemanapp.com/
22
+ ## Build & Dependency Status
21
23
 
22
- # Bug Reports
24
+ [![Gem Version](https://badge.fury.io/rb/middleman-minify-html.png)][gem]
25
+ [![Build Status](https://travis-ci.org/middleman/middleman-minify-html.png)][travis]
26
+ [![Dependency Status](https://gemnasium.com/middleman/middleman-minify-html.png?travis)][gemnasium]
27
+ [![Code Quality](https://codeclimate.com/github/middleman/middleman-minify-html.png)][codeclimate]
23
28
 
24
- GitHub Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems:
29
+ ## Community
25
30
 
26
- https://github.com/middleman/middleman-minify-html/issues
31
+ The official community forum is available at: http://forum.middlemanapp.com
27
32
 
28
- The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit Pull Requests containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.
33
+ ## Bug Reports
29
34
 
30
- # Build & Dependency Status
35
+ Github Issues are used for managing bug reports and feature requests. If you run into issues, please search the issues and submit new problems: https://github.com/middleman/middleman-minify-html/issues
31
36
 
32
- [![Build Status](http://travis-ci.org/middleman/middleman-minify-html.png)](http://travis-ci.org/middleman/middleman-minify-html)
37
+ The best way to get quick responses to your issues and swift fixes to your bugs is to submit detailed bug reports, include test cases and respond to developer questions in a timely manner. Even better, if you know Ruby, you can submit [Pull Requests](https://help.github.com/articles/using-pull-requests) containing Cucumber Features which describe how your feature should work or exploit the bug you are submitting.
33
38
 
34
- # How to Run Cucumber Tests
39
+ ## How to Run Cucumber Tests
35
40
 
36
41
  1. Checkout Repository: `git clone https://github.com/middleman/middleman-minify-html.git`
37
42
  2. Install Bundler: `gem install bundler`
38
43
  3. Run `bundle install` inside the project root to install the gem dependencies.
39
44
  4. Run test cases: `bundle exec rake test`
40
45
 
41
- # Donate
46
+ ## Donate
42
47
 
43
- [![Click here to lend your support to Middleman](https://www.pledgie.com/campaigns/15807.png)](http://www.pledgie.com/campaigns/15807)
48
+ [Click here to lend your support to Middleman](https://spacebox.io/s/4dXbHBorC3)
44
49
 
45
- # License
50
+ ## License
46
51
 
47
- Copyright (c) 2012 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
52
+ Copyright (c) 2012-2013 Thomas Reynolds. MIT Licensed, see [LICENSE] for details.
48
53
 
49
- [LICENSE]: https://github.com/middleman/middleman-blog/blob/master/LICENSE
54
+ [middleman]: http://middlemanapp.com
55
+ [gem]: https://rubygems.org/gems/middleman-minify-html
56
+ [travis]: http://travis-ci.org/middleman/middleman-minify-html
57
+ [gemnasium]: https://gemnasium.com/middleman/middleman-minify-html
58
+ [codeclimate]: https://codeclimate.com/github/middleman/middleman-minify-html
59
+ [LICENSE]: https://github.com/middleman/middleman-minify-html/blob/master/LICENSE.md
data/Rakefile CHANGED
@@ -2,13 +2,10 @@ require 'bundler'
2
2
  Bundler::GemHelper.install_tasks
3
3
 
4
4
  require 'cucumber/rake/task'
5
-
6
5
  Cucumber::Rake::Task.new(:cucumber, 'Run features that should pass') do |t|
7
6
  ENV["TEST"] = "true"
8
-
9
7
  exempt_tags = ""
10
8
  exempt_tags << "--tags ~@nojava" if RUBY_PLATFORM == "java"
11
-
12
9
  t.cucumber_opts = "--color --tags ~@wip #{exempt_tags} --strict --format #{ENV['CUCUMBER_FORMAT'] || 'pretty'}"
13
10
  end
14
11
 
@@ -16,6 +13,19 @@ require 'rake/clean'
16
13
 
17
14
  task :test => ["cucumber"]
18
15
 
16
+ begin
17
+ require 'cane/rake_task'
18
+
19
+ desc "Run cane to check quality metrics"
20
+ Cane::RakeTask.new(:quality) do |cane|
21
+ cane.no_style = true
22
+ cane.no_doc = true
23
+ cane.abc_glob = "lib/middleman-minify-html/**/*.rb"
24
+ end
25
+ rescue LoadError
26
+ # warn "cane not available, quality task not provided."
27
+ end
28
+
19
29
  desc "Build HTML documentation"
20
30
  task :doc do
21
31
  sh 'bundle exec yard'
@@ -0,0 +1,17 @@
1
+ Feature: Keep Empty Text Area's
2
+
3
+ Scenario: Preview HTML with minify_html enabled
4
+ Given "minify_html" feature is "enabled"
5
+ And the Server is running at "basic-app"
6
+ When I go to "/empty-text-area.html"
7
+ Then I should see "<textarea></textarea>"
8
+
9
+ Scenario: Build HTML with minify_html enabled
10
+ Given a fixture app "basic-app"
11
+ And a file named "config.rb" with:
12
+ """
13
+ activate :minify_html
14
+ """
15
+ And a successfully built app at "basic-app"
16
+ When I cd to "build"
17
+ Then the file "empty-text-area.html" should contain "<textarea></textarea>"
@@ -11,6 +11,15 @@ Feature: Minify HTML
11
11
  And the Server is running at "basic-app"
12
12
  When I go to "/index.html"
13
13
  Then I should see "1" lines
14
+ When I go to "/foobar.php"
15
+ Then I should see:
16
+ """
17
+ <?php
18
+ echo "foo";
19
+ // a comment
20
+ echo "bar";
21
+ ?>
22
+ """
14
23
 
15
24
  Scenario: Build HTML with minify_html disabled
16
25
  Given a fixture app "basic-app"
@@ -29,4 +38,12 @@ Feature: Minify HTML
29
38
  """
30
39
  And a successfully built app at "basic-app"
31
40
  When I cd to "build"
32
- Then the file "index.html" should contain "<h1> Multi Line </h1><h2> Broken Up </h2>"
41
+ Then the file "index.html" should contain " <h1> Multi Line </h1> <h2> Broken Up </h2> "
42
+ Then the file "foobar.php" should contain:
43
+ """
44
+ <?php
45
+ echo "foo";
46
+ // a comment
47
+ echo "bar";
48
+ ?>
49
+ """
@@ -0,0 +1,9 @@
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <title>Hello World</title>
5
+ </head>
6
+ <body>
7
+ <textarea></textarea>
8
+ </body>
9
+ </html>
@@ -0,0 +1,5 @@
1
+ <?php
2
+ echo "foo";
3
+ // a comment
4
+ echo "bar";
5
+ ?>
@@ -6,7 +6,7 @@ module Middleman
6
6
 
7
7
  app.after_configuration do
8
8
  unless respond_to?(:html_compressor) && html_compressor
9
- require 'htmlcompressor'
9
+ require File.join(File.dirname(__FILE__), 'vendor/htmlcompressor-0.0.6/lib/htmlcompressor')
10
10
  set :html_compressor, ::HtmlCompressor::Compressor.new(options)
11
11
  end
12
12
 
@@ -0,0 +1,17 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ .yardoc
6
+ Gemfile.lock
7
+ InstalledFiles
8
+ _yardoc
9
+ coverage
10
+ doc/
11
+ lib/bundler/man
12
+ pkg
13
+ rdoc
14
+ spec/reports
15
+ test/tmp
16
+ test/version_tmp
17
+ tmp
@@ -0,0 +1,12 @@
1
+ 0.0.6 - 19/04/2013
2
+ Switch to POSIX "bracket expression" from \p{Blank} to provide better ruby compatibility
3
+ Minor fixes to README
4
+ 0.0.5 - 31/01/2013
5
+ Safer rack default options: remove_intertag_spaces => false
6
+ README more clear
7
+ 0.0.4 - 16/01/2013
8
+ Preserve empty textarea (issue #3)
9
+ 0.0.3 - 18/05/2012
10
+ Added customizable options to rack middlewar
11
+ 0.0.2
12
+ First realase
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in htmlcompressor.gemspec
4
+ gemspec
@@ -0,0 +1,13 @@
1
+ Copyright (c) 2012 Paolo Chiodi
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
@@ -0,0 +1,106 @@
1
+ # Htmlcompressor
2
+
3
+ ## Put your html on a diet
4
+
5
+ Htmlcompressor provides tools to minify html code.
6
+ It includes
7
+ - HtmlCompressor::Compressor class which is a raw port of [google's htmlcompressor](http://code.google.com/p/htmlcompressor/)
8
+ - HtmlCompressor::Rack a rack middleware to compress html pages on the fly
9
+
10
+ Please note that Htmlcompressor is still in alpha version and need some additional love.
11
+
12
+ ## Usage
13
+
14
+ Using the compressor class is straightforward:
15
+
16
+ ```ruby
17
+ compressor = HtmlCompressor::Compressor.new
18
+ compressor.compress('<html><body><div id="compress_me"></div></body></html>')
19
+ ```
20
+
21
+ The compressor ships with basic and safe default options that may be overwritten passing the options hash to the constructor:
22
+
23
+ ```ruby
24
+ options = {
25
+ :enabled => true
26
+ :remove_multi_spaces => true,
27
+ :remove_comments => true,
28
+ :remove_intertag_spaces => false,
29
+ :remove_quotes => false,
30
+ :compress_css => false,
31
+ :compress_javascript => false,
32
+ :simple_doctype => false,
33
+ :remove_script_attributes => false,
34
+ :remove_style_attributes => false,
35
+ :remove_link_attributes => false,
36
+ :remove_form_attributes => false,
37
+ :remove_input_attributes => false,
38
+ :remove_javascript_protocol => false,
39
+ :remove_http_protocol => false,
40
+ :remove_https_protocol => false,
41
+ :preserve_line_breaks => false,
42
+ :simple_boolean_attributes => false
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,
60
+ :remove_quotes => true,
61
+ :compress_css => false,
62
+ :compress_javascript => false,
63
+ :simple_doctype => false,
64
+ :remove_script_attributes => true,
65
+ :remove_style_attributes => true,
66
+ :remove_link_attributes => true,
67
+ :remove_form_attributes => false,
68
+ :remove_input_attributes => true,
69
+ :remove_javascript_protocol => true,
70
+ :remove_http_protocol => true,
71
+ :remove_https_protocol => false,
72
+ :preserve_line_breaks => false,
73
+ :simple_boolean_attributes => true
74
+ }
75
+ ```
76
+
77
+ Rails 2.3 users may need to add
78
+ ```ruby
79
+ require 'htmlcompressor'
80
+ ```
81
+
82
+ ## Statistics
83
+
84
+ As of now the statistic framework hasn't been ported. Refer to original [htmlcompressor documentation](http://code.google.com/p/htmlcompressor/) for statistics on minified pages.
85
+
86
+ ## License
87
+
88
+ Licensed under the Apache License, Version 2.0 (the "License");
89
+ you may not use this file except in compliance with the License.
90
+ You may obtain a copy of the License at
91
+
92
+ http://www.apache.org/licenses/LICENSE-2.0
93
+
94
+ Unless required by applicable law or agreed to in writing, software
95
+ distributed under the License is distributed on an "AS IS" BASIS,
96
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
97
+ See the License for the specific language governing permissions and
98
+ limitations under the License.
99
+
100
+ ## Contributing
101
+
102
+ 1. Fork it
103
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
104
+ 3. Commit your changes (`git commit -am 'Added some feature'`)
105
+ 4. Push to the branch (`git push origin my-new-feature`)
106
+ 5. Create new Pull Request