osu_person 0.1.0 → 0.2.0
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 +2 -0
- data/.rubocop.yml +3 -0
- data/Gemfile.lock +1 -1
- data/lib/osu/email.rb +9 -4
- data/lib/osu/person/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a29a8f449005a66774e3e4ec2ff2fbaf2c3f53b4768410cc80a919b74aedb62
|
|
4
|
+
data.tar.gz: 350f78ed70af1bb151eb3a58ce68ba094776fa9bbecc9ce302e488daca5232fe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d9d966a6b62f950db348011a135c329ecacbd40b087c277aa034572abe8febb55481e57826d32cf416cea8738706e8006686b3b31184fcabcaaad33a1223ccae
|
|
7
|
+
data.tar.gz: c22fc1515b79df74334615ecf4a3da8493041450e4dbb26b1da48d5f1fc4445ae823791ffa2dd6c0487a040d1a6990af4c9fee6830b4f98f6418d85774959999
|
data/.gitignore
CHANGED
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
data/lib/osu/email.rb
CHANGED
|
@@ -14,9 +14,7 @@ module OSU
|
|
|
14
14
|
attr_reader :email
|
|
15
15
|
|
|
16
16
|
def initialize(email)
|
|
17
|
-
unless self.class.valid?(email)
|
|
18
|
-
raise InvalidEmailError, 'Email must resemble name.#@osu.edu'
|
|
19
|
-
end
|
|
17
|
+
raise InvalidEmailError, email unless self.class.valid?(email)
|
|
20
18
|
|
|
21
19
|
@email = email.downcase
|
|
22
20
|
end
|
|
@@ -25,6 +23,13 @@ module OSU
|
|
|
25
23
|
VALID_EMAIL.match(email)['name_n']
|
|
26
24
|
end
|
|
27
25
|
|
|
28
|
-
|
|
26
|
+
# Raised when a string is an invalid email
|
|
27
|
+
class InvalidEmailError < ArgumentError
|
|
28
|
+
def initialize(email)
|
|
29
|
+
super(
|
|
30
|
+
"#{email} is not a valid OSU email. It must resemble name\.\#\@osu.edu"
|
|
31
|
+
)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
29
34
|
end
|
|
30
35
|
end
|
data/lib/osu/person/version.rb
CHANGED