kracker 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +14 -0
  5. data/Gemfile +16 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +33 -0
  8. data/Rakefile +23 -0
  9. data/app/assets/javascripts/application.js +1 -0
  10. data/app/assets/stylesheets/1236_grid.css +21 -0
  11. data/app/assets/stylesheets/720_grid.css +33 -0
  12. data/app/assets/stylesheets/986_grid.css +24 -0
  13. data/app/assets/stylesheets/kracker.css +134 -0
  14. data/app/assets/stylesheets/normalize.css +425 -0
  15. data/app/controllers/kracker_application_controller.rb +8 -0
  16. data/app/controllers/kracker_controller.rb +114 -0
  17. data/app/views/kracker/about.html.erb +3 -0
  18. data/app/views/kracker/artifacts.html.erb +16 -0
  19. data/app/views/kracker/index.html.erb +12 -0
  20. data/app/views/kracker/new.html.erb +15 -0
  21. data/app/views/kracker/path_config.html.erb +8 -0
  22. data/app/views/kracker/show.html.erb +42 -0
  23. data/app/views/layouts/kracker.html.erb +32 -0
  24. data/app/views/shared/_dom_set.html.erb +35 -0
  25. data/app/views/shared/_kracker_nav.html.erb +8 -0
  26. data/config/routes.rb +17 -0
  27. data/kracker.gemspec +27 -0
  28. data/lib/kracker/analysis.rb +114 -0
  29. data/lib/kracker/element.rb +92 -0
  30. data/lib/kracker/kracker.rb +112 -0
  31. data/lib/kracker/locations.rb +49 -0
  32. data/lib/kracker/rails/engine.rb +7 -0
  33. data/lib/kracker/svg.rb +71 -0
  34. data/lib/kracker/version.rb +3 -0
  35. data/lib/kracker.rb +7 -0
  36. data/test/page_objects/kracker/about_page.rb +7 -0
  37. data/test/page_objects/kracker/artifacts_page.rb +7 -0
  38. data/test/page_objects/kracker/config_page.rb +19 -0
  39. data/test/page_objects/kracker/index_page.rb +9 -0
  40. data/test/page_objects/kracker/local_index_page.rb +7 -0
  41. data/test/page_objects/kracker/new_page.rb +7 -0
  42. data/test/page_objects/kracker/show_page.rb +15 -0
  43. data/test/page_objects/kracker/viewer_page.rb +15 -0
  44. data/test/page_objects/navigation.rb +34 -0
  45. data/test/page_objects.rb +13 -0
  46. data/test/selenium/mapping_test.rb +98 -0
  47. data/test/selenium/viewer_test.rb +25 -0
  48. data/test/selenium_test_helper.rb +102 -0
  49. data/test/test_app/Gemfile +10 -0
  50. data/test/test_app/app/assets/stylesheets/local_app.css +25 -0
  51. data/test/test_app/app/controllers/application_controller.rb +2 -0
  52. data/test/test_app/app/controllers/local_controller.rb +8 -0
  53. data/test/test_app/app/views/layouts/local.html.erb +14 -0
  54. data/test/test_app/app/views/local/index.html.erb +45 -0
  55. data/test/test_app/config/database.yml +13 -0
  56. data/test/test_app/config/initializers/kracker_initializer.rb +5 -0
  57. data/test/test_app/config/routes.rb +4 -0
  58. data/test/test_app/config.ru +31 -0
  59. data/test/test_app/test_app.rb +30 -0
  60. data/test/test_helper.rb +41 -0
  61. data/test/test_helpers/kracker_class_for_stubbing.rb +3 -0
  62. data/test/test_helpers/location_helpers.rb +29 -0
  63. data/test/test_objects/test_objects.rb +30 -0
  64. data/test/unit/analysis_test.rb +87 -0
  65. data/test/unit/element_test.rb +47 -0
  66. data/test/unit/kracker_test.rb +79 -0
  67. data/test/unit/location_test.rb +23 -0
  68. data/watchr_script.rb +3 -0
  69. metadata +199 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 2519b906199b0ef4f1da5c1bcf4e83bb2d922a82
