lite-validators 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: 01d223e74a65a8ce210c64227246eee8aca7df6d9be7229e4d7305959a716b96
4
- data.tar.gz: 63c6a6b94991628b2a83fc8892bda9c2d5df8b0c087850c9e8a7bea7aa949400
3
+ metadata.gz: 457ae01657eae20eb4616d1ab54cea423c743469f571a37b4d0ccaddb8f60582
4
+ data.tar.gz: 2c05ea3dafb533e96251cc9b63947dbf1bdc868fa6a7bf824785fb09a66755fa
5
5
  SHA512:
6
- metadata.gz: ce3c9c1d596050bbe4f9fcbe05f2d402a9de076e195bd854a41ba016930f3d3c784eb9f1ed17694b462e21b45e374c0c9f4c90084c1a759677f9fe422adb1e67
7
- data.tar.gz: 11fb1e3bf10d0717696792f3e242832db5b0eaf9a4cbd8b0109c01d21535d06790e7f6e0aa510ce3166e022379ab8c4daaf659424a1573b50b787226c168d010
6
+ metadata.gz: b65070d22d816fe59211851cb4ad2c0f9513e471e6bcfe60eb28469aa4e1c2dc208ceb46f478be160f74035be164643031afa2b2f4e667306cbedf983978635a
7
+ data.tar.gz: 8cbb7ba5a58f1e612117d642737ce9037c63642b9dedfa326630378fc6b948cd973a648b46f9cdea5c31c6a4d90f9228d2cc5f71e3bcd57a61f0bf6ff2794f85
@@ -6,6 +6,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
- ## [1.0.0] - 2019-06-26
9
+ ## [1.0.1] - 2019-07-01
10
+ ### Added
11
+ - Add EIN validator
12
+ - Add port section to docs
13
+
14
+ ### Changed
15
+ - Remove duplicate 0 from isbn characters constant
16
+
17
+ ## [1.0.0] - 2019-06-29
10
18
  ### Added
11
19
  - Initial project version
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-validators (1.0.0)
4
+ lite-validators (1.0.1)
5
5
  activemodel
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -5,6 +5,8 @@
5
5
 
6
6
  Lite::Validators is a collection of validators useful for any Rails application.
7
7
 
