judge 2.1.0 → 2.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7746ff63f79624cba084792b725bc8b70c30ec8b
4
- data.tar.gz: fe99a88f47c70dcb900230c0d307bcbff8a8173f
3
+ metadata.gz: fcf1e3ed1bb5500b69d1cc9e5074e56f43e86a46
4
+ data.tar.gz: 9536e4c10547ccf7abbcb7dd6e83699096f7c282
5
5
  SHA512:
6
- metadata.gz: e0d8848464312ae4e0c2797399335b41f990f162c450698b6b74641b1efee11b8f64e6aad73a00f3cb6ab4595289f3fa8097411064713fa351dc0a7669b9019f
7
- data.tar.gz: 15f8d536e8431785c0cde1f7125ad647a3f5d824a47b1cd59dc827685d1d6d8caffa5394b0ef63faeeb75059d7f3e04596e791111f323fcede6d4367d5d3f74f
6
+ metadata.gz: 208177747be57442d0ff59bf79b86ceda1a675c40ae2d28f9b883a40da6b7fd8f7281b746074138e3c9e885d47a78ec31b29f424bd971f3816527e9c9156b90f
7
+ data.tar.gz: b7893ca20ab01d91c325de6585642177af687a2065ca2931543f45a73459e8628063bfd535f77bbef8cd7916eb3673ba9abc9ebfaeacfa35c5aad8d99b387921
@@ -1,4 +1,4 @@
1
- // Judge 2.1.0
1
+ // Judge 2.1.1
2
2
  // (c) 2011-2013 Joe Corcoran
3
3
  // http://raw.github.com/joecorcoran/judge/master/LICENSE.txt
4
4
 
@@ -14,7 +14,7 @@
14
14
  var judge = root.judge = {},
15
15
  _ = root._;
16
16
 
17
- judge.VERSION = '2.1.0';
17
+ judge.VERSION = '2.1.1';
18
18
 
19
19
  // Trying to be a bit more descriptive than the basic error types allow.
20
20
  var DependencyError = function(message) {
@@ -273,7 +273,10 @@
273
273
  is: { operator: '!=', message: 'wrong_length' }
274
274
  };
275
275
  _(types).each(function(properties, type) {
276
- var invalid = operate(this.value.length, properties.operator, options[type]);
276
+ var length = this.length || this.value.length;
277
+ // Rails validations count new lines as two characters, we account for them here
278
+ length += (this.value.match(/\n/g) || []).length;
279
+ var invalid = operate(length, properties.operator, options[type]);
277
280
  if (_(options).has(type) && invalid) {
278
281
  msgs.push(messages[properties.message]);
279
282
  }
@@ -1,3 +1,3 @@
1
1
  module Judge
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: judge
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Corcoran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails