dom_glancy 0.1.0

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 (69) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +21 -0
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +15 -0
  5. data/Gemfile +16 -0
  6. data/LICENSE.txt +22 -0
  7. data/README.md +35 -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/dom_glancy.css +134 -0
  14. data/app/assets/stylesheets/normalize.css +425 -0
  15. data/app/controllers/dom_glancy_application_controller.rb +8 -0
  16. data/app/controllers/dom_glancy_controller.rb +114 -0
  17. data/app/views/dom_glancy/about.html.erb +3 -0
  18. data/app/views/dom_glancy/artifacts.html.erb +16 -0
  19. data/app/views/dom_glancy/index.html.erb +12 -0
  20. data/app/views/dom_glancy/new.html.erb +15 -0
  21. data/app/views/dom_glancy/path_config.html.erb +8 -0
  22. data/app/views/dom_glancy/show.html.erb +42 -0
  23. data/app/views/layouts/dom_glancy.html.erb +32 -0
  24. data/app/views/shared/_dom_glancy_nav.html.erb +8 -0
  25. data/app/views/shared/_dom_set.html.erb +35 -0
  26. data/config/routes.rb +17 -0
  27. data/dom_glancy.gemspec +26 -0
  28. data/lib/dom_glancy/analysis.rb +141 -0
  29. data/lib/dom_glancy/dom_glancy.rb +121 -0
  30. data/lib/dom_glancy/element.rb +92 -0
  31. data/lib/dom_glancy/locations.rb +49 -0
  32. data/lib/dom_glancy/rails/engine.rb +7 -0
  33. data/lib/dom_glancy/svg.rb +71 -0
  34. data/lib/dom_glancy/version.rb +3 -0
  35. data/lib/dom_glancy.rb +7 -0
  36. data/test/page_objects/dom_glancy/about_page.rb +7 -0
  37. data/test/page_objects/dom_glancy/artifacts_page.rb +7 -0
  38. data/test/page_objects/dom_glancy/config_page.rb +19 -0
  39. data/test/page_objects/dom_glancy/index_page.rb +9 -0
  40. data/test/page_objects/dom_glancy/local_index_page.rb +7 -0
  41. data/test/page_objects/dom_glancy/new_page.rb +7 -0
  42. data/test/page_objects/dom_glancy/show_page.rb +15 -0
  43. data/test/page_objects/dom_glancy/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 +118 -0
  47. data/test/selenium/viewer_test.rb +26 -0
  48. data/test/selenium_test_helper.rb +147 -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/dom_glancy_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 +43 -0
  61. data/test/test_helpers/kracker_class_for_stubbing.rb +3 -0
  62. data/test/test_helpers/location_helpers.rb +28 -0
  63. data/test/test_objects/test_objects.rb +2031 -0
  64. data/test/unit/analysis_test.rb +111 -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: 2c84851470a93ba9650102b600020afe44d0e015
4
+ data.tar.gz: c76baf99580a6abd4080152d24748419bb584dbc
5
+ SHA512:
6
+ metadata.gz: e2734c33ad4d12c6a97c94b7c683e7e243406c20f7c4e0c14d5da809ee501635f295158c3529d2d3ea76939c78799dfe57ec83a7de161d931a08cf62a2fa78c8
7
+ data.tar.gz: ac4244455dc406913eb676a4e9f2c32f9868d1d3175bdf82b602aa0ffe7d78c0f876a76f5cb9f8db5872a7304e6e621d32000f791f1b6996669be636095067ea
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
+ ruby-2.1.2
data/.travis.yml ADDED
@@ -0,0 +1,15 @@
1
+ language: ruby
2
+ rvm:
3
+ - "1.9.3"
4
+ - "2.0.0"
5
+ - "2.1.0"
6
+ - "2.1.2"
7
+ env:
8
+ - DB=sqlite
9
+ before_script:
10
+ - export DISPLAY=:99.0
11
+ - sh -e /etc/init.d/xvfb start
12
+ script:
13
+ - bundle exec rake
14
+ addons:
15
+ firefox: "19.0.1"
data/Gemfile ADDED
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dom_glancy.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.42.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,35 @@
1
+ # DOM Glancy
2
+
3
+ DOM element comparison
4
+
5
+ _you know. like taking a quick glance at the DOM, but make it sound kinda like Tom Clancy instead._
6
+
7
+ ## Travis-ci.org
8
+
9
+ [![Build Status](https://travis-ci.org/QuantumGeordie/dom_glancy.svg?branch=master)](https://travis-ci.org/QuantumGeordie/dom_glancy)
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ gem 'dom_glancy'
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install dom_glancy
24
+
25
+ ## Usage
26
+
27
+ Don't know yet. I'll let you know when i figure something out.
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it
32
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
33
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
34
+ 4. Push to the branch (`git push origin my-new-feature`)
35
+ 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
+ }