headhunter 0.1.7 → 0.1.8

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.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +28 -3
  5. data/lib/headhunter.rb +11 -5
  6. data/lib/headhunter/css_hunter.rb +4 -3
  7. data/lib/headhunter/css_validator.rb +21 -15
  8. data/lib/headhunter/engine.rb +11 -0
  9. data/lib/headhunter/html_validator.rb +8 -6
  10. data/lib/headhunter/rails.rb +10 -12
  11. data/lib/headhunter/runner.rb +1 -1
  12. data/lib/headhunter/version.rb +1 -1
  13. data/lib/tasks/headhunter_tasks.rake +4 -0
  14. data/lib/tidy/{tidy → tidy2} +0 -0
  15. data/spec/dummy/Gemfile +9 -0
  16. data/spec/dummy/Gemfile.lock +178 -0
  17. data/spec/dummy/README.rdoc +28 -0
  18. data/spec/dummy/Rakefile +13 -0
  19. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  20. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  21. data/spec/dummy/app/assets/stylesheets/scaffold.css +56 -0
  22. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  23. data/spec/dummy/app/controllers/posts_controller.rb +5 -0
  24. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  25. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  26. data/spec/dummy/app/views/posts/index.html.erb +21 -0
  27. data/spec/dummy/bin/bundle +3 -0
  28. data/spec/dummy/bin/rails +4 -0
  29. data/spec/dummy/bin/rake +4 -0
  30. data/spec/dummy/config.ru +4 -0
  31. data/spec/dummy/config/application.rb +26 -0
  32. data/spec/dummy/config/boot.rb +5 -0
  33. data/spec/dummy/config/database.yml +25 -0
  34. data/spec/dummy/config/environment.rb +5 -0
  35. data/spec/dummy/config/environments/development.rb +26 -0
  36. data/spec/dummy/config/environments/production.rb +80 -0
  37. data/spec/dummy/config/environments/test.rb +36 -0
  38. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  39. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  40. data/spec/dummy/config/initializers/inflections.rb +16 -0
  41. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  42. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  43. data/spec/dummy/config/initializers/session_store.rb +3 -0
  44. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  45. data/spec/dummy/config/locales/en.yml +23 -0
  46. data/spec/dummy/config/routes.rb +58 -0
  47. data/spec/dummy/log/development.log +247 -0
  48. data/spec/dummy/log/test.log +452 -0
  49. data/spec/dummy/public/404.html +58 -0
  50. data/spec/dummy/public/422.html +58 -0
  51. data/spec/dummy/public/500.html +57 -0
  52. data/spec/dummy/public/favicon.ico +0 -0
  53. data/spec/dummy/spec/features/bla_spec.rb +9 -0
  54. data/spec/dummy/spec/spec_helper.rb +16 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/1e8f75a6b5b33970fb8e397347caa0a1 +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/24204f742af588c8166d3160b500d20f +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/510da110ae528e2d22533be39ff696c5 +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  70. data/spec/dummy/tmp/cache/assets/test/sprockets/13fe41fee1fe35b49d145bcc06610705 +0 -0
  71. data/spec/dummy/tmp/cache/assets/test/sprockets/2f5173deea6c795b8fdde723bb4b63af +0 -0
  72. data/spec/dummy/tmp/cache/assets/test/sprockets/357970feca3ac29060c1e3861e2c0953 +0 -0
  73. data/spec/dummy/tmp/cache/assets/test/sprockets/371bf96e99717688ed7313a0c53f4212 +0 -0
  74. data/spec/dummy/tmp/cache/assets/test/sprockets/416150dc3ac35079c94273cc46e90aa6 +0 -0
  75. data/spec/dummy/tmp/cache/assets/test/sprockets/5384ad85f52d3272dbc64d46ef3876a4 +0 -0
  76. data/spec/dummy/tmp/cache/assets/test/sprockets/6fc757c2c8329244ca95d6909865bbc2 +0 -0
  77. data/spec/dummy/tmp/cache/assets/test/sprockets/c85016e7bbd4f3adbb7635d01f85d39b +0 -0
  78. data/spec/dummy/tmp/cache/assets/test/sprockets/cffd775d018f68ce5dba1ee0d951a994 +0 -0
  79. data/spec/dummy/tmp/cache/assets/test/sprockets/d066c004d1fd26ae76a61303a7a18145 +0 -0
  80. data/spec/dummy/tmp/cache/assets/test/sprockets/d771ace226fc8215a3572e0aa35bb0d6 +0 -0
  81. data/spec/dummy/tmp/cache/assets/test/sprockets/f7cbd26ba1d28d48de824f0e94586655 +0 -0
  82. data/spec/files/css_hunter/valid.html +15 -0
  83. data/spec/files/css_validator/invalid.css +42 -0
  84. data/spec/files/css_validator/invalid_response.xml +40 -0
  85. data/spec/files/css_validator/valid.css +39 -0
  86. data/spec/files/css_validator/valid_response.xml +23 -0
  87. data/spec/files/html_validator/invalid.html +15 -0
  88. data/spec/files/html_validator/invalid_response.txt +1 -0
  89. data/spec/files/html_validator/valid.html +15 -0
  90. data/spec/files/html_validator/valid_response.txt +0 -0
  91. data/spec/files/html_with_srcset.html +14 -0
  92. data/spec/files/html_without_srcset.html +14 -0
  93. data/spec/files/invalid2.html +16 -0
  94. data/spec/files/valid-1.css +31 -0
  95. data/spec/files/valid-2.css +42 -0
  96. data/spec/files/valid-3.css +48 -0
  97. data/spec/files/valid.html5 +14 -0
  98. data/spec/files/valid_with_cache_busters.html +16 -0
  99. data/spec/files/valid_without_cache_busters.html +16 -0
  100. data/spec/lib/headhunter/css_hunter_spec.rb +83 -0
  101. data/spec/lib/headhunter/css_validator_spec.rb +196 -0
  102. data/spec/lib/headhunter/html_validator_spec.rb +143 -0
  103. data/spec/spec_helper.rb +25 -0
  104. metadata +193 -86
  105. data/Gemfile +0 -4
  106. data/Gemfile.lock +0 -78
  107. data/README.md +0 -78
  108. data/docs/headhunter.png +0 -0
  109. data/docs/money.png +0 -0
  110. data/docs/screenshot.png +0 -0
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/404.html -->
52
+ <div class="dialog">
53
+ <h1>The page you were looking for doesn't exist.</h1>
54
+ <p>You may have mistyped the address or the page may have moved.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,58 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/422.html -->
52
+ <div class="dialog">
53
+ <h1>The change you wanted was rejected.</h1>
54
+ <p>Maybe you tried to change something you didn't have access to.</p>
55
+ </div>
56
+ <p>If you are the application owner check the logs for more information.</p>
57
+ </body>
58
+ </html>
@@ -0,0 +1,57 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style>
6
+ body {
7
+ background-color: #EFEFEF;
8
+ color: #2E2F30;
9
+ text-align: center;
10
+ font-family: arial, sans-serif;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 25em;
15
+ margin: 4em auto 0 auto;
16
+ border: 1px solid #CCC;
17
+ border-right-color: #999;
18
+ border-left-color: #999;
19
+ border-bottom-color: #BBB;
20
+ border-top: #B00100 solid 4px;
21
+ border-top-left-radius: 9px;
22
+ border-top-right-radius: 9px;
23
+ background-color: white;
24
+ padding: 7px 4em 0 4em;
25
+ }
26
+
27
+ h1 {
28
+ font-size: 100%;
29
+ color: #730E15;
30
+ line-height: 1.5em;
31
+ }
32
+
33
+ body > p {
34
+ width: 33em;
35
+ margin: 0 auto 1em;
36
+ padding: 1em 0;
37
+ background-color: #F7F7F7;
38
+ border: 1px solid #CCC;
39
+ border-right-color: #999;
40
+ border-bottom-color: #999;
41
+ border-bottom-left-radius: 4px;
42
+ border-bottom-right-radius: 4px;
43
+ border-top-color: #DADADA;
44
+ color: #666;
45
+ box-shadow:0 3px 8px rgba(50, 50, 50, 0.17);
46
+ }
47
+ </style>
48
+ </head>
49
+
50
+ <body>
51
+ <!-- This file lives in public/500.html -->
52
+ <div class="dialog">
53
+ <h1>We're sorry, but something went wrong.</h1>
54
+ </div>
55
+ <p>If you are the application owner check the logs for more information.</p>
56
+ </body>
57
+ </html>
File without changes
@@ -0,0 +1,9 @@
1
+ require 'spec_helper'
2
+
3
+ feature 'Middleware integration' do
4
+ scenario "Integrating the middleware into the Rack stack" do
5
+ pending "The expectation doesn't work, see http://stackoverflow.com/questions/21940082"
6
+ Headhunter::Rack::CapturingMiddleware.any_instance.should_receive(:call)
7
+ visit posts_path
8
+ end
9
+ end
@@ -0,0 +1,16 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+
3
+ require File.expand_path("../../config/environment.rb", __FILE__)
4
+ require 'rspec/rails'
5
+ require 'rspec/autorun'
6
+
7
+ Rails.backtrace_cleaner.remove_silencers!
8
+
9
+ # Load support files
10
+ Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
11
+
12
+ RSpec.configure do |config|
13
+ config.mock_with :rspec
14
+ config.infer_base_class_for_anonymous_controllers = false
15
+ config.order = 'random'
16
+ end
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title>Test Valid Page</title>
7
+ </head>
8
+
9
+ <body>
10
+
11
+ <h1>Test#valid</h1>
12
+ <p>This is an example valid html file</p>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1,42 @@
1
+ html, body
2
+ {
3
+ background:#007086;
4
+ font-family:Arial,Helvetica,sans-serif;
5
+ font-size:0.83em;
6
+ margin:0;
7
+ padding:0;
8
+ wibble:0;
9
+ }
10
+
11
+ *
12
+ {
13
+ margin:0
14
+ padding:0;
15
+ }
16
+ ul, ul li
17
+ {
18
+ list-style-type: none;
19
+ }
20
+
21
+ .hidden
22
+ {
23
+ display none;
24
+ }
25
+ a img
26
+ border: none;
27
+ }
28
+ a
29
+ {
30
+ text-decoration: none;
31
+ }
32
+ a:hover
33
+ {
34
+ text-decoration: underline;
35
+ }
36
+ .clear-float
37
+ {
38
+ clear: both;
39
+ font-size: 1px;
40
+ height: 0px;
41
+ line-height: 0px;
42
+ }
@@ -0,0 +1,40 @@
1
+ {vextwarning=false, output=soap12, lang=en, warning=2, medium=all, profile=css3}
2
+ <?xml version='1.0' encoding="utf-8"?>
3
+ <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
4
+ <env:Body>
5
+ <m:cssvalidationresponse
6
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
7
+ xmlns:m="http://www.w3.org/2005/07/css-validator">
8
+ <m:uri>file:tmp.css</m:uri>
9
+ <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>
10
+ <m:csslevel>css3</m:csslevel>
11
+ <m:date>2014-01-28T09:33:32Z</m:date>
12
+ <m:validity>false</m:validity>
13
+ <m:result>
14
+ <m:errors xml:lang="en">
15
+ <m:errorcount>1</m:errorcount>
16
+ <m:errorlist>
17
+ <m:uri>file:tmp.css</m:uri>
18
+ <m:error>
19
+ <m:line>1</m:line>
20
+ <m:errortype>parse-error</m:errortype>
21
+ <m:context> invalid_property </m:context>
22
+ <m:errorsubtype>
23
+ exp
24
+ </m:errorsubtype>
25
+ <m:skippedstring>
26
+ 123
27
+ </m:skippedstring>
28
+ <m:message>
29
+ Property bla doesn&#39;t exist :
30
+ </m:message>
31
+ </m:error>
32
+ </m:errorlist>
33
+ </m:errors>
34
+ <m:warnings xml:lang="en">
35
+ <m:warningcount>0</m:warningcount>
36
+ </m:warnings>
37
+ </m:result>
38
+ </m:cssvalidationresponse>
39
+ </env:Body>
40
+ </env:Envelope>
@@ -0,0 +1,39 @@
1
+ html, body {
2
+ background: #007086;
3
+ font-family: Arial,Helvetica,sans-serif;
4
+ font-size: 0.83em;
5
+ margin: 0;
6
+ padding: 0;
7
+ }
8
+
9
+ * {
10
+ margin: 0;
11
+ padding: 0;
12
+ }
13
+
14
+ ul, ul li {
15
+ list-style-type: none;
16
+ }
17
+
18
+ .hidden {
19
+ display: none;
20
+ }
21
+
22
+ a img {
23
+ border: none;
24
+ }
25
+
26
+ a {
27
+ text-decoration: none;
28
+ }
29
+
30
+ a:hover {
31
+ text-decoration: underline;
32
+ }
33
+
34
+ .clear-float {
35
+ clear: both;
36
+ font-size: 1px;
37
+ height: 0px;
38
+ line-height: 0px;
39
+ }
@@ -0,0 +1,23 @@
1
+ {vextwarning=false, output=soap12, lang=en, warning=2, medium=all, profile=css3}
2
+ <?xml version='1.0' encoding="utf-8"?>
3
+ <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
4
+ <env:Body>
5
+ <m:cssvalidationresponse
6
+ env:encodingStyle="http://www.w3.org/2003/05/soap-encoding"
7
+ xmlns:m="http://www.w3.org/2005/07/css-validator">
8
+ <m:uri>file:tmp.css</m:uri>
9
+ <m:checkedby>http://jigsaw.w3.org/css-validator/</m:checkedby>
10
+ <m:csslevel>css3</m:csslevel>
11
+ <m:date>2014-01-28T09:33:32Z</m:date>
12
+ <m:validity>true</m:validity>
13
+ <m:result>
14
+ <m:errors xml:lang="en">
15
+ <m:errorcount>0</m:errorcount>
16
+ </m:errors>
17
+ <m:warnings xml:lang="en">
18
+ <m:warningcount>0</m:warningcount>
19
+ </m:warnings>
20
+ </m:result>
21
+ </m:cssvalidationresponse>
22
+ </env:Body>
23
+ </env:Envelope>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
+
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ <title>Test Invalid Page</title>
7
+ </head>
8
+
9
+ <body>
10
+
11
+ <h1>Test#invalid</h1>
12
+ <p><b>This is an example invalid html file</p></b>
13
+
14
+ </body>
15
+ </html>
@@ -0,0 +1 @@
1
+ "line 1 column 278 - Error: <header> is not recognized!\nline 1 column 278 - Warning: discarding unexpected <header>\nline 1 column 302 - Error: <aside> is not recognized!