evelpidon_validators 0.6.0 → 0.6.1

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.
@@ -1,5 +1,9 @@
1
1
  # Evelpidon Validators changelog
2
2
 
3
+ ## 0.6.1 - 14/09/2013
4
+
5
+ * Client side implementation (in JS) of "different" validator.
6
+
3
7
  ## 0.6.0 - 06/09/2013
4
8
 
5
9
  * Minor changes to make gem compatible to Ruby 2.0.0 (and Rails 3.2 and Client Side Validations 3.2)
@@ -1,7 +1,15 @@
1
- ClientSideValidations.validators.remote['different'] = function(element, options) {
2
- if ($.ajax({
3
- url: '/validators/different',
4
- data: { value: element.val(), than: ClientSideValidations.helpers.getSiblingField(element, options.than).val() },
5
- async: false
6
- }).status == 404) { return options.message; }
1
+ // Define the trim function if it's not already defined.
2
+ // See http://stackoverflow.com/a/1418059 for more info
3
+ if (typeof(String.prototype.trim) === "undefined") {
4
+ String.prototype.trim = function () {
5
+ return String(this).replace(/^\s+|\s+$/g, '');
6
+ };
7
+ }
8
+
9
+ ClientSideValidations.validators.remote['different'] = function (element, options) {
10
+ var value = element.val(),
11
+ otherValue = ClientSideValidations.helpers.getSiblingField(element, options.than).val();
12
+ if (value.trim() == otherValue.trim()) {
13
+ return options.message;
14
+ }
7
15
  };
@@ -1,3 +1,3 @@
1
1
  module EvelpidonValidators
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evelpidon_validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.1
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Nikos Dimitrakopoulos
@@ -9,90 +10,102 @@ authors:
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2013-09-06 00:00:00.000000000 Z
13
+ date: 2013-09-14 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rake
16
17
  requirement: !ruby/object:Gem::Requirement
18
+ none: false
17
19
  requirements:
18
- - - '>='
20
+ - - ! '>='
19
21
  - !ruby/object:Gem::Version
20
22
  version: '0'
21
23
  type: :development
22
24
  prerelease: false
23
25
  version_requirements: !ruby/object:Gem::Requirement
26
+ none: false
24
27
  requirements:
25
- - - '>='
28
+ - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: '0'
28
31
  - !ruby/object:Gem::Dependency
29
32
  name: activesupport
30
33
  requirement: !ruby/object:Gem::Requirement
34
+ none: false
31
35
  requirements:
32
- - - '>='
36
+ - - ! '>='
33
37
  - !ruby/object:Gem::Version
34
38
  version: '0'
35
39
  type: :development
36
40
  prerelease: false
37
41
  version_requirements: !ruby/object:Gem::Requirement
42
+ none: false
38
43
  requirements:
39
- - - '>='
44
+ - - ! '>='
40
45
  - !ruby/object:Gem::Version
41
46
  version: '0'
42
47
  - !ruby/object:Gem::Dependency
43
48
  name: evelpidon_test_helpers
44
49
  requirement: !ruby/object:Gem::Requirement
50
+ none: false
45
51
  requirements:
46
- - - '>='
52
+ - - ! '>='
47
53
  - !ruby/object:Gem::Version
48
54
  version: '0'
49
55
  type: :development
50
56
  prerelease: false
51
57
  version_requirements: !ruby/object:Gem::Requirement
58
+ none: false
52
59
  requirements:
53
- - - '>='
60
+ - - ! '>='
54
61
  - !ruby/object:Gem::Version
55
62
  version: '0'
56
63
  - !ruby/object:Gem::Dependency
57
64
  name: test-unit
58
65
  requirement: !ruby/object:Gem::Requirement
66
+ none: false
59
67
  requirements:
60
- - - '>='
68
+ - - ! '>='
61
69
  - !ruby/object:Gem::Version
62
70
  version: '0'
63
71
  type: :development
64
72
  prerelease: false
65
73
  version_requirements: !ruby/object:Gem::Requirement
74
+ none: false
66
75
  requirements:
67
- - - '>='
76
+ - - ! '>='
68
77
  - !ruby/object:Gem::Version
69
78
  version: '0'
70
79
  - !ruby/object:Gem::Dependency
71
80
  name: activemodel
72
81
  requirement: !ruby/object:Gem::Requirement
82
+ none: false
73
83
  requirements:
74
- - - '>='
84
+ - - ! '>='
75
85
  - !ruby/object:Gem::Version
76
86
  version: '0'
77
87
  type: :runtime
78
88
  prerelease: false
79
89
  version_requirements: !ruby/object:Gem::Requirement
90
+ none: false
80
91
  requirements:
81
- - - '>='
92
+ - - ! '>='
82
93
  - !ruby/object:Gem::Version
83
94
  version: '0'
84
95
  - !ruby/object:Gem::Dependency
85
96
  name: credit_card_validator
86
97
  requirement: !ruby/object:Gem::Requirement
98
+ none: false
87
99
  requirements:
88
- - - '>='
100
+ - - ! '>='
89
101
  - !ruby/object:Gem::Version
90
102
  version: '0'
91
103
  type: :runtime
92
104
  prerelease: false
93
105
  version_requirements: !ruby/object:Gem::Requirement
106
+ none: false
94
107
  requirements:
95
- - - '>='
108
+ - - ! '>='
96
109
  - !ruby/object:Gem::Version
97
110
  version: '0'
98
111
  description: Useful ActiveModel validators with ClientSideValidations support.
@@ -132,26 +145,27 @@ files:
132
145
  - test/test_helper.rb
133
146
  homepage: ''
134
147
  licenses: []
135
- metadata: {}
136
148
  post_install_message:
137
149
  rdoc_options: []
138
150
  require_paths:
139
151
  - lib
140
152
  required_ruby_version: !ruby/object:Gem::Requirement
153
+ none: false
141
154
  requirements:
142
- - - '>='
155
+ - - ! '>='
143
156
  - !ruby/object:Gem::Version
144
157
  version: '0'
145
158
  required_rubygems_version: !ruby/object:Gem::Requirement
159
+ none: false
146
160
  requirements:
147
- - - '>='
161
+ - - ! '>='
148
162
  - !ruby/object:Gem::Version
149
163
  version: '0'
150
164
  requirements: []
151
165
  rubyforge_project: evelpidon_validators
152
- rubygems_version: 2.0.6
166
+ rubygems_version: 1.8.25
153
167
  signing_key:
154
- specification_version: 4
168
+ specification_version: 3
155
169
  summary: Useful ActiveModel validators
156
170
  test_files:
157
171
  - test/associated_test.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 6db01856065c3e2b996d644e972f17db9bf8ac84
4
- data.tar.gz: 314853198564ef776815e046debc8245e23c0b83
5
- SHA512:
6
- metadata.gz: f5bfe9d47e11eefdd5299f37bed70513782b65d55d0077b4e0e16ac5f73a15cfc3f93c829d31e26bdaef6cc03970df7731b1f5eda482d49335aabe81c84adc8c
7
- data.tar.gz: fc585dce5401144705d2290f9aea86a5e15aee1b20943997ebfd9f59d85d765d62479bad52d1a952da0bee1412722db56a2b2cb2b3a175b0a2f0068424631b6c