role-rails 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,13 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gemspec
3
+ gem 'rails', '>=3.1.0'
4
+
5
+ group :development, :test do
6
+ # Require Slim engine with support of configurable attribute shortcuts. Replace this with version when possible.
7
+ gem 'slim', :git => 'git://github.com/stonean/slim.git', :ref => "40cda599e54dbdb282405c855a817435ec7e5afe"
8
+
9
+ gem 'sqlite3'
10
+ gem "shoulda", ">= 0"
11
+ gem "bundler", "~> 1.0.0"
12
+ gem "jeweler", "~> 1.6.4"
13
+ end
data/Rakefile CHANGED
@@ -1 +1,51 @@
1
- require 'bundler/gem_tasks'
1
+ # encoding: utf-8
2
+
3
+ require 'rubygems'
4
+ require 'bundler'
5
+
6
+ $:.push File.expand_path('../lib', __FILE__)
7
+ require 'role-rails/version'
8
+
9
+
10
+ begin
11
+ Bundler.setup(:default, :development)
12
+ rescue Bundler::BundlerError => e
13
+ $stderr.puts e.message
14
+ $stderr.puts "Run `bundle install` to install missing gems"
15
+ exit e.status_code
16
+ end
17
+ require 'rake'
18
+
19
+ require 'jeweler'
20
+ Jeweler::Tasks.new do |gem|
21
+ # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
22
+ gem.name = 'role-rails'
23
+ gem.homepage = "https://github.com/kossnocorp/role-rails"
24
+ gem.license = "MIT"
25
+ gem.summary = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
26
+ gem.description = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
27
+ gem.email = 'koss@nocorp.me'
28
+ gem.authors = ['Sasha Koss']
29
+ gem.rubyforge_project = 'role-rails'
30
+ gem.version = RoleRails::VERSION
31
+ end
32
+ Jeweler::RubygemsDotOrgTasks.new
33
+
34
+ require 'rake/testtask'
35
+ Rake::TestTask.new(:test) do |test|
36
+ test.libs << 'lib' << 'test'
37
+ test.pattern = 'test/**/*_test.rb'
38
+ test.verbose = true
39
+ end
40
+
41
+ task :default => :test
42
+
43
+ require 'rdoc/task'
44
+ Rake::RDocTask.new do |rdoc|
45
+ version = RoleRails::VERSION
46
+
47
+ rdoc.rdoc_dir = 'rdoc'
48
+ rdoc.title = "role-rails #{version}"
49
+ rdoc.rdoc_files.include('README*')
50
+ rdoc.rdoc_files.include('lib/**/*.rb')
51
+ end
@@ -1,8 +1,12 @@
1
1
  require 'rails'
2
2
 
3
- module Role
4
- module Rails
5
- class Engine < ::Rails::Engine
3
+ module RoleRails
4
+ class Engine < ::Rails::Engine
5
+ initializer "role-rails.register" do |app|
6
+ if defined?(Slim::Engine)
7
+ Slim::Engine.default_options[:shortcut] ||= {}
8
+ Slim::Engine.default_options[:shortcut].merge!('@' => 'div role')
9
+ end
6
10
  end
7
11
  end
8
12
  end
@@ -1,5 +1,3 @@
1
- module Role
2
- module Rails
3
- VERSION = '1.0.1'
4
- end
1
+ module RoleRails
2
+ VERSION = '1.1.0'
5
3
  end
data/lib/role-rails.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require 'rails'
2
2
  require 'role-rails/version'
3
3
 
4
- module Role
5
- module Rails
6
- require 'role-rails/engine'
7
- end
4
+ module RoleRails
5
+ require 'role-rails/engine'
8
6
  end
data/role-rails.gemspec CHANGED
@@ -1,22 +1,59 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
1
4
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
3
- require 'role-rails/version'
4
5
 
5
6
  Gem::Specification.new do |s|
6
- s.name = 'role-rails'
7
- s.version = Role::Rails::VERSION
8
- s.authors = ['Sasha Koss']
9
- s.email = ['koss@nocorp.me']
10
- s.homepage = ''
11
- s.summary = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
12
- s.description = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
7
+ s.name = "role-rails"
8
+ s.version = "1.1.0"
13
9
 
