osu_person 0.2.2 → 0.3
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 +4 -4
- data/.gitignore +3 -0
- data/.rubocop.yml +5 -4
- data/Dockerfile +1 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +35 -30
- data/lib/osu/email.rb +2 -2
- data/lib/osu/emplid.rb +15 -0
- data/lib/osu_person.rb +4 -3
- data/lib/osu_person/version.rb +1 -1
- data/osu_person.gemspec +23 -22
- metadata +20 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 30881aefd20dbb04320067323bac86c243b0e0f8429125da46fe982b087fd6cd
|
|
4
|
+
data.tar.gz: 147f470a7772682b2e9c7f6c7352b83d5c5a57dac8639eed8092b809c76d3695
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e0e949a4c8f7df579e73458f72a2c0b8e4f09fb42f735d6c0f621dc24f0694a133629a473a93756407f251f2e197f3e26ff3b51db283c2c0c74011eaec0cb73e
|
|
7
|
+
data.tar.gz: 3862f851984aab14c2123f2c27776a4ec4b4cf3675f166113dcad8150229d162ee05c28c3bc8593ea414ae4ec06f394bc4a3e7e212a2af629d83812ddc62e946
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Dockerfile
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
osu_person (0.
|
|
4
|
+
osu_person (0.3)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
addressable (2.
|
|
9
|
+
addressable (2.6.0)
|
|
10
10
|
public_suffix (>= 2.0.2, < 4.0)
|
|
11
11
|
ast (2.4.0)
|
|
12
12
|
axiom-types (0.1.1)
|
|
13
13
|
descendants_tracker (~> 0.0.4)
|
|
14
14
|
ice_nine (~> 0.11.0)
|
|
15
15
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
16
|
-
bundler-audit (0.6.
|
|
17
|
-
bundler (
|
|
16
|
+
bundler-audit (0.6.1)
|
|
17
|
+
bundler (>= 1.2.0, < 3)
|
|
18
18
|
thor (~> 0.18)
|
|
19
19
|
codeclimate-engine-rb (0.4.1)
|
|
20
20
|
virtus (~> 1.0)
|
|
@@ -37,25 +37,28 @@ GEM
|
|
|
37
37
|
ruby_parser (~> 3.1, > 3.1.0)
|
|
38
38
|
sexp_processor (~> 4.8)
|
|
39
39
|
ice_nine (0.11.2)
|
|
40
|
-
jaro_winkler (1.5.
|
|
41
|
-
json (2.
|
|
40
|
+
jaro_winkler (1.5.2)
|
|
41
|
+
json (2.2.0)
|
|
42
|
+
kwalify (0.7.2)
|
|
42
43
|
launchy (2.4.3)
|
|
43
44
|
addressable (~> 2.3)
|
|
44
|
-
method_source (0.9.
|
|
45
|
-
parallel (1.
|
|
46
|
-
parser (2.
|
|
45
|
+
method_source (0.9.2)
|
|
46
|
+
parallel (1.17.0)
|
|
47
|
+
parser (2.6.3.0)
|
|
47
48
|
ast (~> 2.4.0)
|
|
48
49
|
path_expander (1.0.3)
|
|
49
|
-
|
|
50
|
-
pry (0.12.0)
|
|
50
|
+
pry (0.12.2)
|
|
51
51
|
coderay (~> 1.1.0)
|
|
52
52
|
method_source (~> 0.9.0)
|
|
53
|
+
psych (3.1.0)
|
|
53
54
|
public_suffix (3.0.3)
|
|
54
55
|
rainbow (3.0.0)
|
|
55
|
-
rake (12.3.
|
|
56
|
-
reek (
|
|
56
|
+
rake (12.3.2)
|
|
57
|
+
reek (5.3.2)
|
|
57
58
|
codeclimate-engine-rb (~> 0.4.0)
|
|
58
|
-
|
|
59
|
+
kwalify (~> 0.7.0)
|
|
60
|
+
parser (>= 2.5.0.0, < 2.7, != 2.5.1.1)
|
|
61
|
+
psych (~> 3.1.0)
|
|
59
62
|
rainbow (>= 2.0, < 4.0)
|
|
60
63
|
rspec (3.8.0)
|
|
61
64
|
rspec-core (~> 3.8.0)
|
|
@@ -63,44 +66,45 @@ GEM
|
|
|
63
66
|
rspec-mocks (~> 3.8.0)
|
|
64
67
|
rspec-core (3.8.0)
|
|
65
68
|
rspec-support (~> 3.8.0)
|
|
66
|
-
rspec-expectations (3.8.
|
|
69
|
+
rspec-expectations (3.8.3)
|
|
67
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
68
71
|
rspec-support (~> 3.8.0)
|
|
69
72
|
rspec-mocks (3.8.0)
|
|
70
73
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
71
74
|
rspec-support (~> 3.8.0)
|
|
72
75
|
rspec-support (3.8.0)
|
|
73
|
-
rubocop (0.
|
|
76
|
+
rubocop (0.70.0)
|
|
74
77
|
jaro_winkler (~> 1.5.1)
|
|
75
78
|
parallel (~> 1.10)
|
|
76
|
-
parser (>= 2.
|
|
77
|
-
powerpack (~> 0.1)
|
|
79
|
+
parser (>= 2.6)
|
|
78
80
|
rainbow (>= 2.2.2, < 4.0)
|
|
79
81
|
ruby-progressbar (~> 1.7)
|
|
80
|
-
unicode-display_width (
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
unicode-display_width (>= 1.4.0, < 1.7)
|
|
83
|
+
rubocop-performance (1.3.0)
|
|
84
|
+
rubocop (>= 0.68.0)
|
|
85
|
+
ruby-progressbar (1.10.0)
|
|
86
|
+
ruby_parser (3.13.1)
|
|
83
87
|
sexp_processor (~> 4.9)
|
|
84
|
-
rubycritic (
|
|
88
|
+
rubycritic (4.0.2)
|
|
85
89
|
flay (~> 2.8)
|
|
86
90
|
flog (~> 4.4)
|
|
87
91
|
launchy (= 2.4.3)
|
|
88
|
-
parser (~> 2.
|
|
92
|
+
parser (~> 2.6.0)
|
|
89
93
|
rainbow (~> 3.0)
|
|
90
|
-
reek (~>
|
|
94
|
+
reek (~> 5.3.0)
|
|
91
95
|
ruby_parser (~> 3.8)
|
|
92
|
-
tty-which (~> 0.
|
|
96
|
+
tty-which (~> 0.4.0)
|
|
93
97
|
virtus (~> 1.0)
|
|
94
|
-
sexp_processor (4.
|
|
98
|
+
sexp_processor (4.12.0)
|
|
95
99
|
simplecov (0.16.1)
|
|
96
100
|
docile (~> 1.1)
|
|
97
101
|
json (>= 1.8, < 3)
|
|
98
102
|
simplecov-html (~> 0.10.0)
|
|
99
103
|
simplecov-html (0.10.2)
|
|
100
|
-
thor (0.20.
|
|
104
|
+
thor (0.20.3)
|
|
101
105
|
thread_safe (0.3.6)
|
|
102
|
-
tty-which (0.
|
|
103
|
-
unicode-display_width (1.
|
|
106
|
+
tty-which (0.4.0)
|
|
107
|
+
unicode-display_width (1.6.0)
|
|
104
108
|
virtus (1.0.5)
|
|
105
109
|
axiom-types (~> 0.1)
|
|
106
110
|
coercible (~> 1.0)
|
|
@@ -118,8 +122,9 @@ DEPENDENCIES
|
|
|
118
122
|
rake
|
|
119
123
|
rspec
|
|
120
124
|
rubocop
|
|
125
|
+
rubocop-performance
|
|
121
126
|
rubycritic
|
|
122
127
|
simplecov
|
|
123
128
|
|
|
124
129
|
BUNDLED WITH
|
|
125
|
-
|
|
130
|
+
2.0.1
|
data/lib/osu/email.rb
CHANGED
|
@@ -20,14 +20,14 @@ module OSU
|
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def name_n
|
|
23
|
-
VALID_EMAIL.match(email)[
|
|
23
|
+
VALID_EMAIL.match(email)["name_n"]
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
# Raised when a string is an invalid email
|
|
27
27
|
class InvalidEmailError < ArgumentError
|
|
28
28
|
def initialize(email)
|
|
29
29
|
super(
|
|
30
|
-
"#{email} is not a valid OSU email. It must resemble name
|
|
30
|
+
"#{email} is not a valid OSU email. It must resemble name.\#@osu.edu"
|
|
31
31
|
)
|
|
32
32
|
end
|
|
33
33
|
end
|
data/lib/osu/emplid.rb
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
module OSU
|
|
2
|
+
# Validates an osu emplid.
|
|
3
|
+
class Emplid
|
|
4
|
+
# a valid emplid is an 8-9 digit string
|
|
5
|
+
VALID_EMPLID = /\A\d{8,9}\z/
|
|
6
|
+
|
|
7
|
+
# Returns true if the emplid is valid.
|
|
8
|
+
def self.valid?(emplid)
|
|
9
|
+
case emplid
|
|
10
|
+
when VALID_EMPLID then true
|
|
11
|
+
else false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/osu_person.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require
|
|
1
|
+
require "osu/email"
|
|
2
|
+
require "osu/emplid"
|
|
3
|
+
require "osu/name_n"
|
|
4
|
+
require "osu_person/version"
|
data/lib/osu_person/version.rb
CHANGED
data/osu_person.gemspec
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
lib = File.expand_path(
|
|
1
|
+
lib = File.expand_path("lib", __dir__)
|
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
|
4
|
-
require
|
|
4
|
+
require "osu_person/version"
|
|
5
5
|
|
|
6
6
|
Gem::Specification.new do |spec|
|
|
7
|
-
spec.name =
|
|
7
|
+
spec.name = "osu_person"
|
|
8
8
|
spec.version = OSU::Person::VERSION
|
|
9
|
-
spec.authors = [
|
|
10
|
-
spec.email = [
|
|
9
|
+
spec.authors = ["ASCTech AppDev"]
|
|
10
|
+
spec.email = ["appdev@asc.osu.edu"]
|
|
11
11
|
|
|
12
12
|
spec.summary = "Validate an ohio state person's email, name.#, & emplid."
|
|
13
13
|
spec.description = "Validate an ohio state person's email, name.#, & emplid."
|
|
14
|
-
spec.homepage =
|
|
15
|
-
spec.license =
|
|
14
|
+
spec.homepage = "https://code.osu.edu/asctech/osu_person"
|
|
15
|
+
spec.license = "MIT"
|
|
16
16
|
|
|
17
17
|
if spec.respond_to?(:metadata)
|
|
18
|
-
spec.metadata[
|
|
18
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
|
19
19
|
else
|
|
20
|
-
raise
|
|
21
|
-
|
|
20
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
|
21
|
+
"public gem pushes."
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
|
@@ -26,17 +26,18 @@ Gem::Specification.new do |spec|
|
|
|
26
26
|
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
spec.bindir =
|
|
29
|
+
spec.bindir = "exe"
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
31
|
-
spec.require_paths = [
|
|
32
|
-
|
|
33
|
-
spec.add_development_dependency
|
|
34
|
-
spec.add_development_dependency
|
|
35
|
-
|
|
36
|
-
spec.add_development_dependency
|
|
37
|
-
spec.add_development_dependency
|
|
38
|
-
spec.add_development_dependency
|
|
39
|
-
spec.add_development_dependency
|
|
40
|
-
spec.add_development_dependency
|
|
41
|
-
spec.add_development_dependency
|
|
31
|
+
spec.require_paths = ["lib"]
|
|
32
|
+
|
|
33
|
+
spec.add_development_dependency "bundler"
|
|
34
|
+
spec.add_development_dependency "rake"
|
|
35
|
+
|
|
36
|
+
spec.add_development_dependency "bundler-audit"
|
|
37
|
+
spec.add_development_dependency "pry"
|
|
38
|
+
spec.add_development_dependency "rspec"
|
|
39
|
+
spec.add_development_dependency "rubocop"
|
|
40
|
+
spec.add_development_dependency "rubocop-performance"
|
|
41
|
+
spec.add_development_dependency "rubycritic"
|
|
42
|
+
spec.add_development_dependency "simplecov"
|
|
42
43
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: osu_person
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: '0.3'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- ASCTech AppDev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2019-05-22 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -94,6 +94,20 @@ dependencies:
|
|
|
94
94
|
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
|
+
- !ruby/object:Gem::Dependency
|
|
98
|
+
name: rubocop-performance
|
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
|
100
|
+
requirements:
|
|
101
|
+
- - ">="
|
|
102
|
+
- !ruby/object:Gem::Version
|
|
103
|
+
version: '0'
|
|
104
|
+
type: :development
|
|
105
|
+
prerelease: false
|
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
107
|
+
requirements:
|
|
108
|
+
- - ">="
|
|
109
|
+
- !ruby/object:Gem::Version
|
|
110
|
+
version: '0'
|
|
97
111
|
- !ruby/object:Gem::Dependency
|
|
98
112
|
name: rubycritic
|
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -124,7 +138,7 @@ dependencies:
|
|
|
124
138
|
version: '0'
|
|
125
139
|
description: Validate an ohio state person's email, name.#, & emplid.
|
|
126
140
|
email:
|
|
127
|
-
-
|
|
141
|
+
- appdev@asc.osu.edu
|
|
128
142
|
executables: []
|
|
129
143
|
extensions: []
|
|
130
144
|
extra_rdoc_files: []
|
|
@@ -144,6 +158,7 @@ files:
|
|
|
144
158
|
- bin/console
|
|
145
159
|
- bin/setup
|
|
146
160
|
- lib/osu/email.rb
|
|
161
|
+
- lib/osu/emplid.rb
|
|
147
162
|
- lib/osu/name_n.rb
|
|
148
163
|
- lib/osu_person.rb
|
|
149
164
|
- lib/osu_person/version.rb
|
|
@@ -168,8 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
168
183
|
- !ruby/object:Gem::Version
|
|
169
184
|
version: '0'
|
|
170
185
|
requirements: []
|
|
171
|
-
|
|
172
|
-
rubygems_version: 2.7.3
|
|
186
|
+
rubygems_version: 3.0.3
|
|
173
187
|
signing_key:
|
|
174
188
|
specification_version: 4
|
|
175
189
|
summary: Validate an ohio state person's email, name.#, & emplid.
|