nimboids-client_side_validations 3.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/client_side_validations.gemspec +45 -0
- data/javascript/rails.validations.js +393 -0
- data/lib/client_side_validations.rb +8 -0
- data/lib/client_side_validations/action_view.rb +13 -0
- data/lib/client_side_validations/action_view/form_builder.rb +64 -0
- data/lib/client_side_validations/action_view/form_helper.rb +69 -0
- data/lib/client_side_validations/action_view/form_tag_helper.rb +12 -0
- data/lib/client_side_validations/active_model.rb +52 -0
- data/lib/client_side_validations/active_model/acceptance.rb +10 -0
- data/lib/client_side_validations/active_model/exclusion.rb +15 -0
- data/lib/client_side_validations/active_model/format.rb +10 -0
- data/lib/client_side_validations/active_model/inclusion.rb +15 -0
- data/lib/client_side_validations/active_model/length.rb +22 -0
- data/lib/client_side_validations/active_model/numericality.rb +26 -0
- data/lib/client_side_validations/active_model/presence.rb +10 -0
- data/lib/client_side_validations/active_record.rb +11 -0
- data/lib/client_side_validations/active_record/middleware.rb +25 -0
- data/lib/client_side_validations/active_record/uniqueness.rb +26 -0
- data/lib/client_side_validations/core_ext.rb +3 -0
- data/lib/client_side_validations/core_ext/range.rb +10 -0
- data/lib/client_side_validations/core_ext/regexp.rb +14 -0
- data/lib/client_side_validations/formtastic.rb +21 -0
- data/lib/client_side_validations/middleware.rb +83 -0
- data/lib/client_side_validations/mongoid.rb +9 -0
- data/lib/client_side_validations/mongoid/middleware.rb +20 -0
- data/lib/client_side_validations/mongoid/uniqueness.rb +26 -0
- data/lib/client_side_validations/simple_form.rb +24 -0
- data/lib/client_side_validations/version.rb +3 -0
- data/lib/generators/client_side_validations/install_generator.rb +22 -0
- data/lib/generators/templates/README +7 -0
- data/lib/generators/templates/client_side_validations.rb +14 -0
- data/test/action_view/cases/helper.rb +152 -0
- data/test/action_view/cases/test_helpers.rb +237 -0
- data/test/action_view/cases/test_legacy_helpers.rb +150 -0
- data/test/action_view/models.rb +3 -0
- data/test/action_view/models/comment.rb +35 -0
- data/test/action_view/models/post.rb +35 -0
- data/test/active_model/cases/helper.rb +4 -0
- data/test/active_model/cases/test_acceptance_validator.rb +16 -0
- data/test/active_model/cases/test_base.rb +11 -0
- data/test/active_model/cases/test_confirmation_validator.rb +16 -0
- data/test/active_model/cases/test_exclusion_validator.rb +20 -0
- data/test/active_model/cases/test_format_validator.rb +21 -0
- data/test/active_model/cases/test_inclusion_validator.rb +21 -0
- data/test/active_model/cases/test_length_validator.rb +61 -0
- data/test/active_model/cases/test_numericality_validator.rb +46 -0
- data/test/active_model/cases/test_presence_validator.rb +16 -0
- data/test/active_model/cases/test_validations.rb +151 -0
- data/test/active_model/models/person.rb +17 -0
- data/test/active_record/cases/helper.rb +12 -0
- data/test/active_record/cases/test_base.rb +11 -0
- data/test/active_record/cases/test_middleware.rb +150 -0
- data/test/active_record/cases/test_uniqueness_validator.rb +45 -0
- data/test/active_record/models/guid.rb +7 -0
- data/test/active_record/models/user.rb +10 -0
- data/test/base_helper.rb +6 -0
- data/test/core_ext/cases/test_core_ext.rb +45 -0
- data/test/formtastic/cases/helper.rb +2 -0
- data/test/formtastic/cases/test_form_builder.rb +11 -0
- data/test/formtastic/cases/test_form_helper.rb +22 -0
- data/test/generators/cases/test_install_generator.rb +15 -0
- data/test/javascript/config.ru +3 -0
- data/test/javascript/public/test/callbacks/elementAfter.js +54 -0
- data/test/javascript/public/test/callbacks/elementBefore.js +54 -0
- data/test/javascript/public/test/callbacks/elementFail.js +70 -0
- data/test/javascript/public/test/callbacks/elementPass.js +70 -0
- data/test/javascript/public/test/callbacks/formAfter.js +45 -0
- data/test/javascript/public/test/callbacks/formBefore.js +45 -0
- data/test/javascript/public/test/callbacks/formFail.js +51 -0
- data/test/javascript/public/test/callbacks/formPass.js +50 -0
- data/test/javascript/public/test/form_builders/validateForm.js +66 -0
- data/test/javascript/public/test/form_builders/validateFormtastic.js +54 -0
- data/test/javascript/public/test/form_builders/validateSimpleForm.js +57 -0
- data/test/javascript/public/test/settings.js +15 -0
- data/test/javascript/public/test/validateElement.js +144 -0
- data/test/javascript/public/test/validators/acceptance.js +42 -0
- data/test/javascript/public/test/validators/confirmation.js +25 -0
- data/test/javascript/public/test/validators/exclusion.js +41 -0
- data/test/javascript/public/test/validators/format.js +27 -0
- data/test/javascript/public/test/validators/inclusion.js +42 -0
- data/test/javascript/public/test/validators/length.js +70 -0
- data/test/javascript/public/test/validators/numericality.js +140 -0
- data/test/javascript/public/test/validators/presence.js +15 -0
- data/test/javascript/public/test/validators/uniqueness.js +89 -0
- data/test/javascript/public/vendor/jquery.metadata.js +122 -0
- data/test/javascript/public/vendor/qunit.css +196 -0
- data/test/javascript/public/vendor/qunit.js +1374 -0
- data/test/javascript/server.rb +78 -0
- data/test/javascript/views/index.erb +20 -0
- data/test/javascript/views/layout.erb +21 -0
- data/test/middleware/cases/helper.rb +15 -0
- data/test/middleware/cases/test_middleware.rb +8 -0
- data/test/mongoid/cases/helper.rb +16 -0
- data/test/mongoid/cases/test_base.rb +15 -0
- data/test/mongoid/cases/test_middleware.rb +68 -0
- data/test/mongoid/cases/test_uniqueness_validator.rb +44 -0
- data/test/mongoid/models/book.rb +8 -0
- data/test/simple_form/cases/helper.rb +2 -0
- data/test/simple_form/cases/test_form_builder.rb +14 -0
- data/test/simple_form/cases/test_form_helper.rb +22 -0
- metadata +435 -0
@@ -0,0 +1,78 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
require 'json'
|
3
|
+
require 'ruby-debug'
|
4
|
+
|
5
|
+
use Rack::Static, :urls => ['/javascript'], :root => File.expand_path('../..', settings.root)
|
6
|
+
|
7
|
+
helpers do
|
8
|
+
def jquery_link version
|
9
|
+
if params[:version] == version
|
10
|
+
"[#{version}]"
|
11
|
+
else
|
12
|
+
"<a href='/?version=#{version}'>#{version}</a>"
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def jquery_src
|
17
|
+
if params[:version] == 'edge' then '/vendor/jquery.js'
|
18
|
+
else "http://code.jquery.com/jquery-#{params[:version]}.js"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_base
|
23
|
+
names = ['/vendor/qunit.js', 'settings']
|
24
|
+
names.map { |name| script_tag name }.join("\n")
|
25
|
+
end
|
26
|
+
|
27
|
+
def test *types
|
28
|
+
types.map do |type|
|
29
|
+
Dir.glob(File.expand_path("public/test/#{type}", settings.root) + '/*.js').map { |file| File.basename(file) }.map do |file|
|
30
|
+
script_tag "/test/#{type}/#{file}"
|
31
|
+
end.join("\n")
|
32
|
+
end.join("\n")
|
33
|
+
end
|
34
|
+
|
35
|
+
def script_tag src
|
36
|
+
src = "/test/#{src}.js" unless src.index('/')
|
37
|
+
%(<script src='#{src}' type='text/javascript'></script>)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
get '/' do
|
42
|
+
params[:version] ||= '1.4.4'
|
43
|
+
erb :index
|
44
|
+
end
|
45
|
+
|
46
|
+
get '/validators/uniqueness.json' do
|
47
|
+
content_type 'application/json'
|
48
|
+
|
49
|
+
if scope = params[:scope]
|
50
|
+
if scope[:name] == 'test name' || scope[:name] == 'taken name'
|
51
|
+
status 200
|
52
|
+
'false'
|
53
|
+
else
|
54
|
+
status 404
|
55
|
+
'true'
|
56
|
+
end
|
57
|
+
elsif params[:case_sensitive] == 'false' && (params[:user][:email] || params[:users][:email]) == 'taken@test.com'
|
58
|
+
status 200
|
59
|
+
'false'
|
60
|
+
else
|
61
|
+
status 404
|
62
|
+
'true'
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
|
67
|
+
post '/users' do
|
68
|
+
data = { :params => params }.update(request.env)
|
69
|
+
payload = data.to_json.gsub('<', '<').gsub('>', '>')
|
70
|
+
<<-HTML
|
71
|
+
<script>
|
72
|
+
if (window.top && window.top !== window)
|
73
|
+
window.top.jQuery.event.trigger('iframe:loaded', #{payload})
|
74
|
+
</script>
|
75
|
+
<p id="response">Form submitted</p>
|
76
|
+
HTML
|
77
|
+
end
|
78
|
+
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<% @title = "client-side-validations test" %>
|
2
|
+
|
3
|
+
<%= test_base %>
|
4
|
+
<%= script_tag 'validateElement' %>
|
5
|
+
<%= test :validators, :form_builders, :callbacks %>
|
6
|
+
|
7
|
+
<h1 id="qunit-header"><%= @title %></h1>
|
8
|
+
<div id="jquery-version">
|
9
|
+
jQuery version:
|
10
|
+
<% %w{1.4.1 1.4.2 1.4.3 1.4.4 1.5 1.5.1}.each do |version| %>
|
11
|
+
<%= jquery_link version %> •
|
12
|
+
<% end %>
|
13
|
+
<%= jquery_link 'edge' if File.exist?(settings.root + '/public/vendor/jquery.js') %>
|
14
|
+
</div>
|
15
|
+
<h2 id="qunit-banner"></h2>
|
16
|
+
<div id="qunit-testrunner-toolbar"></div>
|
17
|
+
<h2 id="qunit-userAgent"></h2>
|
18
|
+
<ol id="qunit-tests"></ol>
|
19
|
+
|
20
|
+
<div id="qunit-fixture"></div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html id="html">
|
3
|
+
<head>
|
4
|
+
<title><%= @title %></title>
|
5
|
+
<link href="/vendor/qunit.css" media="screen" rel="stylesheet" type="text/css" media="screen, projection" />
|
6
|
+
<style>
|
7
|
+
#jquery-version {
|
8
|
+
color: #8699A4; text-align: right; font-family: sans-serif; line-height: 1;
|
9
|
+
margin-top: -1.8em; padding: 0 2em .8em 0;
|
10
|
+
}
|
11
|
+
#jquery-version a { color: white; text-decoration: underline; }
|
12
|
+
</style>
|
13
|
+
|
14
|
+
<%= script_tag jquery_src %>
|
15
|
+
<%= script_tag "/javascript/rails.validations.js" %>
|
16
|
+
</head>
|
17
|
+
|
18
|
+
<body id="body">
|
19
|
+
<%= yield %>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'base_helper'
|
2
|
+
require 'rails'
|
3
|
+
|
4
|
+
# Pulled from railties/test/abstract_unit in Rails 3.1
|
5
|
+
module TestApp
|
6
|
+
class Application < Rails::Application
|
7
|
+
config.root = File.dirname(__FILE__)
|
8
|
+
config.active_support.deprecation = :log
|
9
|
+
config.logger = Logger.new(STDOUT)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'client_side_validations/middleware'
|
14
|
+
|
15
|
+
TestApp::Application.initialize!
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'base_helper'
|
2
|
+
require 'mongoid'
|
3
|
+
require 'client_side_validations/mongoid'
|
4
|
+
|
5
|
+
Mongoid.configure do |config|
|
6
|
+
name = "client_side_validations_development"
|
7
|
+
host = "localhost"
|
8
|
+
config.master = Mongo::Connection.new.db(name)
|
9
|
+
config.slaves = [
|
10
|
+
Mongo::Connection.new(host).db(name)
|
11
|
+
]
|
12
|
+
config.persist_in_safe_mode = false
|
13
|
+
end
|
14
|
+
|
15
|
+
require 'mongoid/models/book'
|
16
|
+
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'mongoid/cases/helper'
|
2
|
+
|
3
|
+
class ClientSideValidations::MongoidTestBase < Test::Unit::TestCase
|
4
|
+
include Mongoid::Validations
|
5
|
+
|
6
|
+
def setup
|
7
|
+
@book = Book.new
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_uniqueness_client_side_hash
|
11
|
+
expected_hash = { :message => "is already taken" }
|
12
|
+
assert_equal expected_hash, UniquenessValidator.new(:attributes => [:name]).client_side_hash(@book, :age)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'middleware/cases/helper'
|
2
|
+
require 'mongoid/cases/helper'
|
3
|
+
|
4
|
+
class ClientSideValidationsMongoidMiddlewareTest < Test::Unit::TestCase
|
5
|
+
include Rack::Test::Methods
|
6
|
+
|
7
|
+
def setup
|
8
|
+
# I've been burned enough times with not having the db clear
|
9
|
+
# I should probably use a db cleaner instead of this
|
10
|
+
Book.delete_all
|
11
|
+
end
|
12
|
+
|
13
|
+
def teardown
|
14
|
+
Book.delete_all
|
15
|
+
end
|
16
|
+
|
17
|
+
def app
|
18
|
+
app = Proc.new { |env| [200, {}, ['success']] }
|
19
|
+
ClientSideValidations::Middleware::Validators.new(app)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_uniqueness_when_resource_exists
|
23
|
+
Book.create(:author_email => 'book@test.com')
|
24
|
+
get '/validators/uniqueness.json', { 'book[author_email]' => 'book@test.com' }
|
25
|
+
|
26
|
+
assert_equal 'false', last_response.body
|
27
|
+
assert last_response.ok?
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_uniqueness_when_resource_does_not_exist
|
31
|
+
get '/validators/uniqueness.json', { 'book[author_email]' => 'book@test.com' }
|
32
|
+
|
33
|
+
assert_equal 'true', last_response.body
|
34
|
+
assert last_response.not_found?
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_uniqueness_when_id_is_given
|
38
|
+
book = Book.create(:author_email => 'book@test.com')
|
39
|
+
get '/validators/uniqueness.json', { 'book[author_email]' => 'book@test.com', 'id' => book.id }
|
40
|
+
|
41
|
+
assert_equal 'true', last_response.body
|
42
|
+
assert last_response.not_found?
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_uniqueness_when_scope_is_given
|
46
|
+
Book.create(:author_email => 'book@test.com', :age => 25)
|
47
|
+
get '/validators/uniqueness.json', { 'book[author_email]' => 'book@test.com', 'scope' => { 'age' => 30 } }
|
48
|
+
|
49
|
+
assert_equal 'true', last_response.body
|
50
|
+
assert last_response.not_found?
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_uniqueness_when_multiple_scopes_are_given
|
54
|
+
Book.create(:author_email => 'book@test.com', :age => 30, :author_name => 'Brian')
|
55
|
+
get '/validators/uniqueness.json', { 'book[author_email]' => 'book@test.com', 'scope' => { 'age' => 30, 'author_name' => 'Robert' } }
|
56
|
+
|
57
|
+
assert_equal 'true', last_response.body
|
58
|
+
assert last_response.not_found?
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_uniqueness_when_case_insensitive
|
62
|
+
Book.create(:author_name => 'Brian')
|
63
|
+
get '/validators/uniqueness.json', { 'book[author_name]' => 'BRIAN', 'case_sensitive' => false }
|
64
|
+
|
65
|
+
assert_equal 'false', last_response.body
|
66
|
+
assert last_response.ok?
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'mongoid/cases/test_base'
|
2
|
+
|
3
|
+
class Mongoid::UniqunessValidatorTest < ClientSideValidations::MongoidTestBase
|
4
|
+
|
5
|
+
def test_uniqueness_client_side_hash
|
6
|
+
expected_hash = { :message => "is already taken" }
|
7
|
+
assert_equal expected_hash, UniquenessValidator.new(:attributes => [:name]).client_side_hash(@book, :age)
|
8
|
+
end
|
9
|
+
|
10
|
+
def test_uniqueness_client_side_hash_with_custom_message
|
11
|
+
expected_hash = { :message => "is not available" }
|
12
|
+
assert_equal expected_hash, UniquenessValidator.new(:attributes => [:name], :message => "is not available").client_side_hash(@book, :age)
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_uniqueness_client_side_hash
|
16
|
+
@book.stubs(:new_record?).returns(false)
|
17
|
+
@book.stubs(:id).returns(1)
|
18
|
+
expected_hash = { :message => "is already taken", :id => 1 }
|
19
|
+
assert_equal expected_hash, UniquenessValidator.new(:attributes => [:name]).client_side_hash(@book, :age)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_uniqueness_client_side_hash_with_single_scope_item
|
23
|
+
@book.stubs(:author_email).returns("test@test.com")
|
24
|
+
expected_hash = { :message => "is already taken", :scope => {:author_email => "test@test.com"} }
|
25
|
+
result_hash = UniquenessValidator.new(:attributes => [:author_name], :scope => :author_email).client_side_hash(@book, :author_name)
|
26
|
+
assert_equal expected_hash, result_hash
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_uniqueness_client_side_hash_with_multiple_scope_items
|
30
|
+
@book.stubs(:age).returns(30)
|
31
|
+
@book.stubs(:author_email).returns("test@test.com")
|
32
|
+
expected_hash = { :message => "is already taken", :scope => {:age => 30, :author_email => "test@test.com"} }
|
33
|
+
result_hash = UniquenessValidator.new(:attributes => [:author_name], :scope => [:age, :author_email]).client_side_hash(@book, :author_name)
|
34
|
+
assert_equal expected_hash, result_hash
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_uniqueness_client_side_hash_with_empty_scope_array
|
38
|
+
expected_hash = { :message => "is already taken" }
|
39
|
+
result_hash = UniquenessValidator.new(:attributes => [:author_name], :scope => []).client_side_hash(@book, :author_name)
|
40
|
+
assert_equal expected_hash, result_hash
|
41
|
+
end
|
42
|
+
|
43
|
+
end
|
44
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'simple_form/cases/helper'
|
2
|
+
|
3
|
+
class ClientSideValidations::SimpleForm::FormBuilderTest < Test::Unit::TestCase
|
4
|
+
def test_client_side_form_js_hash
|
5
|
+
expected = {
|
6
|
+
:type => 'SimpleForm::FormBuilder',
|
7
|
+
:error_class => :error,
|
8
|
+
:error_tag => :span,
|
9
|
+
:wrapper_error_class => :field_with_errors,
|
10
|
+
:wrapper_tag => :div
|
11
|
+
}
|
12
|
+
assert_equal expected, SimpleForm::FormBuilder.client_side_form_settings(nil, nil)
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'action_view/cases/helper'
|
2
|
+
require 'simple_form/cases/helper'
|
3
|
+
|
4
|
+
class ClientSideValidations::SimpleForm::FormHelperTest < ActionView::TestCase
|
5
|
+
include ActionViewTestSetup
|
6
|
+
include SimpleForm::ActionViewExtensions::FormHelper
|
7
|
+
|
8
|
+
def client_side_form_settings_helper
|
9
|
+
""
|
10
|
+
end
|
11
|
+
|
12
|
+
def test_simple_form_for
|
13
|
+
simple_form_for(@post, :validate => true) do |f|
|
14
|
+
concat f.input(:cost)
|
15
|
+
end
|
16
|
+
|
17
|
+
expected = %{<form accept-charset="UTF-8" action="/posts/123" class="simple_form post" data-validate="true" id="edit_post_123" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="_method" type="hidden" value="put" /></div><div class="input string required"><label class="string required" for="post_cost"><abbr title="required">*</abbr> Cost</label><input class="string required" data-validate="true" id="post_cost" name="post[cost]" required="required" size="50" type="text" /></div></form><script>var edit_post_123 = {"type":"SimpleForm::FormBuilder","error_class":"error","error_tag":"span","wrapper_error_class":"field_with_errors","wrapper_tag":"div","validators":{"post[cost]":{"presence":{"message":"can't be blank"}}}};</script>}
|
18
|
+
assert_equal expected, output_buffer, "\n\n *** If you're running Ruby 1.8 and this test fails is is most likely due to 1.8's lack of insertion order persistence with Hashes ***\n"
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
metadata
ADDED
@@ -0,0 +1,435 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nimboids-client_side_validations
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
- 3
|
10
|
+
version: 3.0.3
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Brian Cardarella
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-04-14 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: activesupport
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ~>
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 7
|
29
|
+
segments:
|
30
|
+
- 3
|
31
|
+
- 0
|
32
|
+
- 0
|
33
|
+
version: 3.0.0
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rails
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ~>
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 7
|
45
|
+
segments:
|
46
|
+
- 3
|
47
|
+
- 0
|
48
|
+
- 0
|
49
|
+
version: 3.0.0
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
name: sqlite3
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
57
|
+
requirements:
|
58
|
+
- - ">="
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
63
|
+
version: "0"
|
64
|
+
type: :development
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
name: bson_ext
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 3
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: mongoid
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
none: false
|
85
|
+
requirements:
|
86
|
+
- - ~>
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
hash: 15
|
89
|
+
segments:
|
90
|
+
- 2
|
91
|
+
- 0
|
92
|
+
- 0
|
93
|
+
version: 2.0.0
|
94
|
+
type: :development
|
95
|
+
version_requirements: *id005
|
96
|
+
- !ruby/object:Gem::Dependency
|
97
|
+
name: mocha
|
98
|
+
prerelease: false
|
99
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
100
|
+
none: false
|
101
|
+
requirements:
|
102
|
+
- - ">="
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
hash: 3
|
105
|
+
segments:
|
106
|
+
- 0
|
107
|
+
version: "0"
|
108
|
+
type: :development
|
109
|
+
version_requirements: *id006
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: simple_form
|
112
|
+
prerelease: false
|
113
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
114
|
+
none: false
|
115
|
+
requirements:
|
116
|
+
- - ">="
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
hash: 3
|
119
|
+
segments:
|
120
|
+
- 0
|
121
|
+
version: "0"
|
122
|
+
type: :development
|
123
|
+
version_requirements: *id007
|
124
|
+
- !ruby/object:Gem::Dependency
|
125
|
+
name: formtastic
|
126
|
+
prerelease: false
|
127
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
128
|
+
none: false
|
129
|
+
requirements:
|
130
|
+
- - ">="
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
hash: 3
|
133
|
+
segments:
|
134
|
+
- 0
|
135
|
+
version: "0"
|
136
|
+
type: :development
|
137
|
+
version_requirements: *id008
|
138
|
+
- !ruby/object:Gem::Dependency
|
139
|
+
name: sinatra
|
140
|
+
prerelease: false
|
141
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
142
|
+
none: false
|
143
|
+
requirements:
|
144
|
+
- - ~>
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
hash: 15
|
147
|
+
segments:
|
148
|
+
- 1
|
149
|
+
- 0
|
150
|
+
version: "1.0"
|
151
|
+
type: :development
|
152
|
+
version_requirements: *id009
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: shotgun
|
155
|
+
prerelease: false
|
156
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
157
|
+
none: false
|
158
|
+
requirements:
|
159
|
+
- - ">="
|
160
|
+
- !ruby/object:Gem::Version
|
161
|
+
hash: 3
|
162
|
+
segments:
|
163
|
+
- 0
|
164
|
+
version: "0"
|
165
|
+
type: :development
|
166
|
+
version_requirements: *id010
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: thin
|
169
|
+
prerelease: false
|
170
|
+
requirement: &id011 !ruby/object:Gem::Requirement
|
171
|
+
none: false
|
172
|
+
requirements:
|
173
|
+
- - ">="
|
174
|
+
- !ruby/object:Gem::Version
|
175
|
+
hash: 3
|
176
|
+
segments:
|
177
|
+
- 0
|
178
|
+
version: "0"
|
179
|
+
type: :development
|
180
|
+
version_requirements: *id011
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: json
|
183
|
+
prerelease: false
|
184
|
+
requirement: &id012 !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ">="
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
hash: 3
|
190
|
+
segments:
|
191
|
+
- 0
|
192
|
+
version: "0"
|
193
|
+
type: :development
|
194
|
+
version_requirements: *id012
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: minitest
|
197
|
+
prerelease: false
|
198
|
+
requirement: &id013 !ruby/object:Gem::Requirement
|
199
|
+
none: false
|
200
|
+
requirements:
|
201
|
+
- - ">="
|
202
|
+
- !ruby/object:Gem::Version
|
203
|
+
hash: 3
|
204
|
+
segments:
|
205
|
+
- 0
|
206
|
+
version: "0"
|
207
|
+
type: :development
|
208
|
+
version_requirements: *id013
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: ruby-debug
|
211
|
+
prerelease: false
|
212
|
+
requirement: &id014 !ruby/object:Gem::Requirement
|
213
|
+
none: false
|
214
|
+
requirements:
|
215
|
+
- - ">="
|
216
|
+
- !ruby/object:Gem::Version
|
217
|
+
hash: 3
|
218
|
+
segments:
|
219
|
+
- 0
|
220
|
+
version: "0"
|
221
|
+
type: :development
|
222
|
+
version_requirements: *id014
|
223
|
+
description: Client Side Validations
|
224
|
+
email:
|
225
|
+
- bcardarella@gmail.com
|
226
|
+
executables: []
|
227
|
+
|
228
|
+
extensions: []
|
229
|
+
|
230
|
+
extra_rdoc_files: []
|
231
|
+
|
232
|
+
files:
|
233
|
+
- client_side_validations.gemspec
|
234
|
+
- javascript/rails.validations.js
|
235
|
+
- lib/client_side_validations.rb
|
236
|
+
- lib/client_side_validations/action_view.rb
|
237
|
+
- lib/client_side_validations/action_view/form_builder.rb
|
238
|
+
- lib/client_side_validations/action_view/form_helper.rb
|
239
|
+
- lib/client_side_validations/action_view/form_tag_helper.rb
|
240
|
+
- lib/client_side_validations/active_model.rb
|
241
|
+
- lib/client_side_validations/active_model/acceptance.rb
|
242
|
+
- lib/client_side_validations/active_model/exclusion.rb
|
243
|
+
- lib/client_side_validations/active_model/format.rb
|
244
|
+
- lib/client_side_validations/active_model/inclusion.rb
|
245
|
+
- lib/client_side_validations/active_model/length.rb
|
246
|
+
- lib/client_side_validations/active_model/numericality.rb
|
247
|
+
- lib/client_side_validations/active_model/presence.rb
|
248
|
+
- lib/client_side_validations/active_record.rb
|
249
|
+
- lib/client_side_validations/active_record/middleware.rb
|
250
|
+
- lib/client_side_validations/active_record/uniqueness.rb
|
251
|
+
- lib/client_side_validations/core_ext.rb
|
252
|
+
- lib/client_side_validations/core_ext/range.rb
|
253
|
+
- lib/client_side_validations/core_ext/regexp.rb
|
254
|
+
- lib/client_side_validations/formtastic.rb
|
255
|
+
- lib/client_side_validations/middleware.rb
|
256
|
+
- lib/client_side_validations/mongoid.rb
|
257
|
+
- lib/client_side_validations/mongoid/middleware.rb
|
258
|
+
- lib/client_side_validations/mongoid/uniqueness.rb
|
259
|
+
- lib/client_side_validations/simple_form.rb
|
260
|
+
- lib/client_side_validations/version.rb
|
261
|
+
- lib/generators/client_side_validations/install_generator.rb
|
262
|
+
- lib/generators/templates/README
|
263
|
+
- lib/generators/templates/client_side_validations.rb
|
264
|
+
- test/action_view/cases/helper.rb
|
265
|
+
- test/action_view/cases/test_helpers.rb
|
266
|
+
- test/action_view/cases/test_legacy_helpers.rb
|
267
|
+
- test/action_view/models.rb
|
268
|
+
- test/action_view/models/comment.rb
|
269
|
+
- test/action_view/models/post.rb
|
270
|
+
- test/active_model/cases/helper.rb
|
271
|
+
- test/active_model/cases/test_acceptance_validator.rb
|
272
|
+
- test/active_model/cases/test_base.rb
|
273
|
+
- test/active_model/cases/test_confirmation_validator.rb
|
274
|
+
- test/active_model/cases/test_exclusion_validator.rb
|
275
|
+
- test/active_model/cases/test_format_validator.rb
|
276
|
+
- test/active_model/cases/test_inclusion_validator.rb
|
277
|
+
- test/active_model/cases/test_length_validator.rb
|
278
|
+
- test/active_model/cases/test_numericality_validator.rb
|
279
|
+
- test/active_model/cases/test_presence_validator.rb
|
280
|
+
- test/active_model/cases/test_validations.rb
|
281
|
+
- test/active_model/models/person.rb
|
282
|
+
- test/active_record/cases/helper.rb
|
283
|
+
- test/active_record/cases/test_base.rb
|
284
|
+
- test/active_record/cases/test_middleware.rb
|
285
|
+
- test/active_record/cases/test_uniqueness_validator.rb
|
286
|
+
- test/active_record/models/guid.rb
|
287
|
+
- test/active_record/models/user.rb
|
288
|
+
- test/base_helper.rb
|
289
|
+
- test/core_ext/cases/test_core_ext.rb
|
290
|
+
- test/formtastic/cases/helper.rb
|
291
|
+
- test/formtastic/cases/test_form_builder.rb
|
292
|
+
- test/formtastic/cases/test_form_helper.rb
|
293
|
+
- test/generators/cases/test_install_generator.rb
|
294
|
+
- test/javascript/config.ru
|
295
|
+
- test/javascript/public/test/callbacks/elementAfter.js
|
296
|
+
- test/javascript/public/test/callbacks/elementBefore.js
|
297
|
+
- test/javascript/public/test/callbacks/elementFail.js
|
298
|
+
- test/javascript/public/test/callbacks/elementPass.js
|
299
|
+
- test/javascript/public/test/callbacks/formAfter.js
|
300
|
+
- test/javascript/public/test/callbacks/formBefore.js
|
301
|
+
- test/javascript/public/test/callbacks/formFail.js
|
302
|
+
- test/javascript/public/test/callbacks/formPass.js
|
303
|
+
- test/javascript/public/test/form_builders/validateForm.js
|
304
|
+
- test/javascript/public/test/form_builders/validateFormtastic.js
|
305
|
+
- test/javascript/public/test/form_builders/validateSimpleForm.js
|
306
|
+
- test/javascript/public/test/settings.js
|
307
|
+
- test/javascript/public/test/validateElement.js
|
308
|
+
- test/javascript/public/test/validators/acceptance.js
|
309
|
+
- test/javascript/public/test/validators/confirmation.js
|
310
|
+
- test/javascript/public/test/validators/exclusion.js
|
311
|
+
- test/javascript/public/test/validators/format.js
|
312
|
+
- test/javascript/public/test/validators/inclusion.js
|
313
|
+
- test/javascript/public/test/validators/length.js
|
314
|
+
- test/javascript/public/test/validators/numericality.js
|
315
|
+
- test/javascript/public/test/validators/presence.js
|
316
|
+
- test/javascript/public/test/validators/uniqueness.js
|
317
|
+
- test/javascript/public/vendor/jquery.metadata.js
|
318
|
+
- test/javascript/public/vendor/qunit.css
|
319
|
+
- test/javascript/public/vendor/qunit.js
|
320
|
+
- test/javascript/server.rb
|
321
|
+
- test/javascript/views/index.erb
|
322
|
+
- test/javascript/views/layout.erb
|
323
|
+
- test/middleware/cases/helper.rb
|
324
|
+
- test/middleware/cases/test_middleware.rb
|
325
|
+
- test/mongoid/cases/helper.rb
|
326
|
+
- test/mongoid/cases/test_base.rb
|
327
|
+
- test/mongoid/cases/test_middleware.rb
|
328
|
+
- test/mongoid/cases/test_uniqueness_validator.rb
|
329
|
+
- test/mongoid/models/book.rb
|
330
|
+
- test/simple_form/cases/helper.rb
|
331
|
+
- test/simple_form/cases/test_form_builder.rb
|
332
|
+
- test/simple_form/cases/test_form_helper.rb
|
333
|
+
homepage: https://github.com/nimboids/client_side_validations
|
334
|
+
licenses: []
|
335
|
+
|
336
|
+
post_install_message:
|
337
|
+
rdoc_options: []
|
338
|
+
|
339
|
+
require_paths:
|
340
|
+
- lib
|
341
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
342
|
+
none: false
|
343
|
+
requirements:
|
344
|
+
- - ">="
|
345
|
+
- !ruby/object:Gem::Version
|
346
|
+
hash: 3
|
347
|
+
segments:
|
348
|
+
- 0
|
349
|
+
version: "0"
|
350
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
351
|
+
none: false
|
352
|
+
requirements:
|
353
|
+
- - ">="
|
354
|
+
- !ruby/object:Gem::Version
|
355
|
+
hash: 3
|
356
|
+
segments:
|
357
|
+
- 0
|
358
|
+
version: "0"
|
359
|
+
requirements: []
|
360
|
+
|
361
|
+
rubyforge_project: client_side_validations
|
362
|
+
rubygems_version: 1.7.2
|
363
|
+
signing_key:
|
364
|
+
specification_version: 3
|
365
|
+
summary: Client Side Validations
|
366
|
+
test_files:
|
367
|
+
- test/action_view/cases/helper.rb
|
368
|
+
- test/action_view/cases/test_helpers.rb
|
369
|
+
- test/action_view/cases/test_legacy_helpers.rb
|
370
|
+
- test/action_view/models.rb
|
371
|
+
- test/action_view/models/comment.rb
|
372
|
+
- test/action_view/models/post.rb
|
373
|
+
- test/active_model/cases/helper.rb
|
374
|
+
- test/active_model/cases/test_acceptance_validator.rb
|
375
|
+
- test/active_model/cases/test_base.rb
|
376
|
+
- test/active_model/cases/test_confirmation_validator.rb
|
377
|
+
- test/active_model/cases/test_exclusion_validator.rb
|
378
|
+
- test/active_model/cases/test_format_validator.rb
|
379
|
+
- test/active_model/cases/test_inclusion_validator.rb
|
380
|
+
- test/active_model/cases/test_length_validator.rb
|
381
|
+
- test/active_model/cases/test_numericality_validator.rb
|
382
|
+
- test/active_model/cases/test_presence_validator.rb
|
383
|
+
- test/active_model/cases/test_validations.rb
|
384
|
+
- test/active_model/models/person.rb
|
385
|
+
- test/active_record/cases/helper.rb
|
386
|
+
- test/active_record/cases/test_base.rb
|
387
|
+
- test/active_record/cases/test_middleware.rb
|
388
|
+
- test/active_record/cases/test_uniqueness_validator.rb
|
389
|
+
- test/active_record/models/guid.rb
|
390
|
+
- test/active_record/models/user.rb
|
391
|
+
- test/base_helper.rb
|
392
|
+
- test/core_ext/cases/test_core_ext.rb
|
393
|
+
- test/formtastic/cases/helper.rb
|
394
|
+
- test/formtastic/cases/test_form_builder.rb
|
395
|
+
- test/formtastic/cases/test_form_helper.rb
|
396
|
+
- test/generators/cases/test_install_generator.rb
|
397
|
+
- test/javascript/config.ru
|
398
|
+
- test/javascript/public/test/callbacks/elementAfter.js
|
399
|
+
- test/javascript/public/test/callbacks/elementBefore.js
|
400
|
+
- test/javascript/public/test/callbacks/elementFail.js
|
401
|
+
- test/javascript/public/test/callbacks/elementPass.js
|
402
|
+
- test/javascript/public/test/callbacks/formAfter.js
|
403
|
+
- test/javascript/public/test/callbacks/formBefore.js
|
404
|
+
- test/javascript/public/test/callbacks/formFail.js
|
405
|
+
- test/javascript/public/test/callbacks/formPass.js
|
406
|
+
- test/javascript/public/test/form_builders/validateForm.js
|
407
|
+
- test/javascript/public/test/form_builders/validateFormtastic.js
|
408
|
+
- test/javascript/public/test/form_builders/validateSimpleForm.js
|
409
|
+
- test/javascript/public/test/settings.js
|
410
|
+
- test/javascript/public/test/validateElement.js
|
411
|
+
- test/javascript/public/test/validators/acceptance.js
|
412
|
+
- test/javascript/public/test/validators/confirmation.js
|
413
|
+
- test/javascript/public/test/validators/exclusion.js
|
414
|
+
- test/javascript/public/test/validators/format.js
|
415
|
+
- test/javascript/public/test/validators/inclusion.js
|
416
|
+
- test/javascript/public/test/validators/length.js
|
417
|
+
- test/javascript/public/test/validators/numericality.js
|
418
|
+
- test/javascript/public/test/validators/presence.js
|
419
|
+
- test/javascript/public/test/validators/uniqueness.js
|
420
|
+
- test/javascript/public/vendor/jquery.metadata.js
|
421
|
+
- test/javascript/public/vendor/qunit.css
|
422
|
+
- test/javascript/public/vendor/qunit.js
|
423
|
+
- test/javascript/server.rb
|
424
|
+
- test/javascript/views/index.erb
|
425
|
+
- test/javascript/views/layout.erb
|
426
|
+
- test/middleware/cases/helper.rb
|
427
|
+
- test/middleware/cases/test_middleware.rb
|
428
|
+
- test/mongoid/cases/helper.rb
|
429
|
+
- test/mongoid/cases/test_base.rb
|
430
|
+
- test/mongoid/cases/test_middleware.rb
|
431
|
+
- test/mongoid/cases/test_uniqueness_validator.rb
|
432
|
+
- test/mongoid/models/book.rb
|
433
|
+
- test/simple_form/cases/helper.rb
|
434
|
+
- test/simple_form/cases/test_form_builder.rb
|
435
|
+
- test/simple_form/cases/test_form_helper.rb
|