8
+ **NOTE:** If you are coming from `ActiveValidation`, please read the [port](#port) section.
9
+
8
10
  ## Installation
9
11
 
10
12
  Add this line to your application's Gemfile:
@@ -25,36 +27,38 @@ Or install it yourself as:
25
27
 
26
28
  * [Validators](#validators)
27
29
  * [3rd-party](#3rd-party)
30
+ * [Port](#port)
28
31
 
29
32
  ## Validators
30
33
 
31
34
  * [Alpha](https://github.com/drexed/lite-validators/blob/master/docs/ALPHA.md)
32
- * [AlphaNumeric](https://github.com/drexed/lite-validators/blob/master/docs/ALPHA_NUMERIC.md)
35
+ * [Alpha numeric](https://github.com/drexed/lite-validators/blob/master/docs/ALPHA_NUMERIC.md)
33
36
  * [Base64](https://github.com/drexed/lite-validators/blob/master/docs/BASE64.md)
34
37
  * [Boolean](https://github.com/drexed/lite-validators/blob/master/docs/BOOLEAN.md)
35
38
  * [Compare](https://github.com/drexed/lite-validators/blob/master/docs/COMPARE.md)
36
39
  * [Coordinates](https://github.com/drexed/lite-validators/blob/master/docs/COORDINATE.md)
37
- * [Credit Card](https://github.com/drexed/lite-validators/blob/master/docs/CREDIT_CARD.md)
40
+ * [Credit card](https://github.com/drexed/lite-validators/blob/master/docs/CREDIT_CARD.md)
38
41
  * [Csv](https://github.com/drexed/lite-validators/blob/master/docs/CSV.md)
39
42
  * [Currency](https://github.com/drexed/lite-validators/blob/master/docs/CURRENCY.md)
40
43
  * [CUSIP](https://github.com/drexed/lite-validators/blob/master/docs/CUSIP.md)
41
44
  * [Email](https://github.com/drexed/lite-validators/blob/master/docs/EMAIL.md)
42
- * [File Content Type](https://github.com/drexed/lite-validators/blob/master/docs/FILE_CONTENT_TYPE.md)
43
- * [File Extension](https://github.com/drexed/lite-validators/blob/master/docs/FILE_EXTENSION.md)
44
- * [File Size](https://github.com/drexed/lite-validators/blob/master/docs/FILE_SIZE.md)
45
+ * [EIN](https://github.com/drexed/lite-validators/blob/master/docs/EIN.md)
46
+ * [File content Type](https://github.com/drexed/lite-validators/blob/master/docs/FILE_CONTENT_TYPE.md)
47
+ * [File extension](https://github.com/drexed/lite-validators/blob/master/docs/FILE_EXTENSION.md)
48
+ * [File size](https://github.com/drexed/lite-validators/blob/master/docs/FILE_SIZE.md)
45
49
  * [HEX](https://github.com/drexed/lite-validators/blob/master/docs/HEX.md)
46
50
  * [IMEI](https://github.com/drexed/lite-validators/blob/master/docs/IMEI.md)
47
- * [IP Address](https://github.com/drexed/lite-validators/blob/master/docs/IP_ADDRESS.md)
51
+ * [IP address](https://github.com/drexed/lite-validators/blob/master/docs/IP_ADDRESS.md)
48
52
  * [ISBN](https://github.com/drexed/lite-validators/blob/master/docs/ISBN.md)
49
53
  * [ISIN](https://github.com/drexed/lite-validators/blob/master/docs/ISIN.md)
50
- * [MAC Address](https://github.com/drexed/lite-validators/blob/master/docs/MAC.md)
54
+ * [MAC address](https://github.com/drexed/lite-validators/blob/master/docs/MAC.md)
51
55
  * [Name](https://github.com/drexed/lite-validators/blob/master/docs/NAME.md)
52
56
  * [Password](https://github.com/drexed/lite-validators/blob/master/docs/PASSWORD.md)
53
- * [Phone Number](https://github.com/drexed/lite-validators/blob/master/docs/PHONE_NUMBER.md)
57
+ * [Phone number](https://github.com/drexed/lite-validators/blob/master/docs/PHONE_NUMBER.md)
54
58
  * [SEDOL](https://github.com/drexed/lite-validators/blob/master/docs/SEDOL.md)
55
59
  * [Slug](https://github.com/drexed/lite-validators/blob/master/docs/SLUG.md)
56
60
  * [SSN](https://github.com/drexed/lite-validators/blob/master/docs/SSN.md)
57
- * [Time Zone](https://github.com/drexed/lite-validators/blob/master/docs/TIME_ZONE.md)
61
+ * [Time zone](https://github.com/drexed/lite-validators/blob/master/docs/TIME_ZONE.md)
58
62
  * [Type](https://github.com/drexed/lite-validators/blob/master/docs/TYPE.md)
59
63
  * [URL](https://github.com/drexed/lite-validators/blob/master/docs/URL.md)
60
64
  * [Username](https://github.com/drexed/lite-validators/blob/master/docs/USERNAME.md)
@@ -69,6 +73,16 @@ The following are highly recommended 3rd party validators to supplement your wor
69
73
  * **Group:** Group Validations - https://github.com/adzap/grouped_validations
70
74
  * **Overlap:** Validates Overlap - https://github.com/robinbortlik/validates_overlap
71
75
 
76
+ ## Port
77
+
78
+ `Lite::Validators` is a near compatible port of [ActiveValidation](https://github.com/drexed/active_validation).
79
+
80
+ The names for the following validators has been changed, so you will need to make the
81
+ appropriate changes: `equality #=> compare`, `phone #=> phone_number`
82
+
83
+ The syntax for the following validators has been reworked, so you will need to consult the docs
84
+ for making the appropriate changes: `csv`, `compare`
85
+
72
86
  ## Development
73
87
 
74
88
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -1,4 +1,4 @@
1
- # Time Zone
1
+ # Time zone
2
2
 
3
3
  #### Rules
4
4
 
@@ -4,7 +4,7 @@ require 'active_model'
4
4
  require 'lite/validators/version'
5
5
 
6
6
  %w[
7
- base alpha alpha_numeric base64 boolean compare coordinate credit_card currency cusip email
7
+ base alpha alpha_numeric base64 boolean compare coordinate credit_card currency cusip email ein
8
8
  file_content_type file_extension file_size csv hex imei ip_address isbn isin mac_address name
9
9
  password phone_number sedol slug ssn time_zone type url username uuid
10
10
  ].each do |name|
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class EinValidator < BaseValidator
4
+
5
+ REGEXP ||= /^[1-9]\d?-\d{7}$/.freeze
6
+
7
+ end
@@ -3,7 +3,7 @@
3
3
  class IsbnValidator < BaseValidator
4
4
 
5
5
  CHARACTERS ||= %w[
6
- 0 1 2 3 4 5 6 7 8 9 0 x
6
+ 0 1 2 3 4 5 6 7 8 9 x
7
7
  ].freeze
8
8
 
9
9
  private
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Validators
5
5
 
6
- VERSION ||= '1.0.0'
6
+ VERSION ||= '1.0.1'
7
7
 
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-validators
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-30 00:00:00.000000000 Z
11
+ date: 2019-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -216,6 +216,7 @@ files:
216
216
  - lib/lite/validators/csv_validator.rb
217
217
  - lib/lite/validators/currency_validator.rb
218
218
  - lib/lite/validators/cusip_validator.rb
219
+ - lib/lite/validators/ein_validator.rb
219
220
  - lib/lite/validators/email_validator.rb
220
221
  - lib/lite/validators/file_content_type_validator.rb
221
222
  - lib/lite/validators/file_extension_validator.rb