4
+ data.tar.gz: bce714fda01e1e290725c1d8f8bf01a1266d9529
5
+ SHA512:
6
+ metadata.gz: df940798efaf203e8759ad8ac58709bc063c63f79bb3b0190c381518c5fdd666ddee5c91705c36862b4c448b01d51368ad44b14bc1c2bce3001ec862d036df91
7
+ data.tar.gz: d22913c1e85ee302d1115fbc4f8535663069dc4397c001f8236e83c815ab31df5df8c62ac9361bb86423c014aa7a33c300123656ea0d1df59c9d7d6c9ff45892
data/.gitignore ADDED
@@ -0,0 +1,21 @@
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
18
+ .idea
19
+ *.DS_store
20
+ test/test_app/log
21
+ test/test_app/tmp
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.0.0
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
5
+ - "2.1.0"
6
+ env:
7
+ - DB=sqlite
8
+ before_script:
9
+ - export DISPLAY=:99.0
10
+ - sh -e /etc/init.d/xvfb start
11
+ script:
12
+ - bundle exec rake
13
+ addons:
14
+ firefox: "19.0.1"
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in kracker.gemspec
4
+ gemspec
5
+
6
+ gem 'rails', '3.2.16'
7
+ gem 'mysql2'
8
+ gem 'minitest'
9
+ gem 'minitest-reporters'
10
+ gem 'awesome_print'
11
+ gem 'mocha'
12
+
13
+ gem 'selenium-webdriver', '2.37.0'
14
+ gem 'capybara', '2.2.1'
15
+ gem 'ae_page_objects', '1.0.0'
16
+
data/LICENSE.txt ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2014 geordie
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,33 @@
1
+ # Kracker
2
+
3
+ DOM element comparison
4
+
5
+ ## Travis-ci.org
6
+
7
+ [![Build Status](https://travis-ci.org/QuantumGeordie/kracker.png)](https://travis-ci.org/QuantumGeordie/kracker)
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ gem 'kracker'
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install kracker
22
+
23
+ ## Usage
24
+
25
+ Don't know yet. I'll let you know when i figure something out.
26
+
27
+ ## Contributing
28
+
29
+ 1. Fork it
30
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
31
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
32
+ 4. Push to the branch (`git push origin my-new-feature`)
33
+ 5. Create new Pull Request
data/Rakefile ADDED
@@ -0,0 +1,23 @@
1
+ require 'rake/testtask'
2
+ require "bundler/gem_tasks"
3
+
4
+ namespace :test do
5
+ desc 'unit tests'
6
+ Rake::TestTask.new :units do |t|
7
+ t.libs << '.'
8
+ t.libs << 'test'
9
+ t.pattern = 'test/unit/**/*_test.rb'
10
+ t.verbose = true
11
+ end
12
+
13
+ desc 'selenium tests'
14
+ Rake::TestTask.new :selenium do |t|
15
+ t.libs << '.'
16
+ t.libs << 'test'
17
+ t.pattern = 'test/selenium/**/*_test.rb'
18
+ end
19
+ end
20
+
21
+ task :test => [ 'test:units', 'test:selenium' ]
22
+
23
+ task :default => :test
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,21 @@
1
+ /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid)
2
+ * http://simplegrid.info
3
+ * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com)
4
+ * License: http://creativecommons.org/licenses/MIT/ */
5
+
6
+ /* Containers */
7
+ body { font-size: 1.125em; }
8
+ .grid{ width:1206px; }
9
+
10
+ /* 6-Col Grid Sizes */
11
+ .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:176px; } /* Sixths */
12
+ .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:382px; } /* Thirds */
13
+ .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:794px; } /* Two-Thirds */
14
+ .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:1000px; } /* Five-Sixths */
15
+
16
+ /* 4-Col Grid Sizes */
17
+ .slot-6,.slot-7,.slot-8,.slot-9{ width:279px; } /* Quarters */
18
+ .slot-6-7-8,.slot-7-8-9{ width:897px; } /* Three-Quarters */
19
+
20
+ /* 6-Col/4-Col Shared Grid Sizes */
21
+ .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:588px; } /* Halves */
@@ -0,0 +1,33 @@
1
+ /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid)
2
+ * http://simplegrid.info
3
+ * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com)
4
+ * License: http://creativecommons.org/licenses/MIT/ */
5
+
6
+ /* Containers */
7
+ body { font-size: 0.875em; padding: 0; }
8
+ .grid{ margin:0 auto; padding: 0 10px; width:700px; }
9
+ .row{ clear:left; }
10
+
11
+ /* Slots Setup */
12
+ .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-1-2,.slot-1-2-3,.slot-1-2-3-4,.slot-1-2-3-4-5,.slot-2-3,.slot-2-3-4,.slot-2-3-4-5,.slot-3-4,.slot-3-4-5,.slot-4-5,.slot-6,.slot-7,.slot-8,.slot-9,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-7-8,.slot-7-8-9,.slot-8-9{ display:inline; float:left; margin-left:20px; }
13
+
14
+ /* 6-Col Grid Sizes */
15
+ .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:100px; } /* Sixths */
16
+ .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:220px; } /* Thirds */
17
+ .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:460px; } /* Two-Thirds */
18
+ .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:580px; } /* Five-Sixths */
19
+
20
+ /* 4-Col Grid Sizes */
21
+ .slot-6,.slot-7,.slot-8,.slot-9{ width:160px; } /* Quarters */
22
+ .slot-6-7-8,.slot-7-8-9{ width:520px; } /* Three-Quarters */
23
+
24
+ /* 6-Col/4-Col Shared Grid Sizes */
25
+ .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:340px; } /* Halves */
26
+ .slot-0-1-2-3-4-5, .slot-6-7-8-9{ width: 100%; } /* Full-Width */
27
+
28
+ /* Zeroing Out Leftmost Slot Margins */
29
+ .slot-0,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-6,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-1 .slot-1,.slot-1-2 .slot-1,.slot-1-2 .slot-1-2,.slot-1-2-3 .slot-1,.slot-1-2-3 .slot-1-2,.slot-1-2-3 .slot-1-2-3,.slot-1-2-3-4 .slot-1,.slot-1-2-3-4 .slot-1-2,.slot-1-2-3-4 .slot-1-2-3,.slot-1-2-3-4 .slot-1-2-3-4,.slot-1-2-3-4-5 .slot-1,.slot-1-2-3-4-5 .slot-1-2,.slot-1-2-3-4-5 .slot-1-2-3,.slot-1-2-3-4-5 .slot-1-2-3-4,.slot-1-2-3-4-5 .slot-1-2-3-4-5,.slot-2 .slot-2,.slot-2-3 .slot-2,.slot-2-3 .slot-2-3,.slot-2-3-4 .slot-2,.slot-2-3-4 .slot-2-3,.slot-2-3-4 .slot-2-3-4,.slot-2-3-4-5 .slot-2,.slot-2-3-4-5 .slot-2-3,.slot-2-3-4-5 .slot-2-3-4,.slot-2-3-4-5 .slot-2-3-4-5,.slot-3 .slot-3,.slot-3-4 .slot-3,.slot-3-4 .slot-3-4,.slot-3-4-5 .slot-3,.slot-3-4-5 .slot-3-4,.slot-3-4-5 .slot-3-4-5,.slot-4 .slot-4,.slot-4-5 .slot-4,.slot-4-5 .slot-4-5,.slot-5 .slot-5,.slot-7 .slot-7,.slot-7-8 .slot-7,.slot-7-8 .slot-7-8,.slot-7-8-9 .slot-7,.slot-7-8-9 .slot-7-8,.slot-7-8-9 .slot-7-8-9,.slot-8 .slot-8,.slot-8-9 .slot-8,.slot-8-9 .slot-8-9{ margin-left:0 !important; } /* Important is to avoid repeating this in larger screen css files */
30
+
31
+ /* Row Clearfix */
32
+ .row:after{ visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; }
33
+ .row{ zoom:1; }
@@ -0,0 +1,24 @@
1
+ /* SimpleGrid - a fork of CSSGrid by Crowd Favorite (https://github.com/crowdfavorite/css-grid)
2
+ * http://simplegrid.info
3
+ * by Conor Muirhead (http://conor.cc) of Early LLC (http://earlymade.com)
4
+ * License: http://creativecommons.org/licenses/MIT/ */
5
+
6
+ /* Containers */
7
+ body { font-size: 100%; }
8
+ .grid{ width:966px; }
9
+
10
+ /* Slots Setup */
11
+ .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5,.slot-0-1,.slot-0-1-2,.slot-0-1-2-3,.slot-0-1-2-3-4,.slot-0-1-2-3-4-5,.slot-1-2,.slot-1-2-3,.slot-1-2-3-4,.slot-1-2-3-4-5,.slot-2-3,.slot-2-3-4,.slot-2-3-4-5,.slot-3-4,.slot-3-4-5,.slot-4-5,.slot-6,.slot-7,.slot-8,.slot-9,.slot-6-7,.slot-6-7-8,.slot-6-7-8-9,.slot-7-8,.slot-7-8-9,.slot-8-9{ display:inline; float:left; margin-left:30px; }
12
+
13
+ /* 6-Col Grid Sizes */
14
+ .slot-0,.slot-1,.slot-2,.slot-3,.slot-4,.slot-5{ width:136px; } /* Sixths */
15
+ .slot-0-1,.slot-1-2,.slot-2-3,.slot-3-4,.slot-4-5{ width:302px; } /* Thirds */
16
+ .slot-0-1-2-3,.slot-1-2-3-4,.slot-2-3-4-5{ width:634px; } /* Two-Thirds */
17
+ .slot-0-1-2-3-4,.slot-1-2-3-4-5{ width:800px; } /* Five-Sixths */
18
+
19
+ /* 4-Col Grid Sizes */
20
+ .slot-6,.slot-7,.slot-8,.slot-9{ width:219px; } /* Quarters */
21
+ .slot-6-7-8,.slot-7-8-9{ width:717px; } /* Three-Quarters */
22
+
23
+ /* 6-Col/4-Col Shared Grid Sizes */
24
+ .slot-0-1-2,.slot-1-2-3,.slot-2-3-4,.slot-3-4-5, .slot-6-7,.slot-7-8,.slot-8-9{ width:468px; } /* Halves */
@@ -0,0 +1,134 @@
1
+ /* colors from pallett at http://www.colourlovers.com/palette/137881/Tabby_Cat */
2
+
3
+ .blackish {
4
+ color: #180F01;
5
+ }
6
+
7
+ .brown_black {
8
+ color: #2A2111;
9
+ }
10
+
11
+ .caramel {
12
+ color: #956C1F;
13
+ }
14
+
15
+ .white {
16
+ color: #FFFBF5;
17
+ }
18
+
19
+ .faded {
20
+ color: #A3906D;
21
+ }
22
+
23
+ html {
24
+ font-family: Menlo, 'Panic Sans', monospace;
25
+ }
26
+
27
+ body {
28
+ background-color: #FFFBF5;
29
+ color: #2A2111;
30
+ margin-top: 0px;
31
+ }
32
+
33
+ a.kr:link { text-decoration:none; color: #A3906D; }
34
+ a.kr:visited { text-decoration:none; color: #A3906D; }
35
+ a.kr:hover { text-decoration:none; color: #956C1F; }
36
+ a.kr:active { text-decoration:none; color: #A3906D; }
37
+
38
+ .kr th {
39
+ padding: 0.2em 1em 0.2em 1em;
40
+ color: #2A2111;
41
+ text-align: left;
42
+ }
43
+
44
+ .grid_top {
45
+ margin-top: 0px;
46
+ border-top: 6px #956C1F solid;
47
+ }
48
+
49
+ .kr--nav {
50
+ font-size: 1.2em;
51
+ text-align: center;
52
+ }
53
+
54
+ .kr--ul {
55
+ list-style-type: none;
56
+ padding:0;
57
+ margin:0;
58
+ }
59
+
60
+
61
+ .kr--dom_review_table td {
62
+ padding: 1em;
63
+ border: 0px solid;
64
+ background-color: transparent;
65
+ vertical-align: top;
66
+ min-width: 250px;
67
+ }
68
+
69
+ .kr--dom_review_table th {
70
+ color: #2A2111;
71
+ font-size: 1.3em;
72
+ }
73
+
74
+ .kr--dom {
75
+ background-color: #ffffff;
76
+ font-size: 0.8em;
77
+ color: #2A2111;
78
+ border-collapse: collapse;
79
+ }
80
+
81
+ .kr--dom_review_table p{
82
+ color: #2A2111;
83
+ }
84
+
85
+ .kr--dom th {
86
+ color: #FFFBF5;
87
+ background-color: #A3906D;
88
+ text-align: center;
89
+ border-bottom: 2px;
90
+ border-top: 1px;
91
+ border-left: 1px;
92
+ border-right: 1px;
93
+ border-color: #956C1F;
94
+ border-style: solid;
95
+ }
96
+
97
+ .kr--dom td {
98
+ background-color: transparent;
99
+ border: 1px;
100
+ border-color: #956C1F;
101
+ border-style: solid;
102
+ width: auto;
103
+ min-width: 0;
104
+ padding: 4px 4px 4px 4px;
105
+
106
+ }
107
+
108
+ .kr-dom_row_odd {
109
+ background-color: #A3906D;
110
+ }
111
+
112
+ .kr-dom_row_even {
113
+ background-color: transparent;
114
+ }
115
+
116
+ .kr--svg_rect_highlight {
117
+ border: 5px solid #ff9933;
118
+ }
119
+
120
+ .kr--about {
121
+ margin-top: 30px;
122
+ padding: 35px;
123
+ color: #2A2111;
124
+ background-color: #fff;
125
+ border: 1px solid #A3906D;
126
+ -moz-border-radius: 20px;
127
+ -webkit-border-radius: 20px;
128
+ border-radius: 10px; /* future proofing */
129
+ }
130
+
131
+ .kr--artifacts td {
132
+ padding-left: 7px;
133
+ padding-right: 7px;
134
+ }