license_plate_validator 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/release.yml +29 -0
- data/.github/workflows/test.yml +43 -0
- data/CHANGELOG +14 -7
- data/README.md +4 -3
- data/RELEASING.md +8 -0
- data/gemfiles/Gemfile.rails7.0 +5 -0
- data/gemfiles/Gemfile.rails7.1 +5 -0
- data/gemfiles/Gemfile.rails7.2 +5 -0
- data/gemfiles/{standalone → Gemfile.ruby} +1 -1
- data/lib/license_plate_validator/version.rb +1 -1
- data/lib/license_plate_validator.rb +6 -2
- data/license_plate_validator.gemspec +5 -5
- data/spec/license_plate_validator/active_model_spec.rb +23 -21
- data/spec/license_plate_validator_spec.rb +11 -6
- metadata +21 -20
- data/gem-private_key.pem +0 -27
- data/gem-public_cert.pem +0 -21
- data/gemfiles/activemodel-3-2 +0 -5
- data/gemfiles/activemodel-4 +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 4b14548fad67c137489b550601ec07d6c2bdbffd370041f110dedef142be237c
|
4
|
+
data.tar.gz: c722040730ca5c1f7e6343a29c08b5f3b5b4962f0154d7bf69470f00f4cb47b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b9aaeb5f62a2424afc70df1d44cda8ca1c4546c54d2a3f9e3ced7680e1bb022ce4dbc3479a3859fb28bb61c51a55832e458bfe9019211fc81545d171c04a3d2
|
7
|
+
data.tar.gz: 01f958e7128b87caef078f52df6fba5c168ed35654dcc40715d554daa059514cbd4fca157b69b3426607e9e22c60d50935fdaa1d543a6d3f0d07e45a4bf5748d
|
@@ -0,0 +1,29 @@
|
|
1
|
+
name: Release to Rubygems
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags:
|
6
|
+
- v*
|
7
|
+
|
8
|
+
permissions:
|
9
|
+
contents: read
|
10
|
+
|
11
|
+
jobs:
|
12
|
+
push:
|
13
|
+
if: github.repository == 'ariejan/license_plate_validator'
|
14
|
+
runs-on: ubuntu-latest
|
15
|
+
|
16
|
+
permissions:
|
17
|
+
contents: write
|
18
|
+
id-token: write
|
19
|
+
|
20
|
+
steps:
|
21
|
+
- uses: actions/checkout@v4
|
22
|
+
- name: Set up Ruby
|
23
|
+
uses: ruby/setup-ruby@v1
|
24
|
+
with:
|
25
|
+
bundler-cache: true
|
26
|
+
ruby-version: ruby
|
27
|
+
|
28
|
+
# Release
|
29
|
+
- uses: rubygems/release-gem@v1
|
@@ -0,0 +1,43 @@
|
|
1
|
+
name: Ruby CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ master ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ master ]
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
test:
|
11
|
+
runs-on: ubuntu-latest
|
12
|
+
|
13
|
+
strategy:
|
14
|
+
matrix:
|
15
|
+
ruby-version:
|
16
|
+
- 3.1
|
17
|
+
- 3.2
|
18
|
+
- 3.3
|
19
|
+
- 3.4
|
20
|
+
gemfile:
|
21
|
+
- gemfiles/Gemfile.ruby
|
22
|
+
- gemfiles/Gemfile.rails7.0
|
23
|
+
- gemfiles/Gemfile.rails7.1
|
24
|
+
- gemfiles/Gemfile.rails7.2
|
25
|
+
|
26
|
+
steps:
|
27
|
+
- uses: actions/checkout@v4
|
28
|
+
|
29
|
+
- name: Set up Ruby
|
30
|
+
uses: ruby/setup-ruby@v1
|
31
|
+
with:
|
32
|
+
ruby-version: ${{ matrix.ruby-version }}
|
33
|
+
|
34
|
+
- name: Install dependencies
|
35
|
+
run: |
|
36
|
+
gem install bundler
|
37
|
+
bundle install --gemfile=${{ matrix.gemfile }}
|
38
|
+
|
39
|
+
- name: Run tests
|
40
|
+
run: |
|
41
|
+
bundle exec rspec
|
42
|
+
env:
|
43
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
data/CHANGELOG
CHANGED
@@ -1,12 +1,19 @@
|
|
1
|
-
|
1
|
+
# CHANGELOG
|
2
2
|
|
3
|
-
|
4
|
-
* German language support
|
3
|
+
## 2.0.0 - 2024-09-24
|
5
4
|
|
6
|
-
|
5
|
+
- Update dependencies; this may break older Ruby (< 3.1) and Rails (< 7.x) integrations.
|
6
|
+
- Add new NL license plate formats - @edwardmp
|
7
7
|
|
8
|
-
|
8
|
+
## 1.2.0 - 2014-07-28
|
9
9
|
|
10
|
-
|
10
|
+
- German license plate support
|
11
|
+
- German language support
|
11
12
|
|
12
|
-
|
13
|
+
## 1.1.1 - 2014-04-25
|
14
|
+
|
15
|
+
- Fix i18n key
|
16
|
+
|
17
|
+
## 1.0 - 2013-04-23
|
18
|
+
|
19
|
+
- Initial release with Dutch license plate support
|
data/README.md
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
# License Plate Validator
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/license_plate_validator.png)](http://badge.fury.io/rb/license_plate_validator)
|
4
|
-
[![
|
4
|
+
[![Ruby CI](https://github.com/ariejan/license_plate_validator/actions/workflows/test.yml/badge.svg)](https://github.com/ariejan/license_plate_validator/actions)
|
5
5
|
|
6
6
|
This gem allows you to easily valdiate license plate fields to be valid
|
7
7
|
license plates.
|
8
8
|
|
9
9
|
We're planning on supporting multiple countries, but at this time we can
|
10
|
-
only validate Dutch license plates.
|
10
|
+
only validate Dutch and German license plates.
|
11
11
|
|
12
12
|
## Features
|
13
13
|
|
@@ -40,7 +40,7 @@ Or install it yourself as:
|
|
40
40
|
LicensePlateValidator.new("SBA 5226", country: :nl).valid?
|
41
41
|
#=> false
|
42
42
|
|
43
|
-
###
|
43
|
+
### Ruby on Rails support
|
44
44
|
|
45
45
|
You can use LicensePlateValidator with any ActiveModel class, including
|
46
46
|
ActiveRecord models:
|
@@ -102,6 +102,7 @@ specs.
|
|
102
102
|
## Contributor
|
103
103
|
|
104
104
|
* Pascal Widdershoven - for the original regexes for Dutch license plate numbers.
|
105
|
+
* Edward Poot - for adding new RDW approved license plate schemes
|
105
106
|
* Marcus Ilgner, evopark - for german license plates
|
106
107
|
|
107
108
|
## License
|
data/RELEASING.md
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
## Releasing
|
2
|
+
|
3
|
+
1. Update version file in `lib/license_plate_validator/version.rb` and run `bundle install`.
|
4
|
+
1. Update `CHANGELOG` to reflect the changes in this release.
|
5
|
+
1. Commit changes to `master`.
|
6
|
+
1. Tag the release: `git tag -s vVERSION`
|
7
|
+
1. Push changes: `git push && git push --tags`
|
8
|
+
1. That's is. Github Actions will release the gem to Rubygems.org
|
@@ -12,7 +12,11 @@ class LicensePlateValidator
|
|
12
12
|
/^([0-9]{2})-?([a-zA-Z]{3})-?([0-9]{1})$/,
|
13
13
|
/^([0-9]{1})-?([a-zA-Z]{3})-?([0-9]{2})$/,
|
14
14
|
/^([a-zA-Z]{2})-?([0-9]{3})-?([a-zA-Z]{1})$/,
|
15
|
-
/^([a-zA-Z]{1})-?([0-9]{3})-?([a-zA-Z]{2})
|
15
|
+
/^([a-zA-Z]{1})-?([0-9]{3})-?([a-zA-Z]{2})$/,
|
16
|
+
/^([a-zA-Z]{3})-?([0-9]{2})-?([a-zA-Z])$/,
|
17
|
+
/^([0-9]{3})-?([a-zA-Z]{2})-?([0-9])$/,
|
18
|
+
/^([a-zA-Z])-?([0-9]{2})-?([a-zA-Z]{3})$/,
|
19
|
+
/^([0-9])-?([a-zA-Z]{2})-?([0-9]{3})$/
|
16
20
|
],
|
17
21
|
# Germany
|
18
22
|
de: [
|
@@ -23,7 +27,7 @@ class LicensePlateValidator
|
|
23
27
|
# 2. a 2-3-digit-number (country identifier) followed by 1-3 digits
|
24
28
|
# diplomatic license plates can be followed by a single letter
|
25
29
|
# regular license plates can be followed by an 'H' for oldtimers
|
26
|
-
/^(A|AA|AB|ABG|ABI|AC|AE|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z]?)$/i,
|
27
31
|
# more diplomatic license plates ;)
|
28
32
|
/^0[\- ]\d{1,3}[\- ]\d{1,3}\w?$/i
|
29
33
|
]
|
@@ -12,14 +12,14 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.summary = %q{Validate license plate numbers for countries that support it.}
|
13
13
|
spec.homepage = "https://ariejan.github.io/license_plate_validator"
|
14
14
|
spec.license = "MIT"
|
15
|
-
|
15
|
+
spec.required_ruby_version = ">= 3.1"
|
16
16
|
spec.files = `git ls-files`.split($/)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_development_dependency "bundler", "~>
|
22
|
-
spec.add_development_dependency "rspec", "~>
|
23
|
-
spec.add_development_dependency "rake"
|
24
|
-
spec.add_development_dependency 'activemodel', '~>
|
21
|
+
spec.add_development_dependency "bundler", "~> 2.5"
|
22
|
+
spec.add_development_dependency "rspec", "~> 3.13.0"
|
23
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
24
|
+
spec.add_development_dependency 'activemodel', '~> 7'
|
25
25
|
end
|
@@ -14,33 +14,35 @@ if defined?(ActiveModel)
|
|
14
14
|
validates :number, license_plate: true
|
15
15
|
end
|
16
16
|
|
17
|
-
describe
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
17
|
+
RSpec.describe "Ruby on Rails ActiveModel support" do
|
18
|
+
context DutchVehicle do
|
19
|
+
it "accepts Dutch plates only" do
|
20
|
+
obj = DutchVehicle.new(number: "60-NFH-1")
|
21
|
+
expect(obj).to be_valid
|
22
|
+
|
23
|
+
obj = DutchVehicle.new(number: "SBA5226")
|
24
|
+
expect(obj).not_to be_valid
|
25
|
+
end
|
24
26
|
end
|
25
|
-
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
28
|
+
context DutchMethodVehicle do
|
29
|
+
it "accepts Dutch plates only" do
|
30
|
+
obj = DutchMethodVehicle.new(number: "60-NFH-1", country: "nl")
|
31
|
+
expect(obj).to be_valid
|
31
32
|
|
32
|
-
|
33
|
-
|
33
|
+
obj = DutchMethodVehicle.new(number: "SBA5226", country: "nl")
|
34
|
+
expect(obj).not_to be_valid
|
35
|
+
end
|
34
36
|
end
|
35
|
-
end
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
context UnknownVehicle do
|
39
|
+
it "accepts both Dutch and German plates" do
|
40
|
+
obj = UnknownVehicle.new(number: "60-NFH-1")
|
41
|
+
expect(obj).to be_valid
|
41
42
|
|
42
|
-
|
43
|
-
|
43
|
+
obj = UnknownVehicle.new(number: "SBA5226")
|
44
|
+
expect(obj).to be_valid
|
45
|
+
end
|
44
46
|
end
|
45
47
|
end
|
46
48
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe LicensePlateValidator do
|
3
|
+
RSpec.describe LicensePlateValidator do
|
4
4
|
it 'should have a version number' do
|
5
|
-
LicensePlateValidator::VERSION.
|
5
|
+
expect(LicensePlateValidator::VERSION).not_to be_nil
|
6
6
|
end
|
7
7
|
|
8
|
-
|
8
|
+
context "#new" do
|
9
9
|
it 'demands one argument, optionally a second' do
|
10
|
-
expect { LicensePlateValidator.new() }.to raise_error
|
10
|
+
expect { LicensePlateValidator.new() }.to raise_error(ArgumentError)
|
11
11
|
expect { LicensePlateValidator.new ("a") }.not_to raise_error
|
12
12
|
expect { LicensePlateValidator.new("a", country: :nl) }.not_to raise_error
|
13
13
|
expect { LicensePlateValidator.new("a", country: nil) }.not_to raise_error
|
@@ -30,7 +30,7 @@ describe LicensePlateValidator do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "returns array of patterns for known countries" do
|
33
|
-
expect(subject.patterns_for_country(:nl).size).to eql(
|
33
|
+
expect(subject.patterns_for_country(:nl).size).to eql(14)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -79,7 +79,11 @@ describe LicensePlateValidator do
|
|
79
79
|
"61-NFH-1",
|
80
80
|
"1-KGB-42",
|
81
81
|
"FZ-142-X",
|
82
|
-
"X-721-FZ"
|
82
|
+
"X-721-FZ",
|
83
|
+
"GBB-01-B",
|
84
|
+
"V-01-BBB",
|
85
|
+
"9-XX-999",
|
86
|
+
"999-XX-9"
|
83
87
|
]
|
84
88
|
|
85
89
|
NL_INVALID_SAMPLES = [
|
@@ -108,6 +112,7 @@ describe LicensePlateValidator do
|
|
108
112
|
DE_VALID_SAMPLES = [
|
109
113
|
"K-AB-123",
|
110
114
|
"GL-A-123H",
|
115
|
+
"AC A123",
|
111
116
|
"K-9123",
|
112
117
|
"0-12-123",
|
113
118
|
"0-12-234H"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: license_plate_validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ariejan de Vroom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,56 +16,56 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.5'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 3.13.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 3.13.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
47
|
+
version: '13.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
54
|
+
version: '13.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: activemodel
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
61
|
+
version: '7'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version:
|
68
|
+
version: '7'
|
69
69
|
description: Formatting and content of license plate codes can be validated in some
|
70
70
|
countries. This gem add Rails validators for this to your project.
|
71
71
|
email:
|
@@ -74,6 +74,8 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/workflows/release.yml"
|
78
|
+
- ".github/workflows/test.yml"
|
77
79
|
- ".gitignore"
|
78
80
|
- ".rspec"
|
79
81
|
- ".travis.yml"
|
@@ -81,12 +83,12 @@ files:
|
|
81
83
|
- Gemfile
|
82
84
|
- LICENSE.txt
|
83
85
|
- README.md
|
86
|
+
- RELEASING.md
|
84
87
|
- Rakefile
|
85
|
-
-
|
86
|
-
-
|
87
|
-
- gemfiles/
|
88
|
-
- gemfiles/
|
89
|
-
- gemfiles/standalone
|
88
|
+
- gemfiles/Gemfile.rails7.0
|
89
|
+
- gemfiles/Gemfile.rails7.1
|
90
|
+
- gemfiles/Gemfile.rails7.2
|
91
|
+
- gemfiles/Gemfile.ruby
|
90
92
|
- lib/license_plate_validator.rb
|
91
93
|
- lib/license_plate_validator/active_model.rb
|
92
94
|
- lib/license_plate_validator/locales/de.yml
|
@@ -109,15 +111,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
109
111
|
requirements:
|
110
112
|
- - ">="
|
111
113
|
- !ruby/object:Gem::Version
|
112
|
-
version: '
|
114
|
+
version: '3.1'
|
113
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
114
116
|
requirements:
|
115
117
|
- - ">="
|
116
118
|
- !ruby/object:Gem::Version
|
117
119
|
version: '0'
|
118
120
|
requirements: []
|
119
|
-
|
120
|
-
rubygems_version: 2.2.2
|
121
|
+
rubygems_version: 3.5.16
|
121
122
|
signing_key:
|
122
123
|
specification_version: 4
|
123
124
|
summary: Validate license plate numbers for countries that support it.
|
data/gem-private_key.pem
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
-----BEGIN RSA PRIVATE KEY-----
|
2
|
-
MIIEpAIBAAKCAQEAyt2l9tkc4bL1zgKZk9UiNbqNElgCuRzV1pfk32Sb+S57RH9w
|
3
|
-
CE8mkYituGW0mLAjxg9h/lcn424Q62D+vlSJsHyjsgisWtu3ZHg1uy6VE8xWlCaD
|
4
|
-
tvOas51M8LNyQtS+f5pTy0WB4BOcKk5M9TwJDK4zX/CJBErxttBhYx1QJhiERHgg
|
5
|
-
1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