active_validation 4.0.7 → 4.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf5d7cfd16997801ca5314f452ebbcdb992ba1d6
4
- data.tar.gz: f0bbff632e92b1c6ef313e3785175e5e2a0f53fb
3
+ metadata.gz: 91f5bc2ffa4caf18e05f39ecd8f8deda3937091b
4
+ data.tar.gz: ff902a17fd63dddf75c4a687f809867d9ac68ead
5
5
  SHA512:
6
- metadata.gz: 48412ba763a404a27910b0e9abd99f585e6c8544ff18449591de9d140be175c640e962917dcfd9a98d3eea53fe08717529a9b2d04c8c33e07a61a09898b177dc
7
- data.tar.gz: e6ba5c02b49b78301b61e8d9f9ac022df5933ddc4b767abad3cf9f03960c10427edf714b42f7be43ebadae63f895cf7f7cce88f205055a60310548f233f62e04
6
+ metadata.gz: a9cccc0c94152f26ab7c24d75e48ef30f86ae02c0e8862a7e4c0f1246a53c9d7c02bc47c494161f8375d7cf58bff670ce4adecb7579f9576679456434d8122ab
7
+ data.tar.gz: 68fd81d6cd9c426c57e14db746ac570af7bd45b07f4d91c749b20229fb7dad2eed704fd0792f0f5fffc7094069ab017dae6923e5302dd140edf4f9b013ae80a3
data/.rubocop.yml CHANGED
@@ -4,8 +4,22 @@ AllCops:
4
4
  TargetRubyVersion: 2.3
5
5
  Exclude:
6
6
  - 'spec/**/**/*'
7
+ Layout/ClosingParenthesisIndentation:
8
+ Enabled: false
9
+ Layout/EmptyLinesAroundBlockBody:
10
+ Enabled: false
11
+ Layout/EmptyLinesAroundClassBody:
12
+ Enabled: false
13
+ Layout/EmptyLinesAroundModuleBody:
14
+ Enabled: false
15
+ Layout/FirstParameterIndentation:
16
+ Enabled: false
17
+ Layout/MultilineMethodCallIndentation:
18
+ EnforcedStyle: aligned
7
19
  LineLength:
8
20
  Max: 100
21
+ Lint/ScriptPermission:
22
+ Enabled: false
9
23
  Metrics/AbcSize:
10
24
  Enabled: false
11
25
  Metrics/ClassLength:
@@ -28,24 +42,12 @@ Style/ClassAndModuleChildren:
28
42
  Enabled: false
29
43
  Style/ClassVars:
30
44
  Enabled: false
31
- Style/ClosingParenthesisIndentation:
32
- Enabled: false
33
45
  Style/Documentation:
34
46
  Enabled: false
35
- Style/EmptyLinesAroundBlockBody:
36
- Enabled: false
37
- Style/EmptyLinesAroundClassBody:
38
- Enabled: false
39
- Style/EmptyLinesAroundModuleBody:
40
- Enabled: false
41
47
  Style/HashSyntax:
42
48
  Enabled: false
43
- Style/FirstParameterIndentation:
44
- Enabled: false
45
49
  Style/FrozenStringLiteralComment:
46
50
  Enabled: false
47
- Style/MultilineMethodCallIndentation:
48
- EnforcedStyle: aligned
49
51
  Style/NumericLiterals:
50
52
  Enabled: false
51
53
  Style/RescueModifier:
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'active_validation/version'
@@ -1,6 +1,6 @@
1
1
  class CoordinateValidator < ActiveModel::EachValidator
2
2
 
3
- BOUNDARIES ||= [:coordinate, :latitude, :longitude].freeze
3
+ BOUNDARIES ||= %i[coordinate latitude longitude].freeze
4
4
 
5
5
  # rubocop:disable Metrics/LineLength
6
6
  def validate_each(record, attribute, value)
@@ -15,23 +15,23 @@ class CreditCardValidator < ActiveModel::EachValidator
15
15
 
16
16
  # rubocop:disable Style/IndentArray
