role-haml 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -0
- data/.gitmodules +3 -0
- data/Gemfile +6 -0
- data/README.md +140 -0
- data/Rakefile +34 -0
- data/lib/role-haml.rb +2 -0
- data/lib/role-haml/engine.rb +85 -0
- data/lib/role-haml/version.rb +3 -0
- data/role-haml.gemspec +36 -0
- data/test/dummy/README.rdoc +261 -0
- data/test/dummy/Rakefile +7 -0
- data/test/dummy/app/assets/javascripts/application.js +13 -0
- data/test/dummy/app/assets/javascripts/control.jst.skim +5 -0
- data/test/dummy/app/assets/stylesheets/application.css +13 -0
- data/test/dummy/app/controllers/application_controller.rb +9 -0
- data/test/dummy/app/helpers/application_helper.rb +2 -0
- data/test/dummy/app/mailers/.gitkeep +0 -0
- data/test/dummy/app/models/.gitkeep +0 -0
- data/test/dummy/app/views/application/index.html.slim +8 -0
- data/test/dummy/app/views/application/index_h.html.haml +8 -0
- data/test/dummy/app/views/layouts/application.html.erb +14 -0
- data/test/dummy/config.ru +4 -0
- data/test/dummy/config/application.rb +55 -0
- data/test/dummy/config/boot.rb +10 -0
- data/test/dummy/config/database.yml +3 -0
- data/test/dummy/config/environment.rb +5 -0
- data/test/dummy/config/environments/development.rb +37 -0
- data/test/dummy/config/environments/production.rb +67 -0
- data/test/dummy/config/environments/test.rb +37 -0
- data/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/test/dummy/config/initializers/inflections.rb +15 -0
- data/test/dummy/config/initializers/mime_types.rb +5 -0
- data/test/dummy/config/initializers/secret_token.rb +7 -0
- data/test/dummy/config/initializers/session_store.rb +8 -0
- data/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/test/dummy/config/locales/en.yml +5 -0
- data/test/dummy/config/routes.rb +4 -0
- data/test/dummy/lib/assets/.gitkeep +0 -0
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/public/404.html +26 -0
- data/test/dummy/public/422.html +26 -0
- data/test/dummy/public/500.html +25 -0
- data/test/dummy/public/favicon.ico +0 -0
- data/test/dummy/script/rails +6 -0
- data/test/helper.rb +20 -0
- data/test/integration/haml_engines_test.rb +15 -0
- data/vendor/assets/javascripts/jquery.role.js +19 -0
- data/vendor/assets/javascripts/jquery.role.min.js +1 -0
- data/vendor/assets/javascripts/role.js +18 -0
- data/vendor/assets/javascripts/role.min.js +1 -0
- metadata +214 -0
@@ -0,0 +1,25 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>We're sorry, but something went wrong (500)</title>
|
5
|
+
<style type="text/css">
|
6
|
+
body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
|
7
|
+
div.dialog {
|
8
|
+
width: 25em;
|
9
|
+
padding: 0 4em;
|
10
|
+
margin: 4em auto 0 auto;
|
11
|
+
border: 1px solid #ccc;
|
12
|
+
border-right-color: #999;
|
13
|
+
border-bottom-color: #999;
|
14
|
+
}
|
15
|
+
h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
|
16
|
+
</style>
|
17
|
+
</head>
|
18
|
+
|
19
|
+
<body>
|
20
|
+
<!-- This file lives in public/500.html -->
|
21
|
+
<div class="dialog">
|
22
|
+
<h1>We're sorry, but something went wrong.</h1>
|
23
|
+
</div>
|
24
|
+
</body>
|
25
|
+
</html>
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
data/test/helper.rb
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
|
4
|
+
ENV['RAILS_ENV'] = 'test'
|
5
|
+
require "dummy/config/environment"
|
6
|
+
require "rails/test_help"
|
7
|
+
|
8
|
+
begin
|
9
|
+
Bundler.setup(:default, :development)
|
10
|
+
rescue Bundler::BundlerError => e
|
11
|
+
$stderr.puts e.message
|
12
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
13
|
+
exit e.status_code
|
14
|
+
end
|
15
|
+
require 'test/unit'
|
16
|
+
require 'shoulda'
|
17
|
+
|
18
|
+
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
19
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
20
|
+
require 'role-haml'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'helper'
|
2
|
+
|
3
|
+
class HamlEnginesTest < ActionDispatch::IntegrationTest
|
4
|
+
|
5
|
+
context 'haml engine' do
|
6
|
+
should 'setup role attribute' do
|
7
|
+
get "/h"
|
8
|
+
|
9
|
+
assert_tag :tag => 'div', :attributes => { :role => 'implicitly_defined' }
|
10
|
+
assert_tag :tag => 'div', :attributes => { :role => 'explicitly_defined' }
|
11
|
+
assert_tag :tag => 'div', :attributes => { :role => 'foo bar' }
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
!function($){
|
2
|
+
function rewriteSelector(context, name, argPos){
|
3
|
+
var original = context[name];
|
4
|
+
|
5
|
+
if (!original) return;
|
6
|
+
|
7
|
+
context[name] = function(){
|
8
|
+
arguments[argPos] = arguments[argPos].replace(/@([\w\u00c0-\uFFFF\-]+)/g, '[role~="$1"]')
|
9
|
+
return original.apply(context, arguments);
|
10
|
+
};
|
11
|
+
|
12
|
+
$.extend(context[name], original);
|
13
|
+
}
|
14
|
+
|
15
|
+
rewriteSelector($, 'find', 0);
|
16
|
+
rewriteSelector($, 'multiFilter', 0);
|
17
|
+
rewriteSelector($.find, 'matchesSelector', 1);
|
18
|
+
rewriteSelector($.find, 'matches', 0);
|
19
|
+
}(jQuery)
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(a){function b(b,c,d){var e=b[c];if(!e)return;b[c]=function(){return arguments[d]=arguments[d].replace(/@([\w\u00c0-\uFFFF\-]+)/g,'[role~="$1"]'),e.apply(b,arguments)},a.extend(b[c],e)}b(a,"find",0),b(a,"multiFilter",0),b(a.find,"matchesSelector",1),b(a.find,"matches",0)}(jQuery);
|
@@ -0,0 +1,18 @@
|
|
1
|
+
!function(window, methods){
|
2
|
+
function overrideMethod(klass, methodName){
|
3
|
+
var original;
|
4
|
+
if (klass && (original = klass.prototype[methodName])) {
|
5
|
+
klass.prototype[methodName] = function(){
|
6
|
+
arguments[0] = arguments[0].replace(/@([\w\u00c0-\uFFFF\-]+)/g, '[role~="$1"]');
|
7
|
+
return original.apply(this, arguments);
|
8
|
+
};
|
9
|
+
}
|
10
|
+
}
|
11
|
+
|
12
|
+
function overridePrototype(klass){
|
13
|
+
for(var i=0; i<methods.length; i++)
|
14
|
+
overrideMethod(klass, methods[i]);
|
15
|
+
}
|
16
|
+
|
17
|
+
overridePrototype(window.Element); overridePrototype(window.Document);
|
18
|
+
}(this, ['querySelector', 'querySelectorAll']);
|
@@ -0,0 +1 @@
|
|
1
|
+
!function(a,b){function c(a,b){var c;a&&(c=a.prototype[b])&&(a.prototype[b]=function(){return arguments[0]=arguments[0].replace(/@([\w\u00c0-\uFFFF\-]+)/g,'[role~="$1"]'),c.apply(this,arguments)})}function d(a){for(var d=0;d<b.length;d++)c(a,b[d])}d(a.Element),d(a.Document)}(this,["querySelector","querySelectorAll"]);
|
metadata
ADDED
@@ -0,0 +1,214 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: role-haml
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.2.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- kossnocorp, gazay
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-03-23 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.1.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.1.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: haml
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 3.0.0
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 3.0.0
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: sqlite3
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: shoulda
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: bundler
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: 1.0.0
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: 1.0.0
|
94
|
+
description: Gem for jQuery plugin to provide easy way to handle DOM elements by role
|
95
|
+
attribute
|
96
|
+
email: koss@nocorp.me
|
97
|
+
executables: []
|
98
|
+
extensions: []
|
99
|
+
extra_rdoc_files: []
|
100
|
+
files:
|
101
|
+
- .gitignore
|
102
|
+
- .gitmodules
|
103
|
+
- Gemfile
|
104
|
+
- README.md
|
105
|
+
- Rakefile
|
106
|
+
- lib/role-haml.rb
|
107
|
+
- lib/role-haml/engine.rb
|
108
|
+
- lib/role-haml/version.rb
|
109
|
+
- role-haml.gemspec
|
110
|
+
- test/dummy/README.rdoc
|
111
|
+
- test/dummy/Rakefile
|
112
|
+
- test/dummy/app/assets/javascripts/application.js
|
113
|
+
- test/dummy/app/assets/javascripts/control.jst.skim
|
114
|
+
- test/dummy/app/assets/stylesheets/application.css
|
115
|
+
- test/dummy/app/controllers/application_controller.rb
|
116
|
+
- test/dummy/app/helpers/application_helper.rb
|
117
|
+
- test/dummy/app/mailers/.gitkeep
|
118
|
+
- test/dummy/app/models/.gitkeep
|
119
|
+
- test/dummy/app/views/application/index.html.slim
|
120
|
+
- test/dummy/app/views/application/index_h.html.haml
|
121
|
+
- test/dummy/app/views/layouts/application.html.erb
|
122
|
+
- test/dummy/config.ru
|
123
|
+
- test/dummy/config/application.rb
|
124
|
+
- test/dummy/config/boot.rb
|
125
|
+
- test/dummy/config/database.yml
|
126
|
+
- test/dummy/config/environment.rb
|
127
|
+
- test/dummy/config/environments/development.rb
|
128
|
+
- test/dummy/config/environments/production.rb
|
129
|
+
- test/dummy/config/environments/test.rb
|
130
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
131
|
+
- test/dummy/config/initializers/inflections.rb
|
132
|
+
- test/dummy/config/initializers/mime_types.rb
|
133
|
+
- test/dummy/config/initializers/secret_token.rb
|
134
|
+
- test/dummy/config/initializers/session_store.rb
|
135
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
136
|
+
- test/dummy/config/locales/en.yml
|
137
|
+
- test/dummy/config/routes.rb
|
138
|
+
- test/dummy/lib/assets/.gitkeep
|
139
|
+
- test/dummy/log/.gitkeep
|
140
|
+
- test/dummy/public/404.html
|
141
|
+
- test/dummy/public/422.html
|
142
|
+
- test/dummy/public/500.html
|
143
|
+
- test/dummy/public/favicon.ico
|
144
|
+
- test/dummy/script/rails
|
145
|
+
- test/helper.rb
|
146
|
+
- test/integration/haml_engines_test.rb
|
147
|
+
- vendor/assets/javascripts/jquery.role.js
|
148
|
+
- vendor/assets/javascripts/jquery.role.min.js
|
149
|
+
- vendor/assets/javascripts/role.js
|
150
|
+
- vendor/assets/javascripts/role.min.js
|
151
|
+
homepage: https://github.com/gazay/role-haml
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
post_install_message:
|
155
|
+
rdoc_options: []
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
none: false
|
160
|
+
requirements:
|
161
|
+
- - ! '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
none: false
|
166
|
+
requirements:
|
167
|
+
- - ! '>='
|
168
|
+
- !ruby/object:Gem::Version
|
169
|
+
version: '0'
|
170
|
+
requirements: []
|
171
|
+
rubyforge_project: role-haml
|
172
|
+
rubygems_version: 1.8.24
|
173
|
+
signing_key:
|
174
|
+
specification_version: 3
|
175
|
+
summary: Gem for jQuery plugin to provide easy way to handle DOM elements by role
|
176
|
+
attribute
|
177
|
+
test_files:
|
178
|
+
- test/dummy/README.rdoc
|
179
|
+
- test/dummy/Rakefile
|
180
|
+
- test/dummy/app/assets/javascripts/application.js
|
181
|
+
- test/dummy/app/assets/javascripts/control.jst.skim
|
182
|
+
- test/dummy/app/assets/stylesheets/application.css
|
183
|
+
- test/dummy/app/controllers/application_controller.rb
|
184
|
+
- test/dummy/app/helpers/application_helper.rb
|
185
|
+
- test/dummy/app/mailers/.gitkeep
|
186
|
+
- test/dummy/app/models/.gitkeep
|
187
|
+
- test/dummy/app/views/application/index.html.slim
|
188
|
+
- test/dummy/app/views/application/index_h.html.haml
|
189
|
+
- test/dummy/app/views/layouts/application.html.erb
|
190
|
+
- test/dummy/config.ru
|
191
|
+
- test/dummy/config/application.rb
|
192
|
+
- test/dummy/config/boot.rb
|
193
|
+
- test/dummy/config/database.yml
|
194
|
+
- test/dummy/config/environment.rb
|
195
|
+
- test/dummy/config/environments/development.rb
|
196
|
+
- test/dummy/config/environments/production.rb
|
197
|
+
- test/dummy/config/environments/test.rb
|
198
|
+
- test/dummy/config/initializers/backtrace_silencers.rb
|
199
|
+
- test/dummy/config/initializers/inflections.rb
|
200
|
+
- test/dummy/config/initializers/mime_types.rb
|
201
|
+
- test/dummy/config/initializers/secret_token.rb
|
202
|
+
- test/dummy/config/initializers/session_store.rb
|
203
|
+
- test/dummy/config/initializers/wrap_parameters.rb
|
204
|
+
- test/dummy/config/locales/en.yml
|
205
|
+
- test/dummy/config/routes.rb
|
206
|
+
- test/dummy/lib/assets/.gitkeep
|
207
|
+
- test/dummy/log/.gitkeep
|
208
|
+
- test/dummy/public/404.html
|
209
|
+
- test/dummy/public/422.html
|
210
|
+
- test/dummy/public/500.html
|
211
|
+
- test/dummy/public/favicon.ico
|
212
|
+
- test/dummy/script/rails
|
213
|
+
- test/helper.rb
|
214
|
+
- test/integration/haml_engines_test.rb
|