14
- s.rubyforge_project = 'role-rails'
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Sasha Koss"]
12
+ s.date = "2012-03-23"
13
+ s.description = "jQuery plugin to provide easy way to handle DOM elements by role attribute"
14
+ s.email = "koss@nocorp.me"
15
+ s.files = [
16
+ "Gemfile",
17
+ "Rakefile",
18
+ "lib/role-rails.rb",
19
+ "lib/role-rails/engine.rb",
20
+ "lib/role-rails/version.rb",
21
+ "role-rails.gemspec",
22
+ "vendor/assets/javascripts/jquery.role.js",
23
+ "vendor/assets/javascripts/role.js"
24
+ ]
25
+ s.homepage = "https://github.com/kossnocorp/role-rails"
26
+ s.licenses = ["MIT"]
27
+ s.require_paths = ["lib"]
28
+ s.rubyforge_project = "role-rails"
29
+ s.rubygems_version = "1.8.15"
30
+ s.summary = "jQuery plugin to provide easy way to handle DOM elements by role attribute"
15
31
 
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ['lib']
32
+ if s.respond_to? :specification_version then
33
+ s.specification_version = 3
20
34
 
21
- s.add_dependency 'rails', '>= 3.1.0'
35
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
36
+ s.add_runtime_dependency(%q<rails>, [">= 3.1.0"])
37
+ s.add_development_dependency(%q<slim>, [">= 0"])
38
+ s.add_development_dependency(%q<sqlite3>, [">= 0"])
39
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
40
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
41
+ s.add_development_dependency(%q<jeweler>, ["~> 1.6.4"])
42
+ else
43
+ s.add_dependency(%q<rails>, [">= 3.1.0"])
44
+ s.add_dependency(%q<slim>, [">= 0"])
45
+ s.add_dependency(%q<sqlite3>, [">= 0"])
46
+ s.add_dependency(%q<shoulda>, [">= 0"])
47
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
48
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
49
+ end
50
+ else
51
+ s.add_dependency(%q<rails>, [">= 3.1.0"])
52
+ s.add_dependency(%q<slim>, [">= 0"])
53
+ s.add_dependency(%q<sqlite3>, [">= 0"])
54
+ s.add_dependency(%q<shoulda>, [">= 0"])
55
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
56
+ s.add_dependency(%q<jeweler>, ["~> 1.6.4"])
57
+ end
22
58
  end
59
+
@@ -1,4 +1,4 @@
1
- // Role.js, jQuery adapter v1.0.1 ~ https://github.com/kossnocorp/role
1
+ // Role.js, jQuery adapter v1.1.0 ~ https://github.com/kossnocorp/role
2
2
 
3
3
  (function($) {
4
4
  var matchesSelectorOrigin, type;
@@ -8,7 +8,7 @@
8
8
  return ' ' + match[1] + ' ';
9
9
  };
10
10
  $.expr.filter['ROLE'] = function(el, match) {
11
- return (" " + (el.getAttribute('role')) + " ").indexOf(match) !== -1;
11
+ return (el.getAttribute != null) && (" " + (el.getAttribute('role')) + " ").indexOf(match) !== -1;
12
12
  };
13
13
  for (type in $.expr.match) {
14
14
  $.expr.match[type] = new RegExp($.expr.match[type].source + /(?![^\[]*\])(?![^\(]*\))/.source);
@@ -1,9 +1,14 @@
1
- // Role.js, extension for querySelectorAll function v1.0.0 ~ https://github.com/kossnocorp/role
1
+ // Role.js, extension for querySelectorAll function v1.1.0 ~ https://github.com/kossnocorp/role
2
2
 
3
3
  (function() {
4
- var elm, _fn, _i, _len, _ref;
4
+ var elements, elm, _fn, _i, _len;
5
+
6
+ elements = [];
7
+
8
+ if (typeof Document !== "undefined" && Document !== null) elements << Document;
9
+
10
+ if (typeof Element !== "undefined" && Element !== null) elements << Element;
5
11
 
6
- _ref = [Document, Element];
7
12
  _fn = function(elm) {
8
13
  var nativeQuery;
9
14
  nativeQuery = elm.prototype.querySelectorAll;
@@ -11,8 +16,8 @@
11
16
  return nativeQuery.call(this, selector.replace(/@(\w+)/g, "[role~=\"$1\"]"));
12
17
  };
13
18
  };
14
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
15
- elm = _ref[_i];
19
+ for (_i = 0, _len = elements.length; _i < _len; _i++) {
20
+ elm = elements[_i];
16
21
  _fn(elm);
17
22
  }
18
23
 
metadata CHANGED
@@ -1,77 +1,146 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: role-rails
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 1
7
+ - 1
8
+ - 0
9
+ version: 1.1.0
6
10
  platform: ruby
7
- authors:
11
+ authors:
8
12
  - Sasha Koss
9
13
  autorequire:
10
14
  bindir: bin
11
15
  cert_chain: []
12
- date: 2012-01-27 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
16
+
17
+ date: 2012-03-23 00:00:00 +07:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: rails
16
- requirement: &70317158969040 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ! '>='
20
- - !ruby/object:Gem::Version
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 3
29
+ - 1
30
+ - 0
21
31
  version: 3.1.0
22
32
  type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: slim
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 0
43
+ version: "0"
44
+ type: :development
45
+ version_requirements: *id002
46
+ - !ruby/object:Gem::Dependency
47
+ name: sqlite3
48
+ prerelease: false
49
+ requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ segments:
54
+ - 0
55
+ version: "0"
56
+ type: :development
57
+ version_requirements: *id003
58
+ - !ruby/object:Gem::Dependency
59
+ name: shoulda
60
+ prerelease: false
61
+ requirement: &id004 !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ segments:
66
+ - 0
67
+ version: "0"
68
+ type: :development
69
+ version_requirements: *id004
70
+ - !ruby/object:Gem::Dependency
71
+ name: bundler
72
+ prerelease: false
73
+ requirement: &id005 !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ segments:
78
+ - 1
79
+ - 0
80
+ - 0
81
+ version: 1.0.0
82
+ type: :development
83
+ version_requirements: *id005
84
+ - !ruby/object:Gem::Dependency
85
+ name: jeweler
23
86
  prerelease: false
24
- version_requirements: *70317158969040
87
+ requirement: &id006 !ruby/object:Gem::Requirement
88
+ requirements:
89
+ - - ~>
90
+ - !ruby/object:Gem::Version
91
+ segments:
92
+ - 1
93
+ - 6
94
+ - 4
95
+ version: 1.6.4
96
+ type: :development
97
+ version_requirements: *id006
25
98
  description: jQuery plugin to provide easy way to handle DOM elements by role attribute
26
- email:
27
- - koss@nocorp.me
99
+ email: koss@nocorp.me
28
100
  executables: []
101
+
29
102
  extensions: []
103
+
30
104
  extra_rdoc_files: []
31
- files:
32
- - .gitignore
105
+
106
+ files:
33
107
  - Gemfile
34
108
  - Rakefile
35
109
  - lib/role-rails.rb
36
110
  - lib/role-rails/engine.rb
37
111
  - lib/role-rails/version.rb
38
- - role-rails-0.3.2.zip
39
- - role-rails-0.3.2/data.tar.gz
40
- - role-rails-0.3.2/data/.gitignore
41
- - role-rails-0.3.2/data/Gemfile
42
- - role-rails-0.3.2/data/Rakefile
43
- - role-rails-0.3.2/data/lib/role-rails.rb
44
- - role-rails-0.3.2/data/lib/role-rails/engine.rb
45
- - role-rails-0.3.2/data/lib/role-rails/version.rb
46
- - role-rails-0.3.2/data/role-rails.gemspec
47
- - role-rails-0.3.2/data/vendor/assets/javascripts/jquery.role.js
48
- - role-rails-0.3.2/metadata
49
- - role-rails-0.3.2/metadata.gz
50
112
  - role-rails.gemspec
51
113
  - vendor/assets/javascripts/jquery.role.js
52
114
  - vendor/assets/javascripts/role.js
53
- homepage: ''
54
- licenses: []
115
+ has_rdoc: true
116
+ homepage: https://github.com/kossnocorp/role-rails
117
+ licenses:
118
+ - MIT
55
119
  post_install_message:
56
120
  rdoc_options: []
57
- require_paths:
121
+
122
+ require_paths:
58
123
  - lib
59
- required_ruby_version: !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
62
- - - ! '>='
63
- - !ruby/object:Gem::Version
64
- version: '0'
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
- none: false
67
- requirements:
68
- - - ! '>='
69
- - !ruby/object:Gem::Version
70
- version: '0'
124
+ required_ruby_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ segments:
129
+ - 0
130
+ version: "0"
131
+ required_rubygems_version: !ruby/object:Gem::Requirement
132
+ requirements:
133
+ - - ">="
134
+ - !ruby/object:Gem::Version
135
+ segments:
136
+ - 0
137
+ version: "0"
71
138
  requirements: []
139
+
72
140
  rubyforge_project: role-rails
73
- rubygems_version: 1.8.10
141
+ rubygems_version: 1.3.6
74
142
  signing_key:
75
143
  specification_version: 3
76
144
  summary: jQuery plugin to provide easy way to handle DOM elements by role attribute
77
145
  test_files: []
146
+
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
@@ -1,3 +0,0 @@
1
- source 'http://rubygems.org'
2
-
3
- gemspec
@@ -1 +0,0 @@
1
- require 'bundler/gem_tasks'
@@ -1,8 +0,0 @@
1
- require 'rails'
2
-
3
- module Role
4
- module Rails
5
- class Engine < ::Rails::Engine
6
- end
7
- end
8
- end
@@ -1,5 +0,0 @@
1
- module Role
2
- module Rails
3
- VERSION = '0.3.2'
4
- end
5
- end
@@ -1,8 +0,0 @@
1
- require 'rails'
2
- require 'role-rails/version'
3
-
4
- module Role
5
- module Rails
6
- require 'role-rails/engine'
7
- end
8
- end
@@ -1,22 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path('../lib', __FILE__)
3
- require 'role-rails/version'
4
-
5
- Gem::Specification.new do |s|
6
- s.name = 'role-rails'
7
- s.version = Role::Rails::VERSION
8
- s.authors = ['Sasha Koss']
9
- s.email = ['koss@nocorp.me']
10
- s.homepage = ''
11
- s.summary = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
12
- s.description = 'jQuery plugin to provide easy way to handle DOM elements by role attribute'
13
-
14
- s.rubyforge_project = 'role-rails'
15
-
16
- s.files = `git ls-files`.split("\n")
17
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ['lib']
20
-
21
- s.add_dependency 'rails', '>= 3.1.0'
22
- end
@@ -1,45 +0,0 @@
1
- /*
2
- jquery.role.js
3
-
4
- Version: 0.3.2
5
-
6
- Copyright (c) 2011 Sasha Koss
7
- */
8
-
9
- (function ($) {
10
- $.expr.match['ROLE'] = /@((?:[\w\u00c0-\uFFFF\-]|\\.)+)/;
11
-
12
- $.expr.preFilter['ROLE'] = function( match, curLoop, inplace, result, not, isXML ) {
13
- match = " " + match[1] + " ";
14
-
15
- return match;
16
- }
17
-
18
- $.expr.filter['ROLE'] = function( elem, match ) {
19
- return (" " + elem.getAttribute('role') + " ").indexOf( match ) > -1;
20
- }
21
-
22
- for ( var type in $.expr.match ) {
23
- $.expr.match[ type ] = new RegExp( $.expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
24
- $.expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + $.expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num) {
25
- return "\\" + (num - 0 + 1);
26
- }));
27
- }
28
-
29
- $.role = function (roleName, context) {
30
-
31
- var selector;
32
-
33
- if ( roleName.charAt(0) === '#' ) {
34
- selector = '#role-' + roleName.substring(1);
35
- } else {
36
- selector = '[role="' + roleName + '"]';
37
- }
38
-
39
- return $(selector, context);
40
- };
41
-
42
- if (typeof $.r === 'undefined') {
43
- $.r = $.role;
44
- }
45
- })(jQuery);
Binary file
@@ -1,88 +0,0 @@
1
- --- !ruby/object:Gem::Specification
2
- name: role-rails
3
- version: !ruby/object:Gem::Version
4
- hash: 23
5
- prerelease:
6
- segments:
7
- - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
11
- platform: ruby
12
- authors:
13
- - Sasha Koss
14
- autorequire:
15
- bindir: bin
16
- cert_chain: []
17
-
18
- date: 2011-09-06 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- name: rails
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- hash: 3
29
- segments:
30
- - 3
31
- - 1
32
- - 0
33
- version: 3.1.0
34
- type: :runtime
35
- version_requirements: *id001
36
- description: jQuery plugin to provide easy way to handle DOM elements by role attribute
37
- email:
38
- - koss@nocorp.me
39
- executables: []
40
-
41
- extensions: []
42
-
43
- extra_rdoc_files: []
44
-
45
- files:
46
- - .gitignore
47
- - Gemfile
48
- - Rakefile
49
- - lib/role-rails.rb
50
- - lib/role-rails/engine.rb
51
- - lib/role-rails/version.rb
52
- - role-rails.gemspec
53
- - vendor/assets/javascripts/jquery.role.js
54
- homepage: ""
55
- licenses: []
56
-
57
- post_install_message:
58
- rdoc_options: []
59
-
60
- require_paths:
61
- - lib
62
- required_ruby_version: !ruby/object:Gem::Requirement
63
- none: false
64
- requirements:
65
- - - ">="
66
- - !ruby/object:Gem::Version
67
- hash: 3
68
- segments:
69
- - 0
70
- version: "0"
71
- required_rubygems_version: !ruby/object:Gem::Requirement
72
- none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- hash: 3
77
- segments:
78
- - 0
79
- version: "0"
80
- requirements: []
81
-
82
- rubyforge_project: role-rails
83
- rubygems_version: 1.8.6
84
- signing_key:
85
- specification_version: 3
86
- summary: jQuery plugin to provide easy way to handle DOM elements by role attribute
87
- test_files: []
88
-
Binary file
data/role-rails-0.3.2.zip DELETED
Binary file