17
17
  PREFIXES ||= {
18
- american_express: %w(34 37),
19
- diners_club: %w(300 301 302 303 304 305 36 54 55),
20
- discover: %w(
18
+ american_express: %w[34 37],
19
+ diners_club: %w[300 301 302 303 304 305 36 54 55],
20
+ discover: %w[
21
21
  6011 622126 622127 622128 622129 62213 62214 62215 62216 62217 62218 62219 6222
22
22
  6223 6224 6225 6226 6227 6228 62290 62291 622920 622921 622922 622923 622924
23
23
  622925 644 645 646 647 648 649 65
24
- ),
25
- jcb: %w(3528 3529 353 354 355 356 357 358),
26
- laser: %w(6304 6706 6771 6709),
27
- maestro: %w(5018 5020 5038 6304 6759 6761 6762 6763 6764 6765 6766),
28
- mastercard: %w(51 52 53 54 55),
29
- solo: %w(6334 6767),
30
- unionpay: %w(
24
+ ],
25
+ jcb: %w[3528 3529 353 354 355 356 357 358],
26
+ laser: %w[6304 6706 6771 6709],
27
+ maestro: %w[5018 5020 5038 6304 6759 6761 6762 6763 6764 6765 6766],
28
+ mastercard: %w[51 52 53 54 55],
29
+ solo: %w[6334 6767],
30
+ unionpay: %w[
31
31
  622126 622127 622128 622129 62213 62214 62215 62216 62217 62218 62219 6222 6223
32
32
  6224 6225 6226 6227 6228 62290 62291 622920 622921 622922 622923 622924 622925
33
- ),
34
- visa: %w(4)
33
+ ],
34
+ visa: %w[4]
35
35
  }.freeze
36
36
  # rubocop:enable Style/IndentArray
37
37
 
@@ -1,6 +1,6 @@
1
1
  class IsbnValidator < ActiveModel::EachValidator
2
2
 
3
- CHARACTERS ||= %w(0 1 2 3 4 5 6 7 8 9 0 x).freeze
3
+ CHARACTERS ||= %w[0 1 2 3 4 5 6 7 8 9 0 x].freeze
4
4
 
5
5
  def validate_each(record, attribute, value)
6
6
  return if valid?(value.to_s)
@@ -58,7 +58,7 @@ class TrackingNumberValidator < ActiveModel::EachValidator
58
58
  end
59
59
 
60
60
  CARRIERS_AND_SERVICES[:fedex]
61
- .select { |key, _| [:ground, :ground18, :ground96].include?(key) }
61
+ .select { |key, _| %i[ground ground18 ground96].include?(key) }
62
62
  .each_with_index do |(srv, pat), idx|
63
63
  define_method("valid_fedex_#{srv}_checksum?") do |val|
64
64
  return(false) unless val.size == [15, 18, 22].at(idx)
@@ -103,7 +103,7 @@ class TrackingNumberValidator < ActiveModel::EachValidator
103
103
 
104
104
  # Ontrac & UPS
105
105
  CARRIERS_AND_SERVICES
106
- .select { |key, _| [:ontrac, :ups].include?(key) }
106
+ .select { |key, _| %i[ontrac ups].include?(key) }
107
107
  .each_with_index do |(cars, sers), idx|
108
108
  sers.each do |ser, pat|
109
109
  define_method("valid_#{cars}_#{ser}_checksum?") do |val|
@@ -1,7 +1,7 @@
1
1
  require 'uri'
2
2
  class UrlValidator < ActiveModel::EachValidator
3
3
 
4
- DEFAULT_SCHEMES ||= [:http, :https].freeze
4
+ DEFAULT_SCHEMES ||= %i[http https].freeze
5
5
 
6
6
  def validate_each(record, attribute, value)
7
7
  uri = URI.parse(value.to_s)
@@ -1,3 +1,3 @@
1
1
  module ActiveValidation
2
- VERSION = '4.0.7'.freeze
2
+ VERSION = '4.0.8'.freeze
3
3
  end
@@ -3,11 +3,11 @@ require 'active_support'
3
3
  require 'active_support/core_ext/time/zones'
4
4
  require 'active_validation/version'
5
5
 
6
- ACTIVE_VALIDATION_VALIDATORS ||= %w(
6
+ ACTIVE_VALIDATION_VALIDATORS ||= %w[
7
7
  alpha alpha_numeric base64 boolean coordinate credit_card currency cusip email equality hex imei
8
8
  ip isbn isin mac_address name password phone sedol slug ssn time_zone tracking_number type url
9
9
  username uuid
10
- ).freeze
10
+ ].freeze
11
11
 
12
12
  ACTIVE_VALIDATION_VALIDATORS.each do |file_name|
13
13
  require "active_validation/validators/#{file_name}_validator"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_validation
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.7
4
+ version: 4.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-15 00:00:00.000000000 Z
11
+ date: 2017-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -227,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
227
227
  version: '0'
228
228
  requirements: []
229
229
  rubyforge_project:
230
- rubygems_version: 2.6.8
230
+ rubygems_version: 2.6.12
231
231
  signing_key:
232
232
  specification_version: 4
233
233
  summary: Gem for commonly